2007-04-05 16:48:42 +05:30
|
|
|
##############################################################################
|
|
|
|
# QUICK-START
|
|
|
|
#
|
|
|
|
# The quickest start is if you want to use DHCP.
|
|
|
|
# In that case, everything should work out of the box, no configuration
|
|
|
|
# necessary, though the startup script will warn you that you haven't
|
|
|
|
# specified anything.
|
|
|
|
|
|
|
|
# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6
|
|
|
|
# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have
|
|
|
|
# the relevant kernel option enabled. So if you don't have an IPv6 enabled
|
|
|
|
# kernel then remove the IPv6 address from your config.
|
|
|
|
|
|
|
|
# If you want to use a static address or use DHCP explicitly, jump
|
2010-01-08 14:09:25 +05:30
|
|
|
# down to the section labeled INTERFACE HANDLERS.
|
2007-04-05 16:48:42 +05:30
|
|
|
#
|
|
|
|
# If you want to do anything more fancy, you should take the time to
|
|
|
|
# read through the rest of this file.
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# MODULES
|
|
|
|
#
|
|
|
|
# We now support modular networking scripts which means we can easily
|
|
|
|
# add support for new interface types and modules while keeping
|
2010-01-08 14:09:25 +05:30
|
|
|
# compatibility with existing ones.
|
2011-01-17 15:19:07 +05:30
|
|
|
#
|
2007-04-05 16:48:42 +05:30
|
|
|
# Modules load by default if the package they need is installed. If
|
2010-01-08 14:09:25 +05:30
|
|
|
# you specify a module here that doesn't have its package installed
|
2007-04-05 16:48:42 +05:30
|
|
|
# then you get an error stating which package you need to install.
|
|
|
|
# Ideally, you only use the modules setting when you have two or more
|
|
|
|
# packages installed that supply the same service.
|
|
|
|
#
|
|
|
|
# In other words, you probably should DO NOTHING HERE...
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# INTERFACE HANDLERS
|
|
|
|
|
|
|
|
# For a static configuration, use something like this
|
|
|
|
#config_eth0="192.168.0.2/24"
|
|
|
|
|
|
|
|
# If you need more than one address, you can use something like this
|
|
|
|
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
|
|
|
|
# (eth0:1, eth0:2, etc)
|
|
|
|
# iproute2 does not do this as there is no need to
|
2007-11-29 16:47:50 +05:30
|
|
|
#config_eth0="192.168.0.2/24 192.168.0.3/24 192.168.0.4/24"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# You can also use IPv6 addresses
|
|
|
|
# (you should always specify a prefix length with IPv6 here)
|
2007-11-29 16:47:50 +05:30
|
|
|
#config_eth0="192.168.0.2/24 4321:0:1:2:3:4:567:89ab/64 4321:0:1:2:3:4:567:89ac/64"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# If you wish to keep existing addresses + routing and the interface is up,
|
|
|
|
# you can specify a noop (no operation). If the interface is down or there
|
|
|
|
# are no addresses assigned, then we move onto the next step (default dhcp)
|
|
|
|
# This is useful when configuring your interface with a kernel command line
|
|
|
|
# or similar
|
2007-11-29 16:47:50 +05:30
|
|
|
#config_eth0="noop 192.168.0.2/24"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# If you don't want ANY address (only useful when calling for advanced stuff)
|
|
|
|
#config_eth0="null"
|
|
|
|
|
|
|
|
# Here's how to do routing if you need it
|
|
|
|
# We add an IPv4 default route, IPv4 subnet route and an IPv6 unicast route
|
2007-10-29 15:15:49 +05:30
|
|
|
#routes_eth0="default via 192.168.0.1
|
|
|
|
#10.0.0.0/8 via 192.168.0.1
|
|
|
|
#::/0"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# If a specified module fails (like dhcp - see below), you can specify a
|
|
|
|
# fallback like so
|
2007-10-29 15:15:49 +05:30
|
|
|
#fallback_eth0="192.168.0.2 netmask 255.255.255.0"
|
2011-04-10 00:24:01 +05:30
|
|
|
#fallback_routes_eth0="default via 192.168.0.1"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# NOTE: fallback entry must match the entry location in config_eth0
|
|
|
|
# As such you can only have one fallback route.
|
2011-04-10 00:24:01 +05:30
|
|
|
# Also, if you do not set a fallback_routes entry for an interface, the
|
|
|
|
# routes entry will be used if that is set.
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# Some users may need to alter the MTU - here's how
|
|
|
|
#mtu_eth0="1500"
|
|
|
|
|
|
|
|
# Most drivers that report carrier status function correctly, but some do not
|
|
|
|
# One of these faulty drivers is for the Intel e1000 network card, but only
|
|
|
|
# at boot time. To get around this you may alter the carrier_timeout value for
|
2012-10-29 00:59:33 +05:30
|
|
|
# the interface. 0 is disable and any other number of seconds is how
|
|
|
|
# long we wait for carrier. The current default is disabled.
|
|
|
|
#carrier_timeout_eth0=0
|
2007-04-05 16:48:42 +05:30
|
|
|
|
2008-05-09 15:59:06 +05:30
|
|
|
# You may wish to disable the interface being brought down when stopping.
|
|
|
|
# This is only of use for WakeOnLan.
|
|
|
|
#ifdown_eth0="NO"
|
|
|
|
|
2007-04-05 16:48:42 +05:30
|
|
|
##############################################################################
|
|
|
|
# OPTIONAL MODULES
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# WIRELESS (802.11 support)
|
2007-09-17 23:14:10 +05:30
|
|
|
# Wireless can be provided by BSDs ifconfig (iwconfig) or wpa_supplicant
|
|
|
|
# wpa_supplicant is preferred, use the modules directive to prefer iwconfig.
|
|
|
|
#modules="iwconfig"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
2007-09-17 23:14:10 +05:30
|
|
|
# ifconfig (iwconig) support is a one shot script - wpa_supplicant is daemon
|
2010-01-08 14:09:25 +05:30
|
|
|
# that scans, associates and re-configures if association is lost.
|
|
|
|
# We call it iwconfig to separate the wireless setup from ifconfig.
|
2007-04-12 21:14:05 +05:30
|
|
|
####################################
|
|
|
|
# HINTS
|
|
|
|
#
|
|
|
|
# Most users will just need to set the following options
|
2007-11-14 23:53:59 +05:30
|
|
|
# key_SSID1="s:yourkeyhere enc open" # s: means a text key
|
|
|
|
# key_SSID2="aaaa-bbbb-cccc-dd" # no s: means a hex key
|
2007-11-29 16:47:50 +05:30
|
|
|
# preferred_aps="SSID1 SSID2"
|
2007-04-12 21:14:05 +05:30
|
|
|
#
|
|
|
|
# Clear? Good. Now configure your wireless network below
|
|
|
|
|
|
|
|
####################################
|
|
|
|
# SETTINGS
|
2007-11-14 23:53:59 +05:30
|
|
|
# Hard code an SSID to an interface - leave this unset if you wish the driver
|
2007-04-12 21:14:05 +05:30
|
|
|
# to scan for available Access Points
|
|
|
|
# I would only set this as a last resort really - use the preferred_aps
|
|
|
|
# setting at the bottom of this file
|
|
|
|
#essid_eth0='foo'
|
|
|
|
|
|
|
|
# Some drivers/hardware don't scan all that well. We have no control over this
|
|
|
|
# but we can say how many scans we want to do to try and get a better sweep of
|
|
|
|
# the area. The default is 1.
|
|
|
|
#scans_eth0="1"
|
|
|
|
|
|
|
|
#Channel can be set (1-14), but defaults to 3 if not set.
|
|
|
|
#
|
|
|
|
# The below is taken verbatim from the BSD wavelan documentation found at
|
|
|
|
# http://www.netbsd.org/Documentation/network/wavelan.html
|
|
|
|
# There are 14 channels possible; We are told that channels 1-11 are legal for
|
|
|
|
# North America, channels 1-13 for most of Europe, channels 10-13 for France,
|
|
|
|
# and only channel 14 for Japan. If in doubt, please refer to the documentation
|
|
|
|
# that came with your card or access point. Make sure that the channel you
|
|
|
|
# select is the same channel your access point (or the other card in an ad-hoc
|
|
|
|
# network) is on. The default for cards sold in North America and most of Europe
|
|
|
|
# is 3; the default for cards sold in France is 11, and the default for cards
|
|
|
|
# sold in Japan is 14.
|
|
|
|
#channel_eth0="3"
|
|
|
|
|
|
|
|
# Setup any other config commands. This is basically the ifconfig argument
|
|
|
|
# without the ifconfig $iface.
|
|
|
|
#ifconfig_eth0=""
|
2007-11-14 23:53:59 +05:30
|
|
|
# You can do the same per SSID too.
|
|
|
|
#ifconfig_SSID=""
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# Seconds to wait until associated. The default is to wait 10 seconds.
|
|
|
|
# 0 means wait indefinitely. WARNING: this can cause an infinite delay when
|
|
|
|
# booting.
|
|
|
|
#associate_timeout_eth0="5"
|
|
|
|
|
2007-11-14 23:53:59 +05:30
|
|
|
# Define a WEP key per SSID or MAC address (of the AP, not your card)
|
2007-04-12 21:14:05 +05:30
|
|
|
# The encryption type (open or restricted) must match the
|
|
|
|
# encryption type on the Access Point.
|
|
|
|
# To set a hex key, prefix with 0x
|
2007-11-14 23:53:59 +05:30
|
|
|
#key_SSID="0x12341234123412341234123456"
|
2007-04-12 21:14:05 +05:30
|
|
|
# or you can use strings. Passphrase IS NOT supported
|
2007-11-14 23:53:59 +05:30
|
|
|
#key_SSID="foobar"
|
|
|
|
#key_SSID="foobar"
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# WEP key for the AP with MAC address 001122334455
|
|
|
|
#mac_key_001122334455="foobar"
|
|
|
|
|
|
|
|
# You can also override the interface settings found in /etc/conf.d/net
|
2007-11-14 23:53:59 +05:30
|
|
|
# per SSID - which is very handy if you use different networks a lot
|
|
|
|
#config_SSID="dhcp"
|
|
|
|
#routes_SSID=
|
|
|
|
#fallback_SSID=
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# Setting name/domain server causes /etc/resolv.conf to be overwritten
|
|
|
|
# Note that if DHCP is used, and you want this to take precedence then
|
|
|
|
# please put -R in your dhcpcd options
|
2007-11-14 23:53:59 +05:30
|
|
|
#dns_servers_SSID="192.168.0.1 192.168.0.2"
|
|
|
|
#dns_domain_SSID="some.domain"
|
|
|
|
#dns_search_SSID="search.this.domain search.that.domain"
|
2007-04-12 21:14:05 +05:30
|
|
|
# Please check the man page for resolv.conf for more information
|
|
|
|
# as domain and search (searchdomains) are mutually exclusive and
|
|
|
|
# searchdomains takes precedence
|
|
|
|
|
|
|
|
# You can also set any of the /etc/conf.d/net variables per MAC address
|
2007-11-14 23:53:59 +05:30
|
|
|
# incase you use Access Points with the same SSID but need different
|
2007-04-12 21:14:05 +05:30
|
|
|
# networking configs. Below is an example - of course you use the same
|
|
|
|
# method with other variables
|
|
|
|
#config_001122334455="dhcp"
|
|
|
|
#dns_servers_001122334455="192.168.0.1 192.168.0.2"
|
|
|
|
|
2007-11-14 23:53:59 +05:30
|
|
|
# Map a MAC address to an SSID
|
2010-01-08 14:09:25 +05:30
|
|
|
# This is used when the Access Point is not broadcasting its SSID
|
2007-11-14 23:53:59 +05:30
|
|
|
# WARNING: This will override the SSID being broadcast due to some
|
|
|
|
# Access Points sending an SSID even when they have been configured
|
2007-04-12 21:14:05 +05:30
|
|
|
# not to!
|
2007-11-14 23:53:59 +05:30
|
|
|
# Change 001122334455 to the MAC address and SSID to the SSID
|
2007-04-12 21:14:05 +05:30
|
|
|
# it should map to
|
2007-11-14 23:53:59 +05:30
|
|
|
#mac_essid_001122334455="SSID"
|
2007-04-12 21:14:05 +05:30
|
|
|
|
2007-11-14 23:53:59 +05:30
|
|
|
# This lists the preferred SSIDs to connect to in order
|
|
|
|
# SSID's can contain any characters here as they must match the broadcast
|
|
|
|
# SSID exactly.
|
2010-01-08 14:09:25 +05:30
|
|
|
# Surround each SSID with the " character and separate them with a space
|
2007-11-14 23:53:59 +05:30
|
|
|
# If the first SSID isn't found then it moves onto the next
|
2007-04-12 21:14:05 +05:30
|
|
|
# If this isn't defined then it connects to the first one found
|
2007-11-14 23:53:59 +05:30
|
|
|
#preferred_aps="SSID1 SSID2"
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# You can also define a preferred_aps list per interface
|
2007-11-14 23:53:59 +05:30
|
|
|
#preferred_aps_eth0="SSID3 SSID4"
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# You can also say whether we only connect to preferred APs or not
|
|
|
|
# Values are "any", "preferredonly", "forcepreferred", "forcepreferredonly"
|
|
|
|
# and "forceany"
|
|
|
|
# "any" means it will connect to visible APs in the preferred list and then
|
|
|
|
# any other available AP
|
|
|
|
# "preferredonly" means it will only connect to visible APs in the preferred
|
|
|
|
# list
|
2010-01-08 14:09:25 +05:30
|
|
|
# "forcepreferred" means it will forcibly connect to APs in order if it does
|
2007-04-12 21:14:05 +05:30
|
|
|
# not find them in a scan
|
2010-01-08 14:09:25 +05:30
|
|
|
# "forcepreferredonly" means it forcibly connects to the APs in order and
|
2007-04-12 21:14:05 +05:30
|
|
|
# does not bother to scan
|
2011-01-17 15:19:07 +05:30
|
|
|
# "forceany" does the same as forcepreferred + connects to any other
|
2007-04-12 21:14:05 +05:30
|
|
|
# available AP
|
|
|
|
# Default is "any"
|
|
|
|
#associate_order="any"
|
|
|
|
#associate_order_eth0="any"
|
|
|
|
|
|
|
|
# You can define blacklisted Access Points in the same way
|
2007-11-14 23:53:59 +05:30
|
|
|
#blacklist_aps="SSID1 SSID2"
|
|
|
|
#blacklist_aps_eth0="SSID3 SSID4"
|
2007-04-12 21:14:05 +05:30
|
|
|
|
|
|
|
# If you have more than one wireless card, you can say if you want
|
|
|
|
# to allow each card to associate with the same Access Point or not
|
|
|
|
# Values are "yes" and "no"
|
|
|
|
# Default is "yes"
|
|
|
|
#unique_ap="yes"
|
|
|
|
#unique_ap_eth0="yes"
|
|
|
|
|
|
|
|
# IMPORTANT: preferred_only, blacklisted_aps and unique_ap only work when
|
|
|
|
# essid_eth0 is not set and your card is capable of scanning
|
|
|
|
|
|
|
|
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have
|
2007-11-14 23:53:59 +05:30
|
|
|
# the same SSID in both, well, you're a bit silly :p
|
2007-04-05 16:48:42 +05:30
|
|
|
|
2007-04-12 21:14:05 +05:30
|
|
|
##################################################
|
|
|
|
# wpa_supplicant
|
2009-12-21 15:15:03 +05:30
|
|
|
# emerge net-wireless/wpa_supplicant
|
2007-04-05 16:48:42 +05:30
|
|
|
# Wireless options are held in /etc/wpa_supplicant/wpa_supplicant.conf
|
2009-12-21 15:15:03 +05:30
|
|
|
# Consult the wpa_supplicant.conf.example that is installed in
|
2007-04-05 16:48:42 +05:30
|
|
|
# /usr/share/doc/wpa_supplicant
|
|
|
|
|
2009-12-21 15:15:03 +05:30
|
|
|
# By default we don't wait for wpa_supplicant to associate and authenticate.
|
2007-04-05 16:48:42 +05:30
|
|
|
# If you would like to, so can specify how long in seconds
|
|
|
|
#associate_timeout_eth0=60
|
|
|
|
# A value of 0 means wait forever.
|
|
|
|
|
|
|
|
# You can also override any settings found here per SSID - which is very
|
|
|
|
# handy if you use different networks a lot. See below for using the SSID
|
|
|
|
# in our variables
|
|
|
|
#config_SSID="dhcp"
|
|
|
|
# See the System module below for setting dns/nis/ntp per SSID
|
|
|
|
|
|
|
|
# You can also override any settings found here per MAC address of the AP
|
|
|
|
# in case you use Access Points with the same SSID but need different
|
|
|
|
# networking configs. Below is an example - of course you use the same
|
|
|
|
# method with other variables
|
|
|
|
#mac_config_001122334455="dhcp"
|
|
|
|
#mac_dns_servers_001122334455="192.168.0.1 192.168.0.2"
|
|
|
|
|
|
|
|
# When an interface has been associated with an Access Point, a global
|
|
|
|
# variable called SSID is set to the Access Point's SSID for use in the
|
|
|
|
# pre/post user functions below (although it's not available in preup as you
|
|
|
|
# won't have associated then)
|
|
|
|
|
|
|
|
# If you're using anything else to configure wireless on your interface AND
|
2011-01-17 15:19:07 +05:30
|
|
|
# you have installed wpa_supplicant, you need to disable wpa_supplicant
|
2007-04-05 16:48:42 +05:30
|
|
|
#modules="!iwconfig !wpa_supplicant"
|
|
|
|
#or
|
|
|
|
#modules="!wireless"
|
|
|
|
|
|
|
|
##############################################################################
|
2011-01-17 15:19:07 +05:30
|
|
|
# WIRELESS SSID IN VARIABLES
|
2007-04-05 16:48:42 +05:30
|
|
|
##############################################################################
|
|
|
|
# Remember to change SSID to your SSID.
|
|
|
|
# Say that your SSID is My NET - the line
|
|
|
|
# #key_SSID="s:passkey"
|
|
|
|
# becomes
|
|
|
|
# #key_My_NET="s:passkey"
|
|
|
|
# Notice that the space has changed to an underscore - do the same with all
|
|
|
|
# characters not in a-z A-Z (English alphabet) 0-9. This only applies to
|
|
|
|
# variables and not values.
|
|
|
|
#
|
|
|
|
# Any SSID's in values like essid_eth0="My NET" may need to be escaped
|
|
|
|
# This means placing the character \ before the character
|
|
|
|
# \" need to be escaped for example
|
|
|
|
# So if your SSID is
|
|
|
|
# My "\ NET
|
|
|
|
# it becomes
|
|
|
|
# My \"\\ NET
|
|
|
|
# for example
|
|
|
|
# #essid_eth0="My\"\\NET"
|
|
|
|
#
|
|
|
|
# So using the above we can use
|
|
|
|
# #dns_domain_My____NET="My\"\\NET"
|
|
|
|
# which is an invalid dns domain, but shows the how to use the variable
|
|
|
|
# structure
|
|
|
|
#########################################################
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# DHCP
|
|
|
|
# DHCP can be provided by dhclient.
|
|
|
|
#
|
|
|
|
# dhcpcd: emerge net-misc/dhcpcd
|
|
|
|
# dhclient: emerge net-misc/dhcp
|
|
|
|
|
|
|
|
# Regardless of which DHCP client you prefer, you configure them the
|
|
|
|
# same way using one of following depending on which interface modules
|
|
|
|
# you're using.
|
|
|
|
#config_eth0="dhcp"
|
|
|
|
|
|
|
|
# For passing custom options to dhcpcd use something like the following. This
|
|
|
|
# example reduces the timeout for retrieving an address from 60 seconds (the
|
|
|
|
# default) to 10 seconds.
|
|
|
|
#dhcpcd_eth0="-t 10"
|
|
|
|
|
|
|
|
# GENERIC DHCP OPTIONS
|
|
|
|
# Set generic DHCP options like so
|
|
|
|
#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
|
|
|
|
|
2010-01-08 14:09:25 +05:30
|
|
|
# This tells the dhcp client to release its lease when it stops, not to
|
2007-04-05 16:48:42 +05:30
|
|
|
# overwrite dns, ntp and nis settings, not to set a default route and not to
|
|
|
|
# send the current hostname to the dhcp server and when it starts.
|
|
|
|
# You can use any combination of the above options - the default is not to
|
|
|
|
# use any of them.
|
|
|
|
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# System
|
|
|
|
# For configuring system specifics such as domain, dns, ntp and nis servers
|
|
|
|
# It's rare that you would need todo this, but you can anyway.
|
|
|
|
# This is most benefit to wireless users who don't use DHCP so they can change
|
2007-05-03 16:51:26 +05:30
|
|
|
# their configs based on SSID.
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
# If you omit the _eth0 suffix, then it applies to all interfaces unless
|
|
|
|
# overridden by the interface suffix.
|
|
|
|
#dns_domain_eth0="your.domain"
|
|
|
|
#dns_servers_eth0="192.168.0.2 192.168.0.3"
|
|
|
|
#dns_search_eth0="this.domain that.domain"
|
2007-10-29 15:15:49 +05:30
|
|
|
#dns_options_eth0="timeout:1 rotate"
|
2007-04-05 16:48:42 +05:30
|
|
|
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
|
|
|
|
# See the man page for resolv.conf for details about the options and sortlist
|
|
|
|
# directives
|
|
|
|
|
|
|
|
#ntp_servers_eth0="192.168.0.2 192.168.0.3"
|
|
|
|
|
|
|
|
#nis_domain_eth0="domain"
|
|
|
|
#nis_servers_eth0="192.168.0.2 192.168.0.3"
|
|
|
|
|
|
|
|
# NOTE: Setting any of these will stamp on the files in question. So if you
|
|
|
|
# don't specify dns_servers but you do specify dns_domain then no nameservers
|
|
|
|
# will be listed in /etc/resolv.conf even if there were any there to start
|
|
|
|
# with.
|
|
|
|
# If this is an issue for you then maybe you should look into a resolv.conf
|
|
|
|
# manager like resolvconf-gentoo to manage this file for you. All packages
|
|
|
|
# that baselayout supports use resolvconf-gentoo if installed.
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Cable in/out detection
|
|
|
|
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
|
|
|
# restart net.eth0 every time when you plug it in either.
|
|
|
|
# BSD has the Device State Change Daemon - or devd for short
|
|
|
|
# To enable this, simple add devd to the boot runlevel
|
|
|
|
#rc-update add devd boot
|
|
|
|
#rc
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# ADVANCED CONFIGURATION
|
2011-01-17 15:19:07 +05:30
|
|
|
#
|
2007-04-05 16:48:42 +05:30
|
|
|
# Four functions can be defined which will be called surrounding the
|
|
|
|
# start/stop operations. The functions are called with the interface
|
|
|
|
# name first so that one function can control multiple adapters. An extra two
|
|
|
|
# functions can be defined when an interface fails to start or stop.
|
|
|
|
#
|
|
|
|
# The return values for the preup and predown functions should be 0
|
|
|
|
# (success) to indicate that configuration or deconfiguration of the
|
|
|
|
# interface can continue. If preup returns a non-zero value, then
|
|
|
|
# interface configuration will be aborted. If predown returns a
|
|
|
|
# non-zero value, then the interface will not be allowed to continue
|
|
|
|
# deconfiguration.
|
|
|
|
#
|
|
|
|
# The return values for the postup, postdown, failup and faildown functions are
|
|
|
|
# ignored since there's nothing to do if they indicate failure.
|
|
|
|
#
|
|
|
|
# ${IFACE} is set to the interface being brought up/down
|
|
|
|
# ${IFVAR} is ${IFACE} converted to variable name bash allows
|
2011-12-28 22:47:58 +05:30
|
|
|
#
|
|
|
|
# For historical and compatibility reasons, preup is actually normally called
|
|
|
|
# in the following sequence: up ; preup ; up.
|
|
|
|
# The first up causes the kernel to initialize the device, so
|
|
|
|
# that it is available for use in the preup function. However, for some
|
|
|
|
# hardware, e.g. CAN devices, some configuration is needed before trying to up
|
|
|
|
# the interface will actually work. For such hardware, the
|
|
|
|
# up_before_preup variables will allow skipping the first up call if set
|
|
|
|
# to yes.
|
|
|
|
#up_before_preup_IFVAR="NO"
|
|
|
|
#up_before_preup="NO"
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
#preup() {
|
|
|
|
# # Remember to return 0 on success
|
|
|
|
# return 0
|
|
|
|
#}
|
|
|
|
|
|
|
|
#predown() {
|
|
|
|
# # The default in the script is to test for NFS root and disallow
|
|
|
|
# # downing interfaces in that case. Note that if you specify a
|
|
|
|
# # predown() function you will override that logic. Here it is, in
|
|
|
|
# # case you still want it...
|
|
|
|
# if is_net_fs /; then
|
|
|
|
# eerror "root filesystem is network mounted -- can't stop ${IFACE}"
|
|
|
|
# return 1
|
|
|
|
# fi
|
|
|
|
#
|
|
|
|
# # Remember to return 0 on success
|
|
|
|
# return 0
|
|
|
|
#}
|
|
|
|
|
|
|
|
#postup() {
|
|
|
|
# # This function could be used, for example, to register with a
|
|
|
|
# # dynamic DNS service. Another possibility would be to
|
|
|
|
# # send/receive mail once the interface is brought up.
|
|
|
|
|
|
|
|
#}
|
|
|
|
|
|
|
|
#postdown() {
|
|
|
|
# # Return 0 always
|
|
|
|
# return 0
|
|
|
|
#}
|
|
|
|
|
|
|
|
#failup() {
|
|
|
|
# # This function is mostly here for completeness... I haven't
|
|
|
|
# # thought of anything nifty to do with it yet ;-)
|
|
|
|
#}
|
|
|
|
|
|
|
|
#faildown() {
|
|
|
|
# # This function is mostly here for completeness... I haven't
|
|
|
|
# # thought of anything nifty to do with it yet ;-)
|
|
|
|
#}
|