/[baselayout]/trunk/net-scripts/conf.d/net.example
Gentoo

Contents of /trunk/net-scripts/conf.d/net.example

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1302 - (show annotations) (download)
Thu Jul 14 16:29:45 2005 UTC (9 years ago) by uberlord
File size: 21160 byte(s)
New pump and dhcpcd helpers as pump now does everything it should - weeeeee
1 ##############################################################################
2 # QUICK-START
3 #
4 # The quickest start is if you want to use DHCP.
5 # In that case, everything should work out of the box, no configuration
6 # necessary, though the startup script will warn you that you haven't
7 # specified anything.
8 #
9 # If you want to use a static address or use DHCP explicitly, jump
10 # down to the section labelled INTERFACE HANDLERS.
11 #
12 # If you want to do anything more fancy, you should take the time to
13 # read through the rest of this file.
14
15 ##############################################################################
16 # DEFAULTS
17 #
18 # RC_AUTO_INTERFACE="yes"
19 # Set this to no to stop trying to best guess your network setup and choose
20 # the best interface to use by default
21
22 # When it's set to yes, we
23 # default to DHCP
24 # link /etc/{resolv,ntp,yp}.conf to /var/lib/net-scripts
25 # calculate a metric based on what interfaces are up and type
26 # select the interface (use it's resolv.conf, ntp.conf and yp.conf that
27 # were created when it became active)
28 # otherwise we
29 # default to NULL
30
31 # hotplug_eth0="yes"
32 # Do we allow hotplug to bring up interfaces or not? The default is we do,
33 # otherwise put no in the above value.
34 # NOTE: hotplug just has to be installed for hotplugging to work - it does
35 # not matter if it's in any runlevel or not.
36
37 ##############################################################################
38 # MODULES
39 #
40 # We now support modular networking scripts which means we can easily
41 # add support for new interface types and modules while keeping
42 # compatability with existing ones.
43 #
44 # Modules load by default if the package they need is installed. If
45 # you specify a module here that doesn't have it's package installed
46 # then you get an error stating which package you need to install.
47 # Ideally, you only use the modules setting when you have two or more
48 # packages installed that supply the same service.
49 #
50 # In other words, you probably should DO NOTHING HERE...
51
52 # Prefer ifconfig over iproute2
53 #modules=( "iproute2" )
54
55 # You can also specify other modules for an interface
56 # In this case we prefer udhcpc over dhcpcd
57 #modules_eth0=( "udhcpc" )
58
59 # You can also specify which modules not to use - for example you may be
60 # using a supplicant or linux-wlan-ng to control wireless configuration but
61 # you still want to configure network settings per ESSID associated with.
62 #modules=( "!iwconfig" "!wpa_supplicant" )
63 # IMPORTANT: If you need the above, please disable modules in that order
64
65
66 ##############################################################################
67 # INTERFACE HANDLERS
68 #
69 # We provide two interface handlers presently: ifconfig and iproute2.
70 # You need one of these to do any kind of network configuration.
71 # For ifconfig support, emerge sys-apps/net-tools
72 # For iproute2 support, emerge sys-apps/iproute2
73
74 # If you don't specify an interface then we prefer iproute2 if it's installed
75 # To prefer ifconfig over iproute2
76 #modules=( "ifconfig" )
77
78 # For a static configuration, use something like this
79 # (They all do exactly the same thing btw)
80 #config_eth0=( "192.168.0.2/24" )
81 #config_eth0=( "192.168.0.2 netmask 255.255.255.0" )
82
83 # We can also specify a broadcast
84 #config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
85 #config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" )
86
87 # If you need more than one address, you can use something like this
88 # NOTE: ifconfig creates an aliased device for each extra IPv4 address
89 # (eth0:1, eth0:2, etc)
90 # iproute2 does not do this as there is no need to
91 #config_eth0=(
92 # "192.168.0.2/24"
93 # "192.168.0.3/24"
94 # "192.168.0.4/24"
95 #)
96 # Or you can use sequence expresions
97 #config_eth0=( "192.168.0.{2..4}/24" )
98 # which does the same as above. Be careful though as if you use this and
99 # fallbacks, you have to ensure that both end up with the same number of
100 # values otherwise your fallback won't work correctly.
101
102 # You can also use IPv6 addresses
103 #config_eth0=(
104 # "192.168.0.2/24"
105 # "4321:0:1:2:3:4:567:89ab"
106 # "4321:0:1:2:3:4:567:89ac"
107 #)
108
109 # If you wish to keep existing addresses + routing and the interface is up,
110 # you can specify a noop (no operation). If the interface is down or there
111 # are no addresses assigned, then we move onto the next step (default dhcp)
112 # This is useful when configuring your interface with a kernel command line
113 # or similar
114 #config_eth0=( "noop" "192.168.0.2/24" )
115
116 # If you don't want ANY address (only useful when calling for advanced stuff)
117 #config_eth0=( "null" )
118
119 # Here's how todo routing if you need it - the below sets the default gateway
120 #routes_eth0=(
121 # "default via 192.168.0.1"
122 # "default via 4321:0:1:2:3:4:567:89ab"
123 #)
124
125 # If a specified module fails (like dhcp - see below), you can specify a
126 # fallback like so
127 #fallback_eth0=( "192.168.0.2 netmask 255.255.255.0" )
128 #fallback_route_eth0=( "default via 192.168.0.1" )
129
130 # NOTE: fallback entry must match the entry location in config_eth0
131 # As such you can only have one fallback route.
132
133 # Some users may need to alter the MTU - here's how
134 #mtu_eth0="1500"
135
136 ##############################################################################
137 # OPTIONAL MODULES
138
139 # INTERFACE RENAMING
140 # There is no consistent device renaming scheme for Linux.
141 # The preferred way of naming devices is via the kernel module directly or
142 # by using udev (http://www.reactivated.net/udevrules.php)
143
144 # If you are unable to write udev rules, then we do provide a way of renaming
145 # the interface based on it's MAC address, but it is not optimal.
146 # Here is how to rename an interface whose MAC address is 00:11:22:33:44:55
147 # to foo1
148 #rename_001122334455="foo1"
149
150 # You can also do this based on current device name - although this is not
151 # recommended. Here we rename eth1 to foo2.
152 #rename_eth1="foo2"
153
154 #-----------------------------------------------------------------------------
155 # WIRELESS (802.11 support)
156 # Wireless can be provided by iwconfig or wpa_supplicant
157
158 # iwconfig
159 # emerge net-wireless/wireless-tools
160 # Wireless options are held in /etc/conf.d/wireless - but could be here too
161 # Consult the sample file /etc/conf.d/wireless.example for instructions
162 # iwconfig is the default
163
164 # wpa_supplicant
165 # emerge net-wireless/wpa-supplicant
166 # Wireless options are held in /etc/wpa_supplicant.conf
167 # Consult the sample file /etc/wpa_supplicant.conf.example for instructions
168 # To choose wpa_supplicant over iwconfig
169 #modules=( "wpa_supplicant" )
170 # To configure wpa_supplicant
171 #wpa_supplicant_eth0="-Dprism54" # For Prism54 based cards
172 #wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards
173 # Consult wpa_supplicant for more drivers
174 # By default we give wpa_suppliant 60 seconds to associate and authenticate
175 #wpa_timeout_eth0=60
176
177 # GENERIC WIRELESS OPTIONS
178 # PLEASE READ THE INSTRUCTIONS IN /etc/conf.d/wireless.example FOR
179 # HOW TO USE THIS ESSID VARIABLE
180 # You can also override any settings found here per ESSID - which is very
181 # handy if you use different networks a lot
182 #config_ESSID=( "dhcp" )
183 #dhcpcd_ESSID="-t 5"
184
185 # Setting name/domain server causes /etc/resolv.conf to be overwritten
186 # Note that if DHCP is used, and you want this to take precedence then
187 # set dhcp_ESSID="nodns"
188 #dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" )
189 #dns_domain_ESSID="some.domain"
190 #dns_search_path_ESSID="search.this.domain search.that.domain"
191 # Please check the man page for resolv.conf for more information
192 # as domain and search are mutually exclusive.
193
194 # You can also override any settings found here per MAC address of the AP
195 # incase you use Access Points with the same ESSID but need different
196 # networking configs. Below is an example - of course you use the same
197 # method with other variables
198 #mac_config_001122334455=( "dhcp" )
199 #mac_dhcpcd_001122334455="-t 10"
200 #mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )
201
202 # When an interface has been associated with an Access Point, a global
203 # variable called ESSID is set to the Access Point's ESSID for use in the
204 # pre/post user functions below (although it's not available in preup as you
205 # won't have associated then)
206
207 # If you're using anything else to configure wireless on your interface AND
208 # you have installed any of the above packages, you need to disable them
209 #modules=( "!iwconfig" "!wpa_supplicant" )
210
211 #-----------------------------------------------------------------------------
212 # DHCP
213 # DHCP can be provided by dhcpcd, dhclient, udhcpc or pump
214 #
215 # dhclient: emerge net-misc/dhcp
216 # dhcpcd: emerge net-misc/dhcpcd
217 # pump: emerge net-misc/pump
218 # udhcpc: emerge net-misc/udhcp
219
220 # If you have more than one DHCP client installed, you need to specify which
221 # one to use - otherwise we default to dhcpcd if available
222 #modules=( "udhcpc" ) # to select udhcpc over dhcpcd
223 #
224 # Notes:
225 # - dhcpcd, udhcpc and pump send the current hostname
226 # to the DHCP server by default
227 # pump always sends the current hostname - so below to disable
228 # udhcpc and dhcpcd from doing this
229 # - dhclient attempts to modify /etc/dhclient.conf (or the file specified
230 # by the -cf option) with the current hostname and to strip any script
231 # lines. To stop this behaviour, add dhclient_edit_config="no" to
232 # /etc/conf.d/net
233 # - dhcpcd does not daemonize when the lease time is infinite
234 # - udhcp-0.9.3-r3 and earlier does not support getting NTP servers
235 # - dhclient does not support getting NTP servers
236 # - pump does not support getting NIS servers
237 # - DHCP tends to erase any existing device information - so add
238 # static addresses after dhcp if you need them
239
240 # Regardless of which DHCP client you prefer, you configure them the
241 # same way using one of following depending on which interface modules
242 # you're using.
243 #config_eth0=( "dhcp" )
244
245 # For passing custom options to dhcpcd use something like the following. This
246 # example reduces the timeout for retrieving an address from 60 seconds (the
247 # default) to 10 seconds.
248 #dhcpcd_eth0="-t 10"
249
250 # dhclient, udhcpc and pump don't have many runtime options
251 # You can pass options to them in a similar manner to dhcpcd though
252 #dhclient_eth0="..."
253 #udhcpc_eth0="..."
254 #pump_eth0="..."
255
256 # To set options for dhclient, you need to have an /etc/dhclient.conf file
257 # See the dhclient man page for details
258
259 # GENERIC DHCP OPTIONS
260 # Set generic DHCP options like so
261 #dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
262
263 # This tells the dhcp client to release it's lease when it stops, not to
264 # overwrite dns, ntp and nis settings, not to set a default route and not to
265 # send the current hostname to the dhcp server and when it starts.
266 # You can use any combination of the above options - the default is not to
267 # use any of them.
268
269 #-----------------------------------------------------------------------------
270 # Automatic Private IP Addressing (APIPA)
271 # For APIPA support, emerge net-misc/iputils or net-analyzer/arping
272
273 # APIPA is a module that tries to find a free address in the range
274 # 169.254.0.0-169.254.255.255 by arping a random address in that range on the
275 # interface. If no reply is found then we assign that address to the interface
276
277 # This is only useful for LANs where there is no DHCP server and you don't
278 # connect directly to the internet.
279 #config_eth0=( "dhcp" )
280 #fallback_eth0=( "apipa" )
281
282 #-----------------------------------------------------------------------------
283 # VLAN (802.1q support)
284 # For VLAN support, emerge net-misc/vconfig
285
286 # Specify the VLAN numbers for the interface like so
287 # Please ensure your VLAN IDs are NOT zero-padded
288 #vlans_eth0="1 2"
289
290 # You can also configure the VLAN - see for vconfig man page for more details
291 #vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" )
292 #vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" )
293 #config_vlan1=( "172.16.3.1 netmask 255.255.254.0" )
294 #config_vlan2=( "172.16.2.1 netmask 255.255.254.0" )
295
296 # NOTE: Vlans can be configured with a . in their interface names
297 # When configuring vlans with this name type, you need to replace . with a _
298 #config_eth0.1=( "dhcp" ) - does not work
299 #config_eth0_1=( "dhcp" ) - does work
300
301 #-----------------------------------------------------------------------------
302 # Bonding
303 # For link bonding/trunking emerge net-misc/ifenslave
304
305 # To bond interfaces together
306 #slaves_bond0="eth0 eth1 eth2"
307 #config_bond0=( "null" ) # You may not want to assign an IP the the bond
308
309 # If any of the slaves require extra configuration - for example wireless or
310 # ppp devices - we need to write a depend function for the bond so they get
311 # configured correctly.
312 # This is exactly the same as a depend() function in our init scripts
313 #depend_br0() {
314 # need net.eth0 net.eth1
315 #}
316
317 #-----------------------------------------------------------------------------
318 # ADSL
319 # For ADSL support, emerge net-dialup/rp-pppoe
320 # You should make the following settings and also put your
321 # username/password information in /etc/ppp/pap-secrets
322
323 # Configure the interface to use ADSL
324 #config_eth0=( "adsl" )
325
326 # You probably won't need to edit /etc/ppp/pppoe.conf if you set this
327 #adsl_user_eth0="my-adsl-username"
328
329 #-----------------------------------------------------------------------------
330 # ISDN
331 # For ISDN support, emerge net-dialup/isdn4k-utils
332 # You should make the following settings and also put your
333 # username/password information in /etc/ppp/pap-secrets
334
335 # Configure the interface to use ISDN
336 #config_ippp0=( "dhcp" )
337 # It's important to specify dhcp if you need it!
338 #config_ippp0=( "192.168.0.1/24" )
339 # Otherwise, you can use a static IP
340
341 # NOTE: The interface name must be either ippp or isdn followed by a number
342
343 # You may need this option to set the default route
344 #ipppd_eth0="defaultroute"
345
346 #-----------------------------------------------------------------------------
347 # MAC changer
348 # To set a specific MAC address
349 #mac_eth0="00:11:22:33:44:55"
350
351 # For changing MAC addresses using the below, emerge net-analyzer/macchanger
352 # - to randomize the last 3 bytes only
353 #mac_eth0="random-ending"
354 # - to randomize between the same physical type of connection (eg fibre,
355 # copper, wireless) , all vendors
356 #mac_eth0="random-samekind"
357 # - to randomize between any physical type of connection (eg fibre, copper,
358 # wireless) , all vendors
359 #mac_eth0="random-anykind"
360 # - full randomization - WARNING: some MAC addresses generated by this may NOT
361 # act as expected
362 #mac_eth0="random-full"
363 # custom - passes all parameters directly to net-analyzer/macchanger
364 #mac_eth0="some custom set of parameters"
365
366 # You can also set other options based on the MAC address of your network card
367 # Handy if you use different docking stations with laptops
368 #config_001122334455=( "dhcp" )
369
370 #-----------------------------------------------------------------------------
371 # TUN/TAP
372 # For TUN/TAP support emerge sys-apps/usermode-utilities
373 #
374 # NOTE: The interface name must be either tun or tap followed by a number
375 #config_tun1=( "192.168.0.1/24")
376
377 # For passing custom options to tunctl use something like the following. This
378 # example sets the owner to adm
379 #tunctl_tun1="-u adm"
380
381 #-----------------------------------------------------------------------------
382 # Bridging (802.1d)
383 # For bridging support emerge net-misc/bridge-utils
384
385 # To add ports to bridge br0
386 #bridge_br0="eth0 eth1"
387 # or dynamically add them when the interface comes up
388 #bridge_add_eth0="br0"
389 #bridge_add_eth1="br0"
390
391 # You need to configure the ports to null values so dhcp does not get started
392 #config_eth0=( "null" )
393 #config_eth1=( "null" )
394
395 # Finally give the bridge an address - dhcp or a static IP
396 #config_br0=( "dhcp" ) # may not work when adding ports dynamically
397 #config_br0=( "192.168.0.1/24" )
398
399 # If any of the ports require extra configuration - for example wireless or
400 # ppp devices - we need to write a depend function for the bridge so they get
401 # configured correctly.
402 # This is exactly the same as a depend() function in our init scripts
403 #depend_br0() {
404 # need net.eth0 net.eth1
405 #}
406
407 # NOTE: This creates an interface called br0 - you can give the interface
408 # any name you like
409
410 # Below is an example of configuring the bridge
411 # Consult "man brctl" for more details
412 #brctl_br0=( "setfd 0" "sethello 0" "stp off" )
413
414 #-----------------------------------------------------------------------------
415 # Tunnelling
416 # For GRE tunnels
417 #iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"
418
419 # For IPIP tunnels
420 #iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255"
421
422 # To configure the interface
423 #config_vpn0=( "192.168.0.2 pointopoint 192.168.1.2" ) # ifconfig style
424 #config_vpn0=( "192.168.0.2 peer 192.168.1.1" ) # iproute2 style
425
426 #-----------------------------------------------------------------------------
427 # System
428 # For configuring system specifics such as domain, dns, ntp and nis servers
429 # It's rare that you would need todo this, but you can anyway.
430 # This is most benefit to wireless users who don't use DHCP so they can change
431 # their configs based on ESSID. See wireless.example for more details
432
433 # To use dns settings such as these, dns_servers_eth0 must be set!
434 # dns_domain_eth0="your.domain"
435 # dns_servers_eth0="192.168.0.2 192.168.0.3"
436 # dns_search_path_eth0="this.domain that.domain"
437
438 # ntp_servers_eth0="192.168.0.2 192.168.0.3"
439
440 # nis_domain_eth0="domain"
441 # nis_servers_eth0="192.168.0.2 192.168.0.3"
442
443 ##############################################################################
444 # ADVANCED CONFIGURATION
445 #
446 # Four functions can be defined which will be called surrounding the
447 # start/stop operations. The functions are called with the interface
448 # name first so that one function can control multiple adapters.
449 #
450 # The return values for the preup and predown functions should be 0
451 # (success) to indicate that configuration or deconfiguration of the
452 # interface can continue. If preup returns a non-zero value, then
453 # interface configuration will be aborted. If predown returns a
454 # non-zero value, then the interface will not be allowed to continue
455 # deconfiguration.
456 #
457 # The return values for the postup and postdown functions are ignored
458 # since there's nothing to do if they indicate failure.
459 #
460 # ${IFACE} is set to the interface being brought up/down
461 # ${IFVAR} is ${IFACE} converted to variable name bash allows
462
463 #preup() {
464 # # Test for link on the interface prior to bringing it up. This
465 # # only works on some network adapters and requires the mii-diag
466 # # package to be installed.
467 # if mii-tool ${IFACE} 2> /dev/null | grep -q 'no link'; then
468 # ewarn "No link on ${IFACE}, aborting configuration"
469 # return 1
470 # fi
471 #
472 # # Test for link on the interface prior to bringing it up. This
473 # # only works on some network adapters and requires the ethtool
474 # # package to be installed.
475 # if ethtool ${IFACE} | grep -q 'Link detected: no'; then
476 # ewarn "No link on ${IFACE}, aborting configuration"
477 # return 1
478 # fi
479 #
480 # # Remember to return 0 on success
481 # return 0
482 #}
483
484 #predown() {
485 # # The default in the script is to test for NFS root and disallow
486 # # downing interfaces in that case. Note that if you specify a
487 # # predown() function you will override that logic. Here it is, in
488 # # case you still want it...
489 # if is_net_fs /; then
490 # eerror "root filesystem is network mounted -- can't stop ${IFACE}"
491 # return 1
492 # fi
493 #
494 # # Remember to return 0 on success
495 # return 0
496 #}
497
498 #postup() {
499 # # This function could be used, for example, to register with a
500 # # dynamic DNS service. Another possibility would be to
501 # # send/receive mail once the interface is brought up.
502 # return 0
503 #}
504
505 #postdown() {
506 # # This function is mostly here for completeness... I haven't
507 # # thought of anything nifty to do with it yet ;-)
508 # # Return 0 always
509 # return 0
510 #}
511
512 ##############################################################################
513 # FORCING MODULES
514 # The Big Fat Warning :- If you use module forcing do not complain to us or
515 # file bugs about it not working!
516 #
517 # Loading modules is a slow afair - we have to check each one for the following
518 # 1) Code sanity
519 # 2) Has the required package been emerged?
520 # 3) Has it modified anything?
521 # 4) Have all the dependant modules been loaded?
522
523 # Then we have to strip out the conflicting modules based on user preference
524 # and default configuration and sort them into the correct order.
525 # Finally we check the end result for dependancies.
526
527 # This, of course, takes valuable CPU time so we provide module forcing as a
528 # means to speed things up. We still do *some* checking but not much.
529
530 # It is essential that you force modules in the correct order and supply all
531 # the modules you need. You must always supply an interface module - we
532 # supply ifconfig or iproute2.
533
534 # The Big Fat Warning :- If you use module forcing do not complain to us or
535 # file bugs about it not working!
536
537 # Now that we've warned you twice, here's how to do it
538 #modules_force=( "ifconfig" )
539 #modules_force=( "iproute2" "dhcpcd" )
540
541 # We can also apply this to a specific interface
542 #modules_force_eth1=( "iproute2" )
543
544 # The below will not work
545 #modules_force=( "dhcpcd" )
546 # No interface (ifconfig/iproute2)
547 #modules_force=( "ifconfig" "essidnet" "iwconfig" )
548 # Although it will not crash, essidnet will not work as it has to come after
549 # iwconfig
550 #modules_force=( "iproute2" "ifconfig" )
551 # The interface will be setup twice which will cause problems

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20