/[baselayout]/trunk/conf.d.BSD/net.example
Gentoo

Contents of /trunk/conf.d.BSD/net.example

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2547 - (show annotations) (download)
Thu Apr 5 11:18:42 2007 UTC (7 years, 8 months ago) by uberlord
File size: 12320 byte(s)
    Rewrite the core parts in C. We now provide librc so other programs can
    query runlevels, services and state without using bash. We also provide
    libeinfo so other programs can easily use our informational functions.

    As such, we have dropped the requirement of using bash as the init script
    shell. We now use /bin/sh and have strived to make the scripts as portable
    as possible. Shells that work are bash and dash. busybox works provided
    you disable s-s-d. If you have WIPE_TMP set to yes in conf.d/bootmisc you
    should disable find too.
    zsh and ksh do not work at this time.

    Networking support is currently being re-vamped also as it was heavily bash
    array based. As such, a new config format is available like so
    config_eth0="1.2.3.4/24 5.6.7.8/16"
    or like so
    config_eth0="'1.2.3.4 netmask 255.255.255.0' '5.6.7.8 netmask 255.255.0.0'"

    We will still support the old bash array format provided that /bin/sh IS
    a link it bash.

    ChangeLog for baselayout-1 can be found in our SVN repo.
1 # BSD NOTE: Network functionality support is still being written and
2 # many parts here are missing compared to Gentoo/Linux
3 # Feel free to write the needed modules and submit them to us :)
4 #
5 ##############################################################################
6 # QUICK-START
7 #
8 # The quickest start is if you want to use DHCP.
9 # In that case, everything should work out of the box, no configuration
10 # necessary, though the startup script will warn you that you haven't
11 # specified anything.
12
13 # WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6
14 # (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have
15 # the relevant kernel option enabled. So if you don't have an IPv6 enabled
16 # kernel then remove the IPv6 address from your config.
17
18 # If you want to use a static address or use DHCP explicitly, jump
19 # down to the section labelled INTERFACE HANDLERS.
20 #
21 # If you want to do anything more fancy, you should take the time to
22 # read through the rest of this file.
23
24 ##############################################################################
25 # MODULES
26 #
27 # We now support modular networking scripts which means we can easily
28 # add support for new interface types and modules while keeping
29 # compatability with existing ones.
30 #
31 # Modules load by default if the package they need is installed. If
32 # you specify a module here that doesn't have it's package installed
33 # then you get an error stating which package you need to install.
34 # Ideally, you only use the modules setting when you have two or more
35 # packages installed that supply the same service.
36 #
37 # In other words, you probably should DO NOTHING HERE...
38
39 ##############################################################################
40 # INTERFACE HANDLERS
41
42 # For a static configuration, use something like this
43 # (They all do exactly the same thing btw)
44 #config_eth0="192.168.0.2/24"
45 #config_eth0="'192.168.0.2 netmask 255.255.255.0'"
46
47 # We can also specify a broadcast
48 #config_eth0="'192.168.0.2/24 brd 192.168.0.255'"
49 #config_eth0="'192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255'"
50
51 # If you need more than one address, you can use something like this
52 # NOTE: ifconfig creates an aliased device for each extra IPv4 address
53 # (eth0:1, eth0:2, etc)
54 # iproute2 does not do this as there is no need to
55 #config_eth0="'192.168.0.2/24' '192.168.0.3/24' '192.168.0.4/24'"
56 # Or you can use sequence expressions
57 #config_eth0="'192.168.0.{2..4}/24'" FIXME - may not work with baselayout2
58 # which does the same as above. Be careful though as if you use this and
59 # fallbacks, you have to ensure that both end up with the same number of
60 # values otherwise your fallback won't work correctly.
61
62 # You can also use IPv6 addresses
63 # (you should always specify a prefix length with IPv6 here)
64 #config_eth0="192.168.0.2/24 \
65 #4321:0:1:2:3:4:567:89ab/64 \
66 #4321:0:1:2:3:4:567:89ac/64"
67
68 # If you wish to keep existing addresses + routing and the interface is up,
69 # you can specify a noop (no operation). If the interface is down or there
70 # are no addresses assigned, then we move onto the next step (default dhcp)
71 # This is useful when configuring your interface with a kernel command line
72 # or similar
73 #config_eth0="noop 192.168.0.2/24"
74
75 # If you don't want ANY address (only useful when calling for advanced stuff)
76 #config_eth0="null"
77
78 # Here's how to do routing if you need it
79 # We add an IPv4 default route, IPv4 subnet route and an IPv6 unicast route
80 #routes_eth0=" \
81 # 'default via 192.168.0.1' \
82 # '10.0.0.0/8 via 192.168.0.1' \
83 # '::/0' \
84 #"
85
86 # If a specified module fails (like dhcp - see below), you can specify a
87 # fallback like so
88 #fallback_eth0="'192.168.0.2 netmask 255.255.255.0'"
89 #fallback_route_eth0="'default via 192.168.0.1'"
90
91 # NOTE: fallback entry must match the entry location in config_eth0
92 # As such you can only have one fallback route.
93
94 # Some users may need to alter the MTU - here's how
95 #mtu_eth0="1500"
96
97 # Most drivers that report carrier status function correctly, but some do not
98 # One of these faulty drivers is for the Intel e1000 network card, but only
99 # at boot time. To get around this you may alter the carrier_timeout value for
100 # the interface. -1 is disable, 0 is infinite and any other number of seconds
101 # is how long we wait for carrier. The current default is 3 seconds
102 #carrier_timeout_eth0=-1
103
104 ##############################################################################
105 # OPTIONAL MODULES
106
107 #-----------------------------------------------------------------------------
108 # WIRELESS (802.11 support)
109 # Wireless can be provided by BSDs ifconfig or wpa_supplicant
110
111 # ifconfig support is a one shot script - wpa_supplicant is daemon that
112 # scans, assoicates and re-configures if assocation is lost.
113 # wpa_supplicant is preferred
114 # See wireless.example for details about using ifconfig for wireless
115
116 # emerge net-wireless/wpa-supplicant
117 # Wireless options are held in /etc/wpa_supplicant/wpa_supplicant.conf
118 # Console the wpa_supplicant.conf.example that is installed in
119 # /usr/share/doc/wpa_supplicant
120
121 # By default we don't wait for wpa_suppliant to associate and authenticate.
122 # If you would like to, so can specify how long in seconds
123 #associate_timeout_eth0=60
124 # A value of 0 means wait forever.
125
126 # You can also override any settings found here per SSID - which is very
127 # handy if you use different networks a lot. See below for using the SSID
128 # in our variables
129 #config_SSID="dhcp"
130 # See the System module below for setting dns/nis/ntp per SSID
131
132 # You can also override any settings found here per MAC address of the AP
133 # in case you use Access Points with the same SSID but need different
134 # networking configs. Below is an example - of course you use the same
135 # method with other variables
136 #mac_config_001122334455="dhcp"
137 #mac_dns_servers_001122334455="192.168.0.1 192.168.0.2"
138
139 # When an interface has been associated with an Access Point, a global
140 # variable called SSID is set to the Access Point's SSID for use in the
141 # pre/post user functions below (although it's not available in preup as you
142 # won't have associated then)
143
144 # If you're using anything else to configure wireless on your interface AND
145 # you have installed wpa_supplicant, you need to disable wpa_supplicant
146 #modules="!iwconfig !wpa_supplicant"
147 #or
148 #modules="!wireless"
149
150 ##############################################################################
151 # WIRELESS SSID IN VARIABLES
152 ##############################################################################
153 # Remember to change SSID to your SSID.
154 # Say that your SSID is My NET - the line
155 # #key_SSID="s:passkey"
156 # becomes
157 # #key_My_NET="s:passkey"
158 # Notice that the space has changed to an underscore - do the same with all
159 # characters not in a-z A-Z (English alphabet) 0-9. This only applies to
160 # variables and not values.
161 #
162 # Any SSID's in values like essid_eth0="My NET" may need to be escaped
163 # This means placing the character \ before the character
164 # \" need to be escaped for example
165 # So if your SSID is
166 # My "\ NET
167 # it becomes
168 # My \"\\ NET
169 # for example
170 # #essid_eth0="My\"\\NET"
171 #
172 # So using the above we can use
173 # #dns_domain_My____NET="My\"\\NET"
174 # which is an invalid dns domain, but shows the how to use the variable
175 # structure
176 #########################################################
177
178 #-----------------------------------------------------------------------------
179 # DHCP
180 # DHCP can be provided by dhclient.
181 #
182 # dhcpcd: emerge net-misc/dhcpcd
183 # dhclient: emerge net-misc/dhcp
184
185 # Regardless of which DHCP client you prefer, you configure them the
186 # same way using one of following depending on which interface modules
187 # you're using.
188 #config_eth0="dhcp"
189
190 # For passing custom options to dhcpcd use something like the following. This
191 # example reduces the timeout for retrieving an address from 60 seconds (the
192 # default) to 10 seconds.
193 #dhcpcd_eth0="-t 10"
194
195 # GENERIC DHCP OPTIONS
196 # Set generic DHCP options like so
197 #dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
198
199 # This tells the dhcp client to release it's lease when it stops, not to
200 # overwrite dns, ntp and nis settings, not to set a default route and not to
201 # send the current hostname to the dhcp server and when it starts.
202 # You can use any combination of the above options - the default is not to
203 # use any of them.
204
205
206 #-----------------------------------------------------------------------------
207 # System
208 # For configuring system specifics such as domain, dns, ntp and nis servers
209 # It's rare that you would need todo this, but you can anyway.
210 # This is most benefit to wireless users who don't use DHCP so they can change
211 # their configs based on SSID. See above for more details
212
213 # Setting name/domain server causes /etc/resolv.conf to be overwritten
214 # Note that if DHCP is used, and you want this to take precedence then
215 # set dhcp_SSID="nodns"
216 # To use dns settings such as these, dns_servers_eth0 must be set!
217 # If you omit the _eth0 suffix, then it applies to all interfaces unless
218 # overridden by the interface suffix.
219 #dns_domain_eth0="your.domain"
220 #dns_servers_eth0="192.168.0.2 192.168.0.3"
221 #dns_search_eth0="this.domain that.domain"
222 #dns_options_eth0="'timeout 1' 'rotate'"
223 #dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
224 # See the man page for resolv.conf for details about the options and sortlist
225 # directives
226
227 #ntp_servers_eth0="192.168.0.2 192.168.0.3"
228
229 #nis_domain_eth0="domain"
230 #nis_servers_eth0="192.168.0.2 192.168.0.3"
231
232 # NOTE: Setting any of these will stamp on the files in question. So if you
233 # don't specify dns_servers but you do specify dns_domain then no nameservers
234 # will be listed in /etc/resolv.conf even if there were any there to start
235 # with.
236 # If this is an issue for you then maybe you should look into a resolv.conf
237 # manager like resolvconf-gentoo to manage this file for you. All packages
238 # that baselayout supports use resolvconf-gentoo if installed.
239
240 #-----------------------------------------------------------------------------
241 # Cable in/out detection
242 # Sometimes the cable is in, others it's out. Obviously you don't want to
243 # restart net.eth0 every time when you plug it in either.
244 # BSD has the Device State Change Daemon - or devd for short
245 # To enable this, simple add devd to the boot runlevel
246 #rc-update add devd boot
247 #rc
248
249 ##############################################################################
250 # ADVANCED CONFIGURATION
251 #
252 # Four functions can be defined which will be called surrounding the
253 # start/stop operations. The functions are called with the interface
254 # name first so that one function can control multiple adapters. An extra two
255 # functions can be defined when an interface fails to start or stop.
256 #
257 # The return values for the preup and predown functions should be 0
258 # (success) to indicate that configuration or deconfiguration of the
259 # interface can continue. If preup returns a non-zero value, then
260 # interface configuration will be aborted. If predown returns a
261 # non-zero value, then the interface will not be allowed to continue
262 # deconfiguration.
263 #
264 # The return values for the postup, postdown, failup and faildown functions are
265 # ignored since there's nothing to do if they indicate failure.
266 #
267 # ${IFACE} is set to the interface being brought up/down
268 # ${IFVAR} is ${IFACE} converted to variable name bash allows
269
270 #preup() {
271 # # Remember to return 0 on success
272 # return 0
273 #}
274
275 #predown() {
276 # # The default in the script is to test for NFS root and disallow
277 # # downing interfaces in that case. Note that if you specify a
278 # # predown() function you will override that logic. Here it is, in
279 # # case you still want it...
280 # if is_net_fs /; then
281 # eerror "root filesystem is network mounted -- can't stop ${IFACE}"
282 # return 1
283 # fi
284 #
285 # # Remember to return 0 on success
286 # return 0
287 #}
288
289 #postup() {
290 # # This function could be used, for example, to register with a
291 # # dynamic DNS service. Another possibility would be to
292 # # send/receive mail once the interface is brought up.
293
294 #}
295
296 #postdown() {
297 # # Return 0 always
298 # return 0
299 #}
300
301 #failup() {
302 # # This function is mostly here for completeness... I haven't
303 # # thought of anything nifty to do with it yet ;-)
304 #}
305
306 #faildown() {
307 # # This function is mostly here for completeness... I haven't
308 # # thought of anything nifty to do with it yet ;-)
309 #}

  ViewVC Help
Powered by ViewVC 1.1.20