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