| 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 |
# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6 |
| 10 |
# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have |
| 11 |
# the relevant kernel option enabled. So if you don't have an IPv6 enabled |
| 12 |
# kernel then remove the IPv6 address from your config. |
| 13 |
|
| 14 |
# If you want to use a static address or use DHCP explicitly, jump |
| 15 |
# down to the section labelled INTERFACE HANDLERS. |
| 16 |
# |
| 17 |
# If you want to do anything more fancy, you should take the time to |
| 18 |
# read through the rest of this file. |
| 19 |
|
| 20 |
|
| 21 |
############################################################################## |
| 22 |
# VARIABLES |
| 23 |
# |
| 24 |
# We've changed from using arrays to evaluated strings. |
| 25 |
# This has the benefit of being slightly more readable but more importantly it |
| 26 |
# works across all shells. |
| 27 |
# OLD |
| 28 |
# config_eth0=( "192.168.0.24 netmask 255.255.255.0" "192.168.0.25/24" ) |
| 29 |
# NEW |
| 30 |
# config_eth0="'192.168.0.24 netmask 255.255.255.0' 192.168.0.25/24" |
| 31 |
# INVALID |
| 32 |
# config_eth0='192.168.0.24 netmask 255.255.255.0' |
| 33 |
# |
| 34 |
# As the 1st value has spaces in it, it needs additional quoting. The 2nd |
| 35 |
# value has no spaces, therefore no additional quoting is required. |
| 36 |
# The last statement is invalid because when it is evaluated, it only has one |
| 37 |
# set of quotes. |
| 38 |
|
| 39 |
############################################################################## |
| 40 |
# MODULES |
| 41 |
# |
| 42 |
# We now support modular networking scripts which means we can easily |
| 43 |
# add support for new interface types and modules while keeping |
| 44 |
# compatability with existing ones. |
| 45 |
# |
| 46 |
# Modules load by default if the package they need is installed. If |
| 47 |
# you specify a module here that doesn't have it's package installed |
| 48 |
# then you get an error stating which package you need to install. |
| 49 |
# Ideally, you only use the modules setting when you have two or more |
| 50 |
# packages installed that supply the same service. |
| 51 |
# |
| 52 |
# In other words, you probably should DO NOTHING HERE... |
| 53 |
|
| 54 |
# Prefer ifconfig over iproute2 |
| 55 |
#modules="ifconfig" |
| 56 |
|
| 57 |
# You can also specify other modules for an interface |
| 58 |
# In this case we prefer udhcpc over dhcpcd |
| 59 |
#modules_eth0="udhcpc" |
| 60 |
|
| 61 |
# You can also specify which modules not to use - for example you may be |
| 62 |
# using a supplicant or linux-wlan-ng to control wireless configuration but |
| 63 |
# you still want to configure network settings per SSID associated with. |
| 64 |
#modules="!iwconfig !wpa_supplicant" |
| 65 |
# IMPORTANT: If you need the above, please disable modules in that order |
| 66 |
|
| 67 |
|
| 68 |
############################################################################## |
| 69 |
# INTERFACE HANDLERS |
| 70 |
# |
| 71 |
# We provide two interface handlers presently: ifconfig and iproute2. |
| 72 |
# You need one of these to do any kind of network configuration. |
| 73 |
# For ifconfig support, emerge sys-apps/net-tools |
| 74 |
# For iproute2 support, emerge sys-apps/iproute2 |
| 75 |
|
| 76 |
# If you don't specify an interface then we prefer iproute2 if it's installed |
| 77 |
# To prefer ifconfig over iproute2 |
| 78 |
#modules="ifconfig" |
| 79 |
|
| 80 |
# For a static configuration, use something like this |
| 81 |
# (They all do exactly the same thing btw) |
| 82 |
#config_eth0="192.168.0.2/24" |
| 83 |
#config_eth0="'192.168.0.2 netmask 255.255.255.0'" |
| 84 |
|
| 85 |
# We can also specify a broadcast |
| 86 |
#config_eth0="'192.168.0.2/24 brd 192.168.0.255'" |
| 87 |
#config_eth0="'192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255'" |
| 88 |
|
| 89 |
# If you need more than one address, you can use something like this |
| 90 |
# NOTE: ifconfig creates an aliased device for each extra IPv4 address |
| 91 |
# (eth0:1, eth0:2, etc) |
| 92 |
# iproute2 does not do this as there is no need to |
| 93 |
#config_eth0="'192.168.0.2/24' '192.168.0.3/24' '192.168.0.4/24'" |
| 94 |
# Or you can use sequence expressions |
| 95 |
#config_eth0="192.168.0.{2..4}/24" # FIXME - does it work? |
| 96 |
# which does the same as above. Be careful though as if you use this and |
| 97 |
# fallbacks, you have to ensure that both end up with the same number of |
| 98 |
# values otherwise your fallback won't work correctly. |
| 99 |
|
| 100 |
# You can also use IPv6 addresses |
| 101 |
# (you should always specify a prefix length with IPv6 here) |
| 102 |
#config_eth0="192.168.0.2/24 \ |
| 103 |
#4321:0:1:2:3:4:567:89ab/64 \ |
| 104 |
#4321:0:1:2:3:4:567:89ac/64" |
| 105 |
#) |
| 106 |
|
| 107 |
# If you wish to keep existing addresses + routing and the interface is up, |
| 108 |
# you can specify a noop (no operation). If the interface is down or there |
| 109 |
# are no addresses assigned, then we move onto the next step (default dhcp) |
| 110 |
# This is useful when configuring your interface with a kernel command line |
| 111 |
# or similar |
| 112 |
#config_eth0="noop 192.168.0.2/24" |
| 113 |
|
| 114 |
# If you don't want ANY address (only useful when calling for advanced stuff) |
| 115 |
#config_eth0="null" |
| 116 |
|
| 117 |
# Here's how to do routing if you need it |
| 118 |
# We add an IPv4 default route, IPv4 subnet route and an IPv6 unicast route |
| 119 |
#routes_eth0=" \ |
| 120 |
# 'default via 192.168.0.1' \ |
| 121 |
# '10.0.0.0/8 via 192.168.0.1' \ |
| 122 |
# '::/0' \ |
| 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 |
# Each module described below can set a default base metric, lower is |
| 137 |
# preferred over higher. This is so we can prefer a wired route over a |
| 138 |
# wireless route automaticaly. You can override this by setting |
| 139 |
#metric_eth0="100" |
| 140 |
# or on a global basis |
| 141 |
#metric="100" |
| 142 |
# The only downside of the global setting is that you have to ensure that |
| 143 |
# there are no conflicting routes yourself. For users with large routing |
| 144 |
# tables you may have to set a global metric as the due to a simple read of |
| 145 |
# the routing table taking over a minute at a time. |
| 146 |
|
| 147 |
############################################################################## |
| 148 |
# OPTIONAL MODULES |
| 149 |
|
| 150 |
#----------------------------------------------------------------------------- |
| 151 |
# WIRELESS (802.11 support) |
| 152 |
# Wireless can be provided by iwconfig or wpa_supplicant |
| 153 |
# wpa_supplicant is preferred, use the modules directive to prefer iwconfig. |
| 154 |
#modules="iwconfig" |
| 155 |
# |
| 156 |
# iwconfig |
| 157 |
# emerge net-wireless/wireless-tools |
| 158 |
############################################### |
| 159 |
# HINTS |
| 160 |
# |
| 161 |
# Most users will just need to set the following options |
| 162 |
# key_SSID1="s:yourkeyhere enc open" # s: means a text key |
| 163 |
# key_SSID2="aaaa-bbbb-cccc-dd" # no s: means a hex key |
| 164 |
# preferred_aps="'SSID 1' 'SSID 2'" |
| 165 |
# |
| 166 |
# Clear? Good. Now configure your wireless network below |
| 167 |
|
| 168 |
############################################### |
| 169 |
# SETTINGS |
| 170 |
# Hard code an SSID to an interface - leave this unset if you wish the driver |
| 171 |
# to scan for available Access Points |
| 172 |
# Set to "any" to connect to any SSID - the driver picks an Access Point |
| 173 |
# This needs to be done when the driver doesn't support scanning |
| 174 |
# This may work for drivers that don't support scanning but you need automatic |
| 175 |
# AP association |
| 176 |
# I would only set this as a last resort really - use the preferred_aps |
| 177 |
# setting at the bottom of this file |
| 178 |
|
| 179 |
# However, using ad-hoc (without scanning for APs) and master mode |
| 180 |
# do require the SSID to be set - do this here |
| 181 |
#essid_eth0="any" |
| 182 |
|
| 183 |
# Set the mode of the interface (managed, ad-hoc, master or auto) |
| 184 |
# The default is auto |
| 185 |
# If it's ad-hoc or master you also may need to specify the channel below |
| 186 |
#mode_eth0="auto" |
| 187 |
|
| 188 |
# If managed mode fails, drop to ad-hoc mode with the below SSID? |
| 189 |
#adhoc_essid_eth0="WLAN" |
| 190 |
|
| 191 |
# Some drivers/hardware don't scan all that well. We have no control over this |
| 192 |
# but we can say how many scans we want to do to try and get a better sweep of |
| 193 |
# the area. The default is 1. |
| 194 |
#scans_eth0="1" |
| 195 |
|
| 196 |
#Channel can be set (1-14), but defaults to 3 if not set. |
| 197 |
# |
| 198 |
# The below is taken verbatim from the BSD wavelan documentation found at |
| 199 |
# http://www.netbsd.org/Documentation/network/wavelan.html |
| 200 |
# There are 14 channels possible; We are told that channels 1-11 are legal for |
| 201 |
# North America, channels 1-13 for most of Europe, channels 10-13 for France, |
| 202 |
# and only channel 14 for Japan. If in doubt, please refer to the documentation |
| 203 |
# that came with your card or access point. Make sure that the channel you |
| 204 |
# select is the same channel your access point (or the other card in an ad-hoc |
| 205 |
# network) is on. The default for cards sold in North America and most of Europe |
| 206 |
# is 3; the default for cards sold in France is 11, and the default for cards |
| 207 |
# sold in Japan is 14. |
| 208 |
#channel_eth0="3" |
| 209 |
|
| 210 |
# Setup any other config commands. This is basically the iwconfig argument |
| 211 |
# without the iwconfig $iface. |
| 212 |
#iwconfig_eth0="" |
| 213 |
|
| 214 |
# Set private driver ioctls. This is basically the iwpriv argument without |
| 215 |
# the iwpriv $iface. If you use the rt2500 driver (not the rt2x00 one) then |
| 216 |
# you can set WPA here, below is an example. |
| 217 |
#iwpriv_eth0="" |
| 218 |
#iwpriv_SSID=" \ |
| 219 |
# 'set AuthMode=WPAPSK' \ |
| 220 |
# 'set EncrypType=TKIP' \ |
| 221 |
# 'set WPAPSK=yourpasskey' \ |
| 222 |
#" |
| 223 |
#NOTE: Even though you can use WPA like so, you may have to set a WEP key |
| 224 |
#if your driver claims the AP is encrypted. The WEP key itself will not be |
| 225 |
#used though. |
| 226 |
|
| 227 |
# Seconds to wait before scanning |
| 228 |
# Some drivers need to wait until they have finished "loading" |
| 229 |
# before they can scan - otherwise they error and claim that they cannot scan |
| 230 |
# or resource is unavailable. The default is to wait zero seconds |
| 231 |
#sleep_scan_eth0="1" |
| 232 |
|
| 233 |
# Seconds to wait until associated. The default is to wait 10 seconds. |
| 234 |
# 0 means wait indefinitely. WARNING: this can cause an infinite delay when |
| 235 |
# booting. |
| 236 |
#associate_timeout_eth0="5" |
| 237 |
|
| 238 |
# By default a successful association in Managed mode sets the MAC |
| 239 |
# address of the AP connected to. However, some drivers (namely |
| 240 |
# the ipw2100) don't set an invalid MAC address when association |
| 241 |
# fails - so we need to check on link quality which some drivers |
| 242 |
# don't report properly either. |
| 243 |
# So if you have connection problems try flipping this setting |
| 244 |
# Valid options are MAC, quality and all - defaults to MAC |
| 245 |
#associate_test_eth0="MAC" |
| 246 |
|
| 247 |
# Some driver/card combinations need to scan in Ad-Hoc mode |
| 248 |
# After scanning, the mode is reset to the one defined above |
| 249 |
#scan_mode_eth0="Ad-Hoc" |
| 250 |
|
| 251 |
# Below you can define private ioctls to run before and after scanning |
| 252 |
# Format is the same as the iwpriv_eth0 above |
| 253 |
# This is needed for the HostAP drivers |
| 254 |
#iwpriv_scan_pre_eth0="'host_roaming 2'" |
| 255 |
#iwpriv_scan_post_eth0="'host_roaming 0'" |
| 256 |
|
| 257 |
# Define a WEP key per SSID or MAC address (of the AP, not your card) |
| 258 |
# The encryption type (open or restricted) must match the |
| 259 |
# encryption type on the Access Point |
| 260 |
# You can't use "any" for an SSID here |
| 261 |
#key_SSID="1234-1234-1234-1234-1234-1234-56" |
| 262 |
# or you can use strings. Passphrase IS NOT supported |
| 263 |
# To use a string, prefix it with s: |
| 264 |
# Note - this example also sets the encryption method to open |
| 265 |
# which is regarded as more secure than restricted |
| 266 |
#key_SSID="s:foobar enc open" |
| 267 |
#key_SSID="s:foobar enc restricted" |
| 268 |
|
| 269 |
# If you have whitespace in your key, here's how to set it and use other |
| 270 |
# commands like using open encryption. |
| 271 |
#key_SSID="s:'foo bar' enc open" |
| 272 |
|
| 273 |
# WEP key for the AP with MAC address 001122334455 |
| 274 |
#mac_key_001122334455="s:foobar" |
| 275 |
|
| 276 |
# Here are some more examples of keys as some users find others work |
| 277 |
# and some don't where they should all do the same thing |
| 278 |
#key_SSID="open s:foobar" |
| 279 |
#key_SSID="open 1234-5678-9012" |
| 280 |
#key_SSID="s:foobar enc open" |
| 281 |
#key_SSID="1234-5678-9012 enc open" |
| 282 |
|
| 283 |
# You may want to set muliple keys - here's an example |
| 284 |
# It sets 4 keys on the card and instructs to use key 2 by default |
| 285 |
#key_SSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]" |
| 286 |
|
| 287 |
# You can also override the interface settings found in /etc/conf.d/net |
| 288 |
# per SSID - which is very handy if you use different networks a lot |
| 289 |
#config_SSID="dhcp" |
| 290 |
#dhcpcd_SSID="-t 5" |
| 291 |
#routes_SSID= |
| 292 |
#fallback_SSID= |
| 293 |
|
| 294 |
# Setting name/domain server causes /etc/resolv.conf to be overwritten |
| 295 |
# Note that if DHCP is used, and you want this to take precedence then |
| 296 |
# please put -R in your dhcpcd options |
| 297 |
#dns_servers_SSID="192.168.0.1 192.168.0.2" |
| 298 |
#dns_domain_SSID="some.domain" |
| 299 |
#dns_search_path_SSID="search.this.domain search.that.domain" |
| 300 |
# Please check the man page for resolv.conf for more information |
| 301 |
# as domain and search (searchdomains) are mutually exclusive and |
| 302 |
# searchdomains takes precedence |
| 303 |
|
| 304 |
# You can also set any of the /etc/conf.d/net variables per MAC address |
| 305 |
# incase you use Access Points with the same SSID but need different |
| 306 |
# networking configs. Below is an example - of course you use the same |
| 307 |
# method with other variables |
| 308 |
#config_001122334455="dhcp" |
| 309 |
#dhcpcd_001122334455="-t 10" |
| 310 |
#dns_servers_001122334455="192.168.0.1 192.168.0.2" |
| 311 |
|
| 312 |
# Map a MAC address to an SSID |
| 313 |
# This is used when the Access Point is not broadcasting it's SSID |
| 314 |
# WARNING: This will override the SSID being broadcast due to some |
| 315 |
# Access Points sending an SSID even when they have been configured |
| 316 |
# not to! |
| 317 |
# Change 001122334455 to the MAC address and SSID to the SSID |
| 318 |
# it should map to |
| 319 |
#mac_essid_001122334455="SSID" |
| 320 |
|
| 321 |
# This lists the preferred SSIDs to connect to in order |
| 322 |
# SSID's can contain any characters here as they must match the broadcast |
| 323 |
# SSID exactly. |
| 324 |
# Surround each SSID with the " character and seperate them with a space |
| 325 |
# If the first SSID isn't found then it moves onto the next |
| 326 |
# If this isn't defined then it connects to the first one found |
| 327 |
#preferred_aps="'SSID 1' 'SSID 2'" |
| 328 |
|
| 329 |
# You can also define a preferred_aps list per interface |
| 330 |
#preferred_aps_eth0="'SSID 3' 'SSID 4'" |
| 331 |
|
| 332 |
# You can also say whether we only connect to preferred APs or not |
| 333 |
# Values are "any", "preferredonly", "forcepreferred", "forcepreferredonly" and "forceany" |
| 334 |
# "any" means it will connect to visible APs in the preferred list and then any |
| 335 |
# other available AP |
| 336 |
# "preferredonly" means it will only connect to visible APs in the preferred list |
| 337 |
# "forcepreferred" means it will forceably connect to APs in order if it does not find |
| 338 |
# them in a scan |
| 339 |
# "forcepreferredonly" means it forceably connects to the APs in order and does not bother |
| 340 |
# to scan |
| 341 |
# "forceany" does the same as forcepreferred + connects to any other available AP |
| 342 |
# Default is "any" |
| 343 |
#associate_order="any" |
| 344 |
#associate_order_eth0="any" |
| 345 |
|
| 346 |
# You can define blacklisted Access Points in the same way |
| 347 |
#blacklist_aps="'SSID 1' 'SSID 2'" |
| 348 |
#blacklist_aps_eth0="'SSID 3' 'SSID 4'" |
| 349 |
|
| 350 |
# If you have more than one wireless card, you can say if you want |
| 351 |
# to allow each card to associate with the same Access Point or not |
| 352 |
# Values are "yes" and "no" |
| 353 |
# Default is "yes" |
| 354 |
#unique_ap="yes" |
| 355 |
#unique_ap_eth0="yes" |
| 356 |
|
| 357 |
# IMPORTANT: preferred_only, blacklisted_aps and unique_ap only work when |
| 358 |
# essid_eth0 is not set and your card is capable of scanning |
| 359 |
|
| 360 |
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have |
| 361 |
# the same SSID in both, well, you're a bit silly :p |
| 362 |
|
| 363 |
|
| 364 |
############################################################ |
| 365 |
# wpa_supplicant |
| 366 |
# emerge net-wireless/wpa-supplicant |
| 367 |
# Wireless options are held in /etc/wpa_supplicant/wpa_supplicant.conf |
| 368 |
# Console the wpa_supplicant.conf.example that is installed in |
| 369 |
# /usr/share/doc/wpa_supplicant |
| 370 |
# To configure wpa_supplicant |
| 371 |
#wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards |
| 372 |
# Consult wpa_supplicant for more drivers - the default is -Dwext which should |
| 373 |
# work for most cards. |
| 374 |
|
| 375 |
# By default we don't wait for wpa_suppliant to associate and authenticate. |
| 376 |
# If you need to change this behaviour then you don't know how our scripts work |
| 377 |
# and setting this value could cause strange things to happen. |
| 378 |
# If you would like to, so can specify how long in seconds. |
| 379 |
#associate_timeout_eth0=60 |
| 380 |
# A value of 0 means wait forever. |
| 381 |
|
| 382 |
# You can also override any settings found here per SSID - which is very |
| 383 |
# handy if you use different networks a lot. See below for using the SSID |
| 384 |
# in our variables |
| 385 |
#config_SSID="dhcp" |
| 386 |
# See the System module below for setting dns/nis/ntp per SSID |
| 387 |
|
| 388 |
# You can also override any settings found here per MAC address of the AP |
| 389 |
# in case you use Access Points with the same SSID but need different |
| 390 |
# networking configs. Below is an example - of course you use the same |
| 391 |
# method with other variables |
| 392 |
#mac_config_001122334455="dhcp" |
| 393 |
#mac_dns_servers_001122334455="192.168.0.1 192.168.0.2" |
| 394 |
|
| 395 |
# When an interface has been associated with an Access Point, a global |
| 396 |
# variable called SSID is set to the Access Point's SSID for use in the |
| 397 |
# pre/post user functions below (although it's not available in preup as you |
| 398 |
# won't have associated then) |
| 399 |
|
| 400 |
# If you're using anything else to configure wireless on your interface AND |
| 401 |
# you have installed wpa_supplicant, you need to disable wpa_supplicant |
| 402 |
#modules="!iwconfig !wpa_supplicant" |
| 403 |
#or |
| 404 |
#modules="!wireless" |
| 405 |
|
| 406 |
############################################################################## |
| 407 |
# WIRELESS SSID IN VARIABLES |
| 408 |
############################################################################## |
| 409 |
# Remember to change SSID to your SSID. |
| 410 |
# Say that your SSID is My NET - the line |
| 411 |
# #key_SSID="s:passkey" |
| 412 |
# becomes |
| 413 |
# #key_My_NET="s:passkey" |
| 414 |
# Notice that the space has changed to an underscore - do the same with all |
| 415 |
# characters not in a-z A-Z (English alphabet) 0-9. This only applies to |
| 416 |
# variables and not values. |
| 417 |
# |
| 418 |
# Any SSID's in values like essid_eth0="My NET" may need to be escaped |
| 419 |
# This means placing the character \ before the character |
| 420 |
# \" need to be escaped for example |
| 421 |
# So if your SSID is |
| 422 |
# My "\ NET |
| 423 |
# it becomes |
| 424 |
# My \"\\ NET |
| 425 |
# for example |
| 426 |
# #essid_eth0="My\"\\NET" |
| 427 |
# |
| 428 |
# So using the above we can use |
| 429 |
# #dns_domain_My____NET="My\"\\NET" |
| 430 |
# which is an invalid dns domain, but shows the how to use the variable |
| 431 |
# structure |
| 432 |
######################################################### |
| 433 |
|
| 434 |
|
| 435 |
#----------------------------------------------------------------------------- |
| 436 |
# DHCP |
| 437 |
# DHCP can be provided by dhclient, dhcpcd, pump or udhcpc. |
| 438 |
# |
| 439 |
# dhclient: emerge net-misc/dhcp |
| 440 |
# dhcpcd: emerge net-misc/dhcpcd |
| 441 |
# pump: emerge net-misc/pump |
| 442 |
# udhcpc: emerge net-misc/udhcp |
| 443 |
|
| 444 |
# If you have more than one DHCP client installed, you need to specify which |
| 445 |
# one to use - otherwise we default to dhcpcd if available. |
| 446 |
#modules=( "dhclient" ) # to select dhclient over dhcpcd |
| 447 |
# |
| 448 |
# Notes: |
| 449 |
# - All clients send the current hostname to the DHCP server by default |
| 450 |
# - dhcpcd does not daemonize when the lease time is infinite |
| 451 |
# - udhcp-0.9.3-r3 and earlier do not support getting NTP servers |
| 452 |
# - pump does not support getting NIS servers |
| 453 |
# - DHCP tends to erase any existing device information - so add |
| 454 |
# static addresses after dhcp if you need them |
| 455 |
# - dhclient and udhcpc can set other resolv.conf options such as "option" |
| 456 |
# and "sortlist"- see the System module for more details |
| 457 |
|
| 458 |
# Regardless of which DHCP client you prefer, you configure them the |
| 459 |
# same way using one of following depending on which interface modules |
| 460 |
# you're using. |
| 461 |
#config_eth0="dhcp" |
| 462 |
|
| 463 |
# For passing custom options to dhcpcd use something like the following. This |
| 464 |
# example reduces the timeout for retrieving an address from 60 seconds (the |
| 465 |
# default) to 10 seconds. |
| 466 |
#dhcpcd_eth0="-t 10" |
| 467 |
|
| 468 |
# dhclient, udhcpc and pump don't have many runtime options |
| 469 |
# You can pass options to them in a similar manner to dhcpcd though |
| 470 |
#dhclient_eth0="..." |
| 471 |
#udhcpc_eth0="..." |
| 472 |
#pump_eth0="..." |
| 473 |
|
| 474 |
# GENERIC DHCP OPTIONS |
| 475 |
# Set generic DHCP options like so |
| 476 |
#dhcp_eth0="release nodns nontp nonis nogateway nosendhost" |
| 477 |
|
| 478 |
# This tells the dhcp client to release it's lease when it stops, not to |
| 479 |
# overwrite dns, ntp and nis settings, not to set a default route and not to |
| 480 |
# send the current hostname to the dhcp server and when it starts. |
| 481 |
# You can use any combination of the above options - the default is not to |
| 482 |
# use any of them. |
| 483 |
|
| 484 |
#----------------------------------------------------------------------------- |
| 485 |
# For APIPA support, emerge net-misc/iputils or net-analyzer/arping |
| 486 |
|
| 487 |
# APIPA is a module that tries to find a free address in the range |
| 488 |
# 169.254.0.0-169.254.255.255 by arping a random address in that range on the |
| 489 |
# interface. If no reply is found then we assign that address to the interface |
| 490 |
|
| 491 |
# This is only useful for LANs where there is no DHCP server and you don't |
| 492 |
# connect directly to the internet. |
| 493 |
#config_eth0="dhcp" |
| 494 |
#fallback_eth0="apipa" |
| 495 |
|
| 496 |
#----------------------------------------------------------------------------- |
| 497 |
# ARPING Gateway configuration |
| 498 |
# and |
| 499 |
# Automatic Private IP Addressing (APIPA) |
| 500 |
# For arpingnet / apipa support, emerge net-misc/iputils or net-analyzer/arping |
| 501 |
# |
| 502 |
# This is a module that tries to find a gateway IP. If it exists then we use |
| 503 |
# that gateways configuration for our own. For the configuration variables |
| 504 |
# simply ensure that each octet is zero padded and the dots are removed. |
| 505 |
# Below is an example. |
| 506 |
# |
| 507 |
#gateways_eth0="192.168.0.1 10.0.0.1" |
| 508 |
#config_192168000001="192.168.0.2/24" |
| 509 |
#routes_192168000001="'default via 192.168.0.1'" |
| 510 |
#dns_servers_192168000001="192.168.0.1" |
| 511 |
#config_010000000001="10.0.0.254/8" |
| 512 |
#routes_010000000001="default via 10.0.0.1" |
| 513 |
#dns_servers_010000000001="10.0.0.1" |
| 514 |
|
| 515 |
# We can also specify a specific MAC address for each gateway if different |
| 516 |
# networks have the same gateway. |
| 517 |
#gateways_eth0="192.168.0.1,00:11:22:AA:BB:CC 10.0.0.1,33:44:55:DD:EE:FF" |
| 518 |
#config_192168000001_001122AABBCC="192.168.0.2/24" |
| 519 |
#routes_192168000001_001122AABBCC="default via 192.168.0.1" |
| 520 |
#dns_servers_192168000001_001122AABBCC="192.168.0.1" |
| 521 |
#config_010000000001_334455DDEEFF="10.0.0.254/8" |
| 522 |
#routes_010000000001_334455DDEEFF="default via 10.0.0.1" |
| 523 |
#dns_servers_010000000001_334455DDEEFF="10.0.0.1" |
| 524 |
|
| 525 |
# If we don't find any gateways (or there are none configured) then we try and |
| 526 |
# use APIPA to find a free address in the range 169.254.0.0-169.254.255.255 |
| 527 |
# by arping a random address in that range on the interface. If no reply is |
| 528 |
# found then we assign that address to the interface. |
| 529 |
|
| 530 |
# This is only useful for LANs where there is no DHCP server. |
| 531 |
#config_eth0="arping" |
| 532 |
|
| 533 |
# or if no DHCP server can be found |
| 534 |
#config_eth0="dhcp" |
| 535 |
#fallback_eth0="arping" |
| 536 |
|
| 537 |
# NOTE: We default to sleeping for 1 second the first time we attempt an |
| 538 |
# arping to give the interface time to settle on the LAN. This appears to |
| 539 |
# be a good default for most instances, but if not you can alter it here. |
| 540 |
#arping_sleep=5 |
| 541 |
#arping_sleep_lan=7 |
| 542 |
|
| 543 |
# NOTE: We default to waiting 3 seconds to get an arping response. You can |
| 544 |
# change the default wait like so. |
| 545 |
#arping_wait=3 |
| 546 |
#arping_wait_lan=2 |
| 547 |
|
| 548 |
#----------------------------------------------------------------------------- |
| 549 |
# VLAN (802.1q support) |
| 550 |
# For VLAN support, emerge net-misc/vconfig |
| 551 |
|
| 552 |
# Specify the VLAN numbers for the interface like so |
| 553 |
# Please ensure your VLAN IDs are NOT zero-padded |
| 554 |
#vlans_eth0="1 2" |
| 555 |
|
| 556 |
# You may not want to assign an IP the the physical interface, but we still |
| 557 |
# need it up. |
| 558 |
#config_eth0="null" |
| 559 |
|
| 560 |
# You can also configure the VLAN - see for vconfig man page for more details |
| 561 |
#vconfig_eth0="'set_name_type VLAN_PLUS_VID_NO_PAD'" |
| 562 |
#vconfig_vlan1="'set_flag 1' 'set_egress_map 2 6'" |
| 563 |
#config_vlan1="'172.16.3.1 netmask 255.255.254.0'" |
| 564 |
#config_vlan2="'172.16.2.1 netmask 255.255.254.0'" |
| 565 |
|
| 566 |
# NOTE: Vlans can be configured with a . in their interface names |
| 567 |
# When configuring vlans with this name type, you need to replace . with a _ |
| 568 |
#config_eth0.1="dhcp" - does not work |
| 569 |
#config_eth0_1="dhcp" - does work |
| 570 |
|
| 571 |
# NOTE: Vlans are controlled by their physical interface and not per vlan |
| 572 |
# This means you do not need to create init scripts in /etc/init.d for each |
| 573 |
# vlan, you must need to create one for the physical interface. |
| 574 |
# If you wish to control the configuration of each vlan through a separate |
| 575 |
# script, or wish to rename the vlan interface to something that vconfig |
| 576 |
# cannot then you need to do this. |
| 577 |
#vlan_start_eth0="no" |
| 578 |
|
| 579 |
# If you do the above then you may want to depend on eth0 like so |
| 580 |
# RC_NEED_vlan1="net.eth0" |
| 581 |
# NOTE: depend functions only work in /etc/conf.d/net |
| 582 |
# and not in profile configs such as /etc/conf.d/net.foo |
| 583 |
|
| 584 |
#----------------------------------------------------------------------------- |
| 585 |
# Bonding |
| 586 |
# For link bonding/trunking emerge net-misc/ifenslave |
| 587 |
|
| 588 |
# To bond interfaces together |
| 589 |
#slaves_bond0="eth0 eth1 eth2" |
| 590 |
#config_bond0="null" # You may not want to assign an IP the the bond |
| 591 |
|
| 592 |
# If any of the slaves require extra configuration - for example wireless or |
| 593 |
# ppp devices - we need to depend function on the bonded interfaces |
| 594 |
#RC_NEED_bond0="net.eth0 net.eth1" |
| 595 |
|
| 596 |
|
| 597 |
#----------------------------------------------------------------------------- |
| 598 |
# Classical IP over ATM |
| 599 |
# For CLIP support emerge net-dialup/linux-atm |
| 600 |
|
| 601 |
# Ensure that you have /etc/atmsigd.conf setup correctly |
| 602 |
# Now setup each clip interface like so |
| 603 |
#clip_atm0=( "peer_ip [if.]vpi.vci [opts]" ... ) |
| 604 |
# where "peer_ip" is the IP address of a PVC peer (in case of an ATM connection |
| 605 |
# with your ISP, your only peer is usually the ISP gateway closest to you), |
| 606 |
# "if" is the number of the ATM interface which will carry the PVC, "vpi.vci" |
| 607 |
# is the ATM VC address, and "opts" may optionally specify VC parameters like |
| 608 |
# qos, pcr, and the like (see "atmarp -s" for further reference). Please also |
| 609 |
# note quoting: it is meant to distinguish the VCs you want to create. You may, |
| 610 |
# in example, create an atm0 interface to more peers, like this: |
| 611 |
#clip_atm0="'1.1.1.254 0.8.35' 1.1.1.253 1.8.35'" |
| 612 |
|
| 613 |
# By default, the PVC will use the LLC/SNAP encapsulation. If you rather need a |
| 614 |
# null encapsulation (aka "VC mode"), please add the keyword "null" to opts. |
| 615 |
|
| 616 |
|
| 617 |
#----------------------------------------------------------------------------- |
| 618 |
# PPP |
| 619 |
# For PPP support, emerge net-dialup/ppp |
| 620 |
# PPP is used for most dialup connections, including ADSL. |
| 621 |
# The older ADSL module is documented below, but you are encouraged to try |
| 622 |
# this module first. |
| 623 |
# |
| 624 |
# You need to create the PPP net script yourself. Make it like so |
| 625 |
#ln -s net.lo /etc/init.d/net.ppp0 |
| 626 |
# |
| 627 |
# Each PPP interface requires an interface to use as a "Link" |
| 628 |
#link_ppp0="/dev/ttyS0" # Most PPP links will use a serial port |
| 629 |
#link_ppp0="eth0" # PPPoE requires an ethernet interface |
| 630 |
#link_ppp0="[itf.]vpi.vci" # PPPoA requires the ATM VC's address |
| 631 |
#link_ppp0="/dev/null" # ISDN links should have this |
| 632 |
#link_ppp0="pty 'your_link_command'" # PPP links over ssh, rsh, etc |
| 633 |
# |
| 634 |
# Here you should specify what pppd plugins you want to use |
| 635 |
# Available plugins are: pppoe, pppoa, capi, dhcpc, minconn, radius, |
| 636 |
# radattr, radrealms and winbind |
| 637 |
#plugins_ppp0="pppoe" # Required plugin for PPPoE |
| 638 |
#plugins_ppp0="pppoa vc-encaps" # Required plugin for PPPoA with an option |
| 639 |
#plugins_ppp0="capi" # Required plugin for ISDN |
| 640 |
# |
| 641 |
# PPP requires at least a username. You can optionally set a password here too |
| 642 |
# If you don't, then it will use the password specified in /etc/ppp/*-secrets |
| 643 |
# against the specified username |
| 644 |
#username_ppp0='user' |
| 645 |
#password_ppp0='password' |
| 646 |
# NOTE: You can set a blank password like so |
| 647 |
#password_ppp0= |
| 648 |
# |
| 649 |
# The PPP daemon has many options you can specify - although there are many |
| 650 |
# and may seem daunting, it is recommended that you read the pppd man page |
| 651 |
# before enabling any of them |
| 652 |
#pppd_ppp0=" |
| 653 |
# 'maxfail 0' # WARNING: It's not recommended you use this |
| 654 |
# # if you don't specify maxfail then we assume 0 |
| 655 |
# 'updetach' # If not set, "/etc/init.d/net.ppp0 start" will return |
| 656 |
# # immediately, without waiting the link to come up |
| 657 |
# # for the first time. |
| 658 |
# # Do not use it for dial-on-demand links! |
| 659 |
# 'debug' # Enables syslog debugging |
| 660 |
# 'noauth' # Do not require the peer to authenticate itself |
| 661 |
# 'defaultroute' # Make this PPP interface the default route |
| 662 |
# 'usepeerdns' # Use the DNS settings provided by PPP |
| 663 |
# |
| 664 |
# On demand options |
| 665 |
# 'demand' # Enable dial on demand |
| 666 |
# 'idle 30' # Link goes down after 30 seconds of inactivity |
| 667 |
# '10.112.112.112:10.112.112.113' # Phony IP addresses |
| 668 |
# 'ipcp-accept-remote' # Accept the peers idea of remote address |
| 669 |
# 'ipcp-accept-local' # Accept the peers idea of local address |
| 670 |
# 'holdoff 3' # Wait 3 seconds after link dies before re-starting |
| 671 |
# |
| 672 |
# Dead peer detection |
| 673 |
# 'lcp-echo-interval 15' # Send a LCP echo every 15 seconds |
| 674 |
# 'lcp-echo-failure 3' # Make peer dead after 3 consective |
| 675 |
# # echo-requests |
| 676 |
# |
| 677 |
# Compression options - use these to completely disable compression |
| 678 |
# noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp |
| 679 |
# |
| 680 |
# Dial-up settings |
| 681 |
# 'lock' # Lock serial port |
| 682 |
# '115200' # Set the serial port baud rate |
| 683 |
# 'modem crtscts' # Enable hardware flow control |
| 684 |
# '192.168.0.1:192.168.0.2' # Local and remote IP addresses |
| 685 |
#" |
| 686 |
# |
| 687 |
# Dial-up PPP users need to specify at least one telephone number |
| 688 |
#phone_number_ppp0=( "12345689" ) # Maximum 2 phone numbers are supported |
| 689 |
# They will also need a chat script - here's a good one |
| 690 |
#chat_ppp0=" \ |
| 691 |
# 'ABORT' 'BUSY' \ |
| 692 |
# 'ABORT' 'ERROR' \ |
| 693 |
# 'ABORT' 'NO ANSWER' \ |
| 694 |
# 'ABORT' 'NO CARRIER' \ |
| 695 |
# 'ABORT' 'NO DIALTONE' \ |
| 696 |
# 'ABORT' 'Invalid Login' \ |
| 697 |
# 'ABORT' 'Login incorrect' \ |
| 698 |
# 'TIMEOUT' '5' \ |
| 699 |
# '' 'ATZ' \ |
| 700 |
# 'OK' 'AT' # Put your modem initialization string here \ |
| 701 |
# 'OK' 'ATDT\T' \ |
| 702 |
# 'TIMEOUT' '60' \ |
| 703 |
# 'CONNECT' '' \ |
| 704 |
# 'TIMEOUT' '5' \ |
| 705 |
# '~--' '' \ |
| 706 |
#" |
| 707 |
|
| 708 |
# If the link require extra configuration - for example wireless or |
| 709 |
# RFC 268 bridge - we need to depend on the bridge so they get |
| 710 |
# configured correctly. |
| 711 |
#RC_NEED_ppp0="net.nas0" |
| 712 |
|
| 713 |
#WARNING: if MTU of the PPP interface is less than 1500 and you use this |
| 714 |
#machine as a router, you should add the following rule to your firewall |
| 715 |
# |
| 716 |
#iptables -I FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu |
| 717 |
|
| 718 |
#----------------------------------------------------------------------------- |
| 719 |
# ADSL |
| 720 |
# For ADSL support, emerge net-dialup/rp-pppoe |
| 721 |
# WARNING: This ADSL module is being deprecated in favour of the PPP module |
| 722 |
# above. |
| 723 |
# You should make the following settings and also put your |
| 724 |
# username/password information in /etc/ppp/pap-secrets |
| 725 |
|
| 726 |
# Configure the interface to use ADSL |
| 727 |
#config_eth0="adsl" |
| 728 |
|
| 729 |
# You probably won't need to edit /etc/ppp/pppoe.conf if you set this |
| 730 |
#adsl_user_eth0="my-adsl-username" |
| 731 |
|
| 732 |
#----------------------------------------------------------------------------- |
| 733 |
# ISDN |
| 734 |
# For ISDN support, emerge net-dialup/isdn4k-utils |
| 735 |
# You should make the following settings and also put your |
| 736 |
# username/password information in /etc/ppp/pap-secrets |
| 737 |
|
| 738 |
# Configure the interface to use ISDN |
| 739 |
#config_ippp0="dhcp" |
| 740 |
# It's important to specify dhcp if you need it! |
| 741 |
#config_ippp0="192.168.0.1/24" |
| 742 |
# Otherwise, you can use a static IP |
| 743 |
|
| 744 |
# NOTE: The interface name must be either ippp or isdn followed by a number |
| 745 |
|
| 746 |
# You may need this option to set the default route |
| 747 |
#ipppd_eth0="defaultroute" |
| 748 |
|
| 749 |
#----------------------------------------------------------------------------- |
| 750 |
# MAC changer |
| 751 |
# To set a specific MAC address |
| 752 |
#mac_eth0="00:11:22:33:44:55" |
| 753 |
|
| 754 |
# For changing MAC addresses using the below, emerge net-analyzer/macchanger |
| 755 |
# - to randomize the last 3 bytes only |
| 756 |
#mac_eth0="random-ending" |
| 757 |
# - to randomize between the same physical type of connection (e.g. fibre, |
| 758 |
# copper, wireless) , all vendors |
| 759 |
#mac_eth0="random-samekind" |
| 760 |
# - to randomize between any physical type of connection (e.g. fibre, copper, |
| 761 |
# wireless) , all vendors |
| 762 |
#mac_eth0="random-anykind" |
| 763 |
# - full randomization - WARNING: some MAC addresses generated by this may NOT |
| 764 |
# act as expected |
| 765 |
#mac_eth0="random-full" |
| 766 |
# custom - passes all parameters directly to net-analyzer/macchanger |
| 767 |
#mac_eth0="some custom set of parameters" |
| 768 |
|
| 769 |
# You can also set other options based on the MAC address of your network card |
| 770 |
# Handy if you use different docking stations with laptops |
| 771 |
#config_001122334455="dhcp" |
| 772 |
|
| 773 |
#----------------------------------------------------------------------------- |
| 774 |
# TUN/TAP |
| 775 |
# For TUN/TAP support emerge net-misc/openvpn or sys-apps/usermode-utilities |
| 776 |
# |
| 777 |
# You must specify if we're a tun or tap device. Then you can give it any |
| 778 |
# name you like - such as vpn |
| 779 |
#tuntap_vpn="tun" |
| 780 |
#config_vpn="192.168.0.1/24" |
| 781 |
|
| 782 |
# Or stick wit the generic names - like tap0 |
| 783 |
#tuntap_tap0="tap" |
| 784 |
#config_tap0="192.168.0.1/24" |
| 785 |
|
| 786 |
# For passing custom options to tunctl use something like the following. This |
| 787 |
# example sets the owner to adm |
| 788 |
#tunctl_tun1="-u adm" |
| 789 |
# When using openvpn, there are no options |
| 790 |
|
| 791 |
#----------------------------------------------------------------------------- |
| 792 |
# Bridging (802.1d) |
| 793 |
# For bridging support emerge net-misc/bridge-utils |
| 794 |
|
| 795 |
# To add ports to bridge br0 |
| 796 |
#bridge_br0="eth0 eth1" |
| 797 |
# or dynamically add them when the interface comes up |
| 798 |
#bridge_add_eth0="br0" |
| 799 |
#bridge_add_eth1="br0" |
| 800 |
|
| 801 |
# You need to configure the ports to null values so dhcp does not get started |
| 802 |
#config_eth0="null" |
| 803 |
#config_eth1="null" |
| 804 |
|
| 805 |
# Finally give the bridge an address - dhcp or a static IP |
| 806 |
#config_br0="dhcp" # may not work when adding ports dynamically |
| 807 |
#config_br0="192.168.0.1/24" |
| 808 |
|
| 809 |
# If any of the ports require extra configuration - for example wireless or |
| 810 |
# ppp devices - we need to depend on them like so. |
| 811 |
#RC_NEED_br0="net.eth0 net.eth1" |
| 812 |
|
| 813 |
# Below is an example of configuring the bridge |
| 814 |
# Consult "man brctl" for more details |
| 815 |
#brctl_br0="'setfd 0' 'sethello 0' 'stp off'" |
| 816 |
|
| 817 |
#----------------------------------------------------------------------------- |
| 818 |
# RFC 2684 Bridge Support |
| 819 |
# For RFC 2684 bridge support emerge net-misc/br2684ctl |
| 820 |
|
| 821 |
# Interface names have to be of the form nas0, nas1, nas2, etc. |
| 822 |
# You have to specify a VPI and VCI for the interface like so |
| 823 |
#br2684ctl_nas0="-a 0.38" # UK VPI and VCI |
| 824 |
|
| 825 |
# You may want to configure the encapsulation method as well by adding the -e |
| 826 |
# option to the command above (may need to be before the -a command) |
| 827 |
# -e 0 # LLC (default) |
| 828 |
# -e 1 # VC mux |
| 829 |
|
| 830 |
# Then you can configure the interface as normal |
| 831 |
#config_nas0="'192.168.0.1/24'" |
| 832 |
|
| 833 |
#----------------------------------------------------------------------------- |
| 834 |
# Tunnelling |
| 835 |
# WARNING: For tunnelling it is highly recommended that you |
| 836 |
# emerge sys-apps/iproute2 |
| 837 |
# |
| 838 |
# For GRE tunnels |
| 839 |
#iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255" |
| 840 |
|
| 841 |
# For IPIP tunnels |
| 842 |
#iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255" |
| 843 |
|
| 844 |
# To configure the interface |
| 845 |
#config_vpn0="'192.168.0.2 pointopoint 192.168.1.2'" # ifconfig style |
| 846 |
#config_vpn0="'192.168.0.2 peer 192.168.1.1'" # iproute2 style |
| 847 |
|
| 848 |
# 6to4 Tunnels allow IPv6 to work over IPv4 addresses, provided you |
| 849 |
# have a non-private address configured on an interface. |
| 850 |
# link_6to4="eth0" # Interface to base it's addresses on |
| 851 |
# config_6to4="ip6to4" |
| 852 |
# You may want to depend on eth0 like so |
| 853 |
#RC_NEED_6to4="net.eth0" |
| 854 |
# To ensure that eth0 is configured before 6to4. Of course, the tunnel could be |
| 855 |
# any name and this also works for any configured interface. |
| 856 |
# NOTE: If you're not using iproute2 then your 6to4 tunnel has to be called |
| 857 |
# sit0 - otherwise use a different name like 6to4 in the example above. |
| 858 |
|
| 859 |
# You can also specify a relay and suffix if you like. |
| 860 |
# The default relay is 192.88.99.1 and the defualt suffix is :1 |
| 861 |
#relay_6to4="192.168.3.2" |
| 862 |
#suffix_6to4=":ff" |
| 863 |
|
| 864 |
|
| 865 |
#----------------------------------------------------------------------------- |
| 866 |
# System |
| 867 |
# For configuring system specifics such as domain, dns, ntp and nis servers |
| 868 |
# It's rare that you would need todo this, but you can anyway. |
| 869 |
# This is most benefit to wireless users who don't use DHCP so they can change |
| 870 |
# their configs based on SSID. |
| 871 |
|
| 872 |
# If you omit the _eth0 suffix, then it applies to all interfaces unless |
| 873 |
# overridden by the interface suffix. |
| 874 |
#dns_domain_eth0="your.domain" |
| 875 |
#dns_servers_eth0="192.168.0.2 192.168.0.3" |
| 876 |
#dns_search_eth0="this.domain that.domain" |
| 877 |
#dns_options_eth0="'timeout 1' rotate" |
| 878 |
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0" |
| 879 |
# See the man page for resolv.conf for details about the options and sortlist |
| 880 |
# directives |
| 881 |
|
| 882 |
#ntp_servers_eth0="192.168.0.2 192.168.0.3" |
| 883 |
|
| 884 |
#nis_domain_eth0="domain" |
| 885 |
#nis_servers_eth0="192.168.0.2 192.168.0.3" |
| 886 |
|
| 887 |
# NOTE: Setting any of these will stamp on the files in question. So if you |
| 888 |
# don't specify dns_servers but you do specify dns_domain then no nameservers |
| 889 |
# will be listed in /etc/resolv.conf even if there were any there to start |
| 890 |
# with. |
| 891 |
# If this is an issue for you then maybe you should look into a resolv.conf |
| 892 |
# manager like resolvconf-gentoo to manage this file for you. All packages |
| 893 |
# that baselayout supports use resolvconf-gentoo if installed. |
| 894 |
|
| 895 |
#----------------------------------------------------------------------------- |
| 896 |
# Cable in/out detection |
| 897 |
# Sometimes the cable is in, others it's out. Obviously you don't want to |
| 898 |
# restart net.eth0 every time when you plug it in either. |
| 899 |
# |
| 900 |
# netplug is a package that detects this and requires no extra configuration |
| 901 |
# on your part. |
| 902 |
# emerge sys-apps/netplug |
| 903 |
# or |
| 904 |
# emerge sys-apps/ifplugd |
| 905 |
# and you're done :) |
| 906 |
|
| 907 |
# By default we don't wait for netplug/ifplugd to configure the interface. |
| 908 |
# If you would like it to wait so that other services now that network is up |
| 909 |
# then you can specify a timeout here. |
| 910 |
#plug_timeout="10" |
| 911 |
# A value of 0 means wait forever. |
| 912 |
|
| 913 |
# If you don't want to use netplug on a specific interface but you have it |
| 914 |
# installed, you can disable it for that interface via the modules statement |
| 915 |
#modules_eth0="!netplugd" |
| 916 |
# You can do the same for ifplugd |
| 917 |
# |
| 918 |
# You can disable them both with the generic plug |
| 919 |
#modules_eth0="!plug" |
| 920 |
|
| 921 |
# To use specific ifplugd options, fex specifying wireless mode |
| 922 |
#ifplugd_eth0="--api-mode=wlan" |
| 923 |
# man ifplugd for more options |
| 924 |
|
| 925 |
############################################################################## |
| 926 |
# ADVANCED CONFIGURATION |
| 927 |
# |
| 928 |
# Four functions can be defined which will be called surrounding the |
| 929 |
# start/stop operations. The functions are called with the interface |
| 930 |
# name first so that one function can control multiple adapters. An extra two |
| 931 |
# functions can be defined when an interface fails to start or stop. |
| 932 |
# |
| 933 |
# The return values for the preup and predown functions should be 0 |
| 934 |
# (success) to indicate that configuration or deconfiguration of the |
| 935 |
# interface can continue. If preup returns a non-zero value, then |
| 936 |
# interface configuration will be aborted. If predown returns a |
| 937 |
# non-zero value, then the interface will not be allowed to continue |
| 938 |
# deconfiguration. |
| 939 |
# |
| 940 |
# The return values for the postup, postdown, failup and faildown functions are |
| 941 |
# ignored since there's nothing to do if they indicate failure. |
| 942 |
# |
| 943 |
# ${IFACE} is set to the interface being brought up/down |
| 944 |
# ${IFVAR} is ${IFACE} converted to variable name bash allows |
| 945 |
|
| 946 |
#preup() { |
| 947 |
# # Test for link on the interface prior to bringing it up. This |
| 948 |
# # only works on some network adapters and requires the mii-diag |
| 949 |
# # package to be installed. |
| 950 |
# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then |
| 951 |
# ewarn "No link on ${IFACE}, aborting configuration" |
| 952 |
# return 1 |
| 953 |
# fi |
| 954 |
# |
| 955 |
# # Test for link on the interface prior to bringing it up. This |
| 956 |
# # only works on some network adapters and requires the ethtool |
| 957 |
# # package to be installed. |
| 958 |
# if ethtool "${IFACE}" | grep -q 'Link detected: no'; then |
| 959 |
# ewarn "No link on ${IFACE}, aborting configuration" |
| 960 |
# return 1 |
| 961 |
# fi |
| 962 |
# |
| 963 |
# # Test to see if we're docked or not and configure like so |
| 964 |
# # config_docked="dhcp" |
| 965 |
# if grep -q "1" /sys/devices/platform/dock.0/docked ; then |
| 966 |
# einfo "${IFACE} is docked - configuring" |
| 967 |
# _configure_variables "docked" |
| 968 |
# fi |
| 969 |
# |
| 970 |
# # Remember to return 0 on success |
| 971 |
# return 0 |
| 972 |
#} |
| 973 |
|
| 974 |
#predown() { |
| 975 |
# # The default in the script is to test for NFS root and disallow |
| 976 |
# # downing interfaces in that case. Note that if you specify a |
| 977 |
# # predown() function you will override that logic. Here it is, in |
| 978 |
# # case you still want it... |
| 979 |
# if is_net_fs /; then |
| 980 |
# eerror "root filesystem is network mounted -- can't stop ${IFACE}" |
| 981 |
# return 1 |
| 982 |
# fi |
| 983 |
# |
| 984 |
# # Remember to return 0 on success |
| 985 |
# return 0 |
| 986 |
#} |
| 987 |
|
| 988 |
#postup() { |
| 989 |
# # This function could be used, for example, to register with a |
| 990 |
# # dynamic DNS service. Another possibility would be to |
| 991 |
# # send/receive mail once the interface is brought up. |
| 992 |
|
| 993 |
# # Here is an example that allows the use of iproute rules |
| 994 |
# # which have been configured using the rules_eth0 variable. |
| 995 |
# #rules_eth0=" \ |
| 996 |
# # 'from 24.80.102.112/32 to 192.168.1.0/24 table localnet priority 100' \ |
| 997 |
# # 'from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100' \ |
| 998 |
# #" |
| 999 |
# eval set -- $\rules_${IFVAR} |
| 1000 |
# if [ $# != 0 ] ; then |
| 1001 |
# einfo "Adding IP policy routing rules" |
| 1002 |
# eindent |
| 1003 |
# # Ensure that the kernel supports policy routing |
| 1004 |
# if ! ip rule list | grep -q "^" ; then |
| 1005 |
# eerror "You need to enable IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES)" |
| 1006 |
# eerror "in your kernel to use ip rules" |
| 1007 |
# else |
| 1008 |
# for x in "$@" ; do |
| 1009 |
# ebegin "${x}" |
| 1010 |
# ip rule add ${x} dev "${IFACE}" |
| 1011 |
# eend $? |
| 1012 |
# done |
| 1013 |
# fi |
| 1014 |
# eoutdent |
| 1015 |
# # Flush the cache |
| 1016 |
# ip route flush cache dev "${IFACE}" |
| 1017 |
# fi |
| 1018 |
|
| 1019 |
#} |
| 1020 |
|
| 1021 |
#postdown() { |
| 1022 |
# # Enable Wake-On-LAN for every interface except for lo |
| 1023 |
# # Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc |
| 1024 |
# # as well ;) |
| 1025 |
# [ "${IFACE}" != "lo" ] && ethtool -s "${IFACE}" wol g |
| 1026 |
|
| 1027 |
# Automatically erase any ip rules created in the example postup above |
| 1028 |
# if interface_exists "${IFACE}" ; then |
| 1029 |
# # Remove any rules for this interface |
| 1030 |
# local rule |
| 1031 |
# ip rule list | grep " iif ${IFACE}[ ]*" | { |
| 1032 |
# while read rule ; do |
| 1033 |
# rule="${rule#*:}" |
| 1034 |
# ip rule del ${rule} |
| 1035 |
# done |
| 1036 |
# } |
| 1037 |
# # Flush the route cache |
| 1038 |
# ip route flush cache dev "${IFACE}" |
| 1039 |
# fi |
| 1040 |
|
| 1041 |
# # Return 0 always |
| 1042 |
# return 0 |
| 1043 |
#} |
| 1044 |
|
| 1045 |
#failup() { |
| 1046 |
# # This function is mostly here for completeness... I haven't |
| 1047 |
# # thought of anything nifty to do with it yet ;-) |
| 1048 |
#} |
| 1049 |
|
| 1050 |
#faildown() { |
| 1051 |
# # This function is mostly here for completeness... I haven't |
| 1052 |
# # thought of anything nifty to do with it yet ;-) |
| 1053 |
#} |