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