/[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 1274 - (show annotations) (download)
Mon Jul 4 13:23:16 2005 UTC (13 years, 10 months ago) by uberlord
File size: 20934 byte(s)
dded a rename module to rename interfaces based on MAC address
    (preferred) or current name. Fixes #76328

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