/[baselayout]/branches/rc-scripts-1_6/net-scripts/conf.d/net.example
Gentoo

Contents of /branches/rc-scripts-1_6/net-scripts/conf.d/net.example

Parent Directory Parent Directory | Revision Log Revision Log


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