| 1 |
# BSD NOTE: Network functionality support is still being written and
|
| 2 |
# many parts here are missing compared to Gentoo/Linux
|
| 3 |
# Feel free to write the needed modules and submit them to us :)
|
| 4 |
#
|
| 5 |
##############################################################################
|
| 6 |
# QUICK-START
|
| 7 |
#
|
| 8 |
# The quickest start is if you want to use DHCP.
|
| 9 |
# In that case, everything should work out of the box, no configuration
|
| 10 |
# necessary, though the startup script will warn you that you haven't
|
| 11 |
# specified anything.
|
| 12 |
|
| 13 |
# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6
|
| 14 |
# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have
|
| 15 |
# the relevant kernel option enabled. So if you don't have an IPv6 enabled
|
| 16 |
# kernel then remove the IPv6 address from your config.
|
| 17 |
|
| 18 |
# If you want to use a static address or use DHCP explicitly, jump
|
| 19 |
# down to the section labelled INTERFACE HANDLERS.
|
| 20 |
#
|
| 21 |
# If you want to do anything more fancy, you should take the time to
|
| 22 |
# read through the rest of this file.
|
| 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 |
##############################################################################
|
| 40 |
# INTERFACE HANDLERS
|
| 41 |
|
| 42 |
# For a static configuration, use something like this
|
| 43 |
# (They all do exactly the same thing btw)
|
| 44 |
#config_eth0="192.168.0.2/24"
|
| 45 |
#config_eth0="'192.168.0.2 netmask 255.255.255.0'"
|
| 46 |
|
| 47 |
# We can also specify a broadcast
|
| 48 |
#config_eth0="'192.168.0.2/24 brd 192.168.0.255'"
|
| 49 |
#config_eth0="'192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255'"
|
| 50 |
|
| 51 |
# If you need more than one address, you can use something like this
|
| 52 |
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
|
| 53 |
# (eth0:1, eth0:2, etc)
|
| 54 |
# iproute2 does not do this as there is no need to
|
| 55 |
#config_eth0="'192.168.0.2/24' '192.168.0.3/24' '192.168.0.4/24'"
|
| 56 |
# Or you can use sequence expressions
|
| 57 |
#config_eth0="'192.168.0.{2..4}/24'" FIXME - may not work with baselayout2
|
| 58 |
# which does the same as above. Be careful though as if you use this and
|
| 59 |
# fallbacks, you have to ensure that both end up with the same number of
|
| 60 |
# values otherwise your fallback won't work correctly.
|
| 61 |
|
| 62 |
# You can also use IPv6 addresses
|
| 63 |
# (you should always specify a prefix length with IPv6 here)
|
| 64 |
#config_eth0="192.168.0.2/24 \
|
| 65 |
#4321:0:1:2:3:4:567:89ab/64 \
|
| 66 |
#4321:0:1:2:3:4:567:89ac/64"
|
| 67 |
|
| 68 |
# If you wish to keep existing addresses + routing and the interface is up,
|
| 69 |
# you can specify a noop (no operation). If the interface is down or there
|
| 70 |
# are no addresses assigned, then we move onto the next step (default dhcp)
|
| 71 |
# This is useful when configuring your interface with a kernel command line
|
| 72 |
# or similar
|
| 73 |
#config_eth0="noop 192.168.0.2/24"
|
| 74 |
|
| 75 |
# If you don't want ANY address (only useful when calling for advanced stuff)
|
| 76 |
#config_eth0="null"
|
| 77 |
|
| 78 |
# Here's how to do routing if you need it
|
| 79 |
# We add an IPv4 default route, IPv4 subnet route and an IPv6 unicast route
|
| 80 |
#routes_eth0=" \
|
| 81 |
# 'default via 192.168.0.1' \
|
| 82 |
# '10.0.0.0/8 via 192.168.0.1' \
|
| 83 |
# '::/0' \
|
| 84 |
#"
|
| 85 |
|
| 86 |
# If a specified module fails (like dhcp - see below), you can specify a
|
| 87 |
# fallback like so
|
| 88 |
#fallback_eth0="'192.168.0.2 netmask 255.255.255.0'"
|
| 89 |
#fallback_route_eth0="'default via 192.168.0.1'"
|
| 90 |
|
| 91 |
# NOTE: fallback entry must match the entry location in config_eth0
|
| 92 |
# As such you can only have one fallback route.
|
| 93 |
|
| 94 |
# Some users may need to alter the MTU - here's how
|
| 95 |
#mtu_eth0="1500"
|
| 96 |
|
| 97 |
# Most drivers that report carrier status function correctly, but some do not
|
| 98 |
# One of these faulty drivers is for the Intel e1000 network card, but only
|
| 99 |
# at boot time. To get around this you may alter the carrier_timeout value for
|
| 100 |
# the interface. -1 is disable, 0 is infinite and any other number of seconds
|
| 101 |
# is how long we wait for carrier. The current default is 3 seconds
|
| 102 |
#carrier_timeout_eth0=-1
|
| 103 |
|
| 104 |
##############################################################################
|
| 105 |
# OPTIONAL MODULES
|
| 106 |
|
| 107 |
#-----------------------------------------------------------------------------
|
| 108 |
# WIRELESS (802.11 support)
|
| 109 |
# Wireless can be provided by BSDs ifconfig (iwconfig) or wpa_supplicant
|
| 110 |
# wpa_supplicant is preferred, use the modules directive to prefer iwconfig.
|
| 111 |
#modules="iwconfig"
|
| 112 |
|
| 113 |
# ifconfig (iwconig) support is a one shot script - wpa_supplicant is daemon
|
| 114 |
# that scans, assoicates and re-configures if assocation is lost.
|
| 115 |
# We call it iwconfig to seperate the wireless setup from ifconfig.
|
| 116 |
####################################
|
| 117 |
# HINTS
|
| 118 |
#
|
| 119 |
# Most users will just need to set the following options
|
| 120 |
# key_ESSID1="s:yourkeyhere enc open" # s: means a text key
|
| 121 |
# key_ESSID2="aaaa-bbbb-cccc-dd" # no s: means a hex key
|
| 122 |
# preferred_aps="'ESSID1' 'ESSID2'"
|
| 123 |
#
|
| 124 |
# Clear? Good. Now configure your wireless network below
|
| 125 |
|
| 126 |
####################################
|
| 127 |
# SETTINGS
|
| 128 |
# Hard code an ESSID to an interface - leave this unset if you wish the driver
|
| 129 |
# to scan for available Access Points
|
| 130 |
# I would only set this as a last resort really - use the preferred_aps
|
| 131 |
# setting at the bottom of this file
|
| 132 |
#essid_eth0='foo'
|
| 133 |
|
| 134 |
# Some drivers/hardware don't scan all that well. We have no control over this
|
| 135 |
# but we can say how many scans we want to do to try and get a better sweep of
|
| 136 |
# the area. The default is 1.
|
| 137 |
#scans_eth0="1"
|
| 138 |
|
| 139 |
#Channel can be set (1-14), but defaults to 3 if not set.
|
| 140 |
#
|
| 141 |
# The below is taken verbatim from the BSD wavelan documentation found at
|
| 142 |
# http://www.netbsd.org/Documentation/network/wavelan.html
|
| 143 |
# There are 14 channels possible; We are told that channels 1-11 are legal for
|
| 144 |
# North America, channels 1-13 for most of Europe, channels 10-13 for France,
|
| 145 |
# and only channel 14 for Japan. If in doubt, please refer to the documentation
|
| 146 |
# that came with your card or access point. Make sure that the channel you
|
| 147 |
# select is the same channel your access point (or the other card in an ad-hoc
|
| 148 |
# network) is on. The default for cards sold in North America and most of Europe
|
| 149 |
# is 3; the default for cards sold in France is 11, and the default for cards
|
| 150 |
# sold in Japan is 14.
|
| 151 |
#channel_eth0="3"
|
| 152 |
|
| 153 |
# Setup any other config commands. This is basically the ifconfig argument
|
| 154 |
# without the ifconfig $iface.
|
| 155 |
#ifconfig_eth0=""
|
| 156 |
# You can do the same per ESSID too.
|
| 157 |
#ifconfig_ESSID=""
|
| 158 |
|
| 159 |
# Seconds to wait until associated. The default is to wait 10 seconds.
|
| 160 |
# 0 means wait indefinitely. WARNING: this can cause an infinite delay when
|
| 161 |
# booting.
|
| 162 |
#associate_timeout_eth0="5"
|
| 163 |
|
| 164 |
# Define a WEP key per ESSID or MAC address (of the AP, not your card)
|
| 165 |
# The encryption type (open or restricted) must match the
|
| 166 |
# encryption type on the Access Point.
|
| 167 |
# To set a hex key, prefix with 0x
|
| 168 |
#key_ESSID="0x12341234123412341234123456"
|
| 169 |
# or you can use strings. Passphrase IS NOT supported
|
| 170 |
#key_ESSID="foobar"
|
| 171 |
#key_ESSID="foobar"
|
| 172 |
|
| 173 |
# WEP key for the AP with MAC address 001122334455
|
| 174 |
#mac_key_001122334455="foobar"
|
| 175 |
|
| 176 |
# You can also override the interface settings found in /etc/conf.d/net
|
| 177 |
# per ESSID - which is very handy if you use different networks a lot
|
| 178 |
#config_ESSID="dhcp"
|
| 179 |
#routes_ESSID=
|
| 180 |
#fallback_ESSID=
|
| 181 |
|
| 182 |
# Setting name/domain server causes /etc/resolv.conf to be overwritten
|
| 183 |
# Note that if DHCP is used, and you want this to take precedence then
|
| 184 |
# please put -R in your dhcpcd options
|
| 185 |
#dns_servers_ESSID="192.168.0.1 192.168.0.2"
|
| 186 |
#dns_domain_ESSID="some.domain"
|
| 187 |
#dns_search_path_ESSID="search.this.domain search.that.domain"
|
| 188 |
# Please check the man page for resolv.conf for more information
|
| 189 |
# as domain and search (searchdomains) are mutually exclusive and
|
| 190 |
# searchdomains takes precedence
|
| 191 |
|
| 192 |
# You can also set any of the /etc/conf.d/net variables per MAC address
|
| 193 |
# incase you use Access Points with the same ESSID but need different
|
| 194 |
# networking configs. Below is an example - of course you use the same
|
| 195 |
# method with other variables
|
| 196 |
#config_001122334455="dhcp"
|
| 197 |
#dns_servers_001122334455="192.168.0.1 192.168.0.2"
|
| 198 |
|
| 199 |
# Map a MAC address to an ESSID
|
| 200 |
# This is used when the Access Point is not broadcasting it's ESSID
|
| 201 |
# WARNING: This will override the ESSID being broadcast due to some
|
| 202 |
# Access Points sending an ESSID even when they have been configured
|
| 203 |
# not to!
|
| 204 |
# Change 001122334455 to the MAC address and ESSID to the ESSID
|
| 205 |
# it should map to
|
| 206 |
#mac_essid_001122334455="ESSID"
|
| 207 |
|
| 208 |
# This lists the preferred ESSIDs to connect to in order
|
| 209 |
# ESSID's can contain any characters here as they must match the broadcast
|
| 210 |
# ESSID exactly.
|
| 211 |
# Surround each ESSID with the " character and seperate them with a space
|
| 212 |
# If the first ESSID isn't found then it moves onto the next
|
| 213 |
# If this isn't defined then it connects to the first one found
|
| 214 |
#preferred_aps="'ESSID 1' 'ESSID 2'"
|
| 215 |
|
| 216 |
# You can also define a preferred_aps list per interface
|
| 217 |
#preferred_aps_eth0="'ESSID 3' 'ESSID 4'"
|
| 218 |
|
| 219 |
# You can also say whether we only connect to preferred APs or not
|
| 220 |
# Values are "any", "preferredonly", "forcepreferred", "forcepreferredonly"
|
| 221 |
# and "forceany"
|
| 222 |
# "any" means it will connect to visible APs in the preferred list and then
|
| 223 |
# any other available AP
|
| 224 |
# "preferredonly" means it will only connect to visible APs in the preferred
|
| 225 |
# list
|
| 226 |
# "forcepreferred" means it will forceably connect to APs in order if it does
|
| 227 |
# not find them in a scan
|
| 228 |
# "forcepreferredonly" means it forceably connects to the APs in order and
|
| 229 |
# does not bother to scan
|
| 230 |
# "forceany" does the same as forcepreferred + connects to any other
|
| 231 |
# available AP
|
| 232 |
# Default is "any"
|
| 233 |
#associate_order="any"
|
| 234 |
#associate_order_eth0="any"
|
| 235 |
|
| 236 |
# You can define blacklisted Access Points in the same way
|
| 237 |
#blacklist_aps="'ESSID 1' 'ESSID 2'"
|
| 238 |
#blacklist_aps_eth0="'ESSID 3' 'ESSID 4'"
|
| 239 |
|
| 240 |
# If you have more than one wireless card, you can say if you want
|
| 241 |
# to allow each card to associate with the same Access Point or not
|
| 242 |
# Values are "yes" and "no"
|
| 243 |
# Default is "yes"
|
| 244 |
#unique_ap="yes"
|
| 245 |
#unique_ap_eth0="yes"
|
| 246 |
|
| 247 |
# IMPORTANT: preferred_only, blacklisted_aps and unique_ap only work when
|
| 248 |
# essid_eth0 is not set and your card is capable of scanning
|
| 249 |
|
| 250 |
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have
|
| 251 |
# the same ESSID in both, well, you're a bit silly :p
|
| 252 |
|
| 253 |
##################################################
|
| 254 |
# wpa_supplicant
|
| 255 |
# emerge net-wireless/wpa-supplicant
|
| 256 |
# Wireless options are held in /etc/wpa_supplicant/wpa_supplicant.conf
|
| 257 |
# Console the wpa_supplicant.conf.example that is installed in
|
| 258 |
# /usr/share/doc/wpa_supplicant
|
| 259 |
|
| 260 |
# By default we don't wait for wpa_suppliant to associate and authenticate.
|
| 261 |
# If you would like to, so can specify how long in seconds
|
| 262 |
#associate_timeout_eth0=60
|
| 263 |
# A value of 0 means wait forever.
|
| 264 |
|
| 265 |
# You can also override any settings found here per SSID - which is very
|
| 266 |
# handy if you use different networks a lot. See below for using the SSID
|
| 267 |
# in our variables
|
| 268 |
#config_SSID="dhcp"
|
| 269 |
# See the System module below for setting dns/nis/ntp per SSID
|
| 270 |
|
| 271 |
# You can also override any settings found here per MAC address of the AP
|
| 272 |
# in case you use Access Points with the same SSID but need different
|
| 273 |
# networking configs. Below is an example - of course you use the same
|
| 274 |
# method with other variables
|
| 275 |
#mac_config_001122334455="dhcp"
|
| 276 |
#mac_dns_servers_001122334455="192.168.0.1 192.168.0.2"
|
| 277 |
|
| 278 |
# When an interface has been associated with an Access Point, a global
|
| 279 |
# variable called SSID is set to the Access Point's SSID for use in the
|
| 280 |
# pre/post user functions below (although it's not available in preup as you
|
| 281 |
# won't have associated then)
|
| 282 |
|
| 283 |
# If you're using anything else to configure wireless on your interface AND
|
| 284 |
# you have installed wpa_supplicant, you need to disable wpa_supplicant
|
| 285 |
#modules="!iwconfig !wpa_supplicant"
|
| 286 |
#or
|
| 287 |
#modules="!wireless"
|
| 288 |
|
| 289 |
##############################################################################
|
| 290 |
# WIRELESS SSID IN VARIABLES
|
| 291 |
##############################################################################
|
| 292 |
# Remember to change SSID to your SSID.
|
| 293 |
# Say that your SSID is My NET - the line
|
| 294 |
# #key_SSID="s:passkey"
|
| 295 |
# becomes
|
| 296 |
# #key_My_NET="s:passkey"
|
| 297 |
# Notice that the space has changed to an underscore - do the same with all
|
| 298 |
# characters not in a-z A-Z (English alphabet) 0-9. This only applies to
|
| 299 |
# variables and not values.
|
| 300 |
#
|
| 301 |
# Any SSID's in values like essid_eth0="My NET" may need to be escaped
|
| 302 |
# This means placing the character \ before the character
|
| 303 |
# \" need to be escaped for example
|
| 304 |
# So if your SSID is
|
| 305 |
# My "\ NET
|
| 306 |
# it becomes
|
| 307 |
# My \"\\ NET
|
| 308 |
# for example
|
| 309 |
# #essid_eth0="My\"\\NET"
|
| 310 |
#
|
| 311 |
# So using the above we can use
|
| 312 |
# #dns_domain_My____NET="My\"\\NET"
|
| 313 |
# which is an invalid dns domain, but shows the how to use the variable
|
| 314 |
# structure
|
| 315 |
#########################################################
|
| 316 |
|
| 317 |
#-----------------------------------------------------------------------------
|
| 318 |
# DHCP
|
| 319 |
# DHCP can be provided by dhclient.
|
| 320 |
#
|
| 321 |
# dhcpcd: emerge net-misc/dhcpcd
|
| 322 |
# dhclient: emerge net-misc/dhcp
|
| 323 |
|
| 324 |
# Regardless of which DHCP client you prefer, you configure them the
|
| 325 |
# same way using one of following depending on which interface modules
|
| 326 |
# you're using.
|
| 327 |
#config_eth0="dhcp"
|
| 328 |
|
| 329 |
# For passing custom options to dhcpcd use something like the following. This
|
| 330 |
# example reduces the timeout for retrieving an address from 60 seconds (the
|
| 331 |
# default) to 10 seconds.
|
| 332 |
#dhcpcd_eth0="-t 10"
|
| 333 |
|
| 334 |
# GENERIC DHCP OPTIONS
|
| 335 |
# Set generic DHCP options like so
|
| 336 |
#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
|
| 337 |
|
| 338 |
# This tells the dhcp client to release it's lease when it stops, not to
|
| 339 |
# overwrite dns, ntp and nis settings, not to set a default route and not to
|
| 340 |
# send the current hostname to the dhcp server and when it starts.
|
| 341 |
# You can use any combination of the above options - the default is not to
|
| 342 |
# use any of them.
|
| 343 |
|
| 344 |
|
| 345 |
#-----------------------------------------------------------------------------
|
| 346 |
# System
|
| 347 |
# For configuring system specifics such as domain, dns, ntp and nis servers
|
| 348 |
# It's rare that you would need todo this, but you can anyway.
|
| 349 |
# This is most benefit to wireless users who don't use DHCP so they can change
|
| 350 |
# their configs based on SSID.
|
| 351 |
|
| 352 |
# If you omit the _eth0 suffix, then it applies to all interfaces unless
|
| 353 |
# overridden by the interface suffix.
|
| 354 |
#dns_domain_eth0="your.domain"
|
| 355 |
#dns_servers_eth0="192.168.0.2 192.168.0.3"
|
| 356 |
#dns_search_eth0="this.domain that.domain"
|
| 357 |
#dns_options_eth0="'timeout:1' 'rotate'"
|
| 358 |
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
|
| 359 |
# See the man page for resolv.conf for details about the options and sortlist
|
| 360 |
# directives
|
| 361 |
|
| 362 |
#ntp_servers_eth0="192.168.0.2 192.168.0.3"
|
| 363 |
|
| 364 |
#nis_domain_eth0="domain"
|
| 365 |
#nis_servers_eth0="192.168.0.2 192.168.0.3"
|
| 366 |
|
| 367 |
# NOTE: Setting any of these will stamp on the files in question. So if you
|
| 368 |
# don't specify dns_servers but you do specify dns_domain then no nameservers
|
| 369 |
# will be listed in /etc/resolv.conf even if there were any there to start
|
| 370 |
# with.
|
| 371 |
# If this is an issue for you then maybe you should look into a resolv.conf
|
| 372 |
# manager like resolvconf-gentoo to manage this file for you. All packages
|
| 373 |
# that baselayout supports use resolvconf-gentoo if installed.
|
| 374 |
|
| 375 |
#-----------------------------------------------------------------------------
|
| 376 |
# Cable in/out detection
|
| 377 |
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
| 378 |
# restart net.eth0 every time when you plug it in either.
|
| 379 |
# BSD has the Device State Change Daemon - or devd for short
|
| 380 |
# To enable this, simple add devd to the boot runlevel
|
| 381 |
#rc-update add devd boot
|
| 382 |
#rc
|
| 383 |
|
| 384 |
##############################################################################
|
| 385 |
# ADVANCED CONFIGURATION
|
| 386 |
#
|
| 387 |
# Four functions can be defined which will be called surrounding the
|
| 388 |
# start/stop operations. The functions are called with the interface
|
| 389 |
# name first so that one function can control multiple adapters. An extra two
|
| 390 |
# functions can be defined when an interface fails to start or stop.
|
| 391 |
#
|
| 392 |
# The return values for the preup and predown functions should be 0
|
| 393 |
# (success) to indicate that configuration or deconfiguration of the
|
| 394 |
# interface can continue. If preup returns a non-zero value, then
|
| 395 |
# interface configuration will be aborted. If predown returns a
|
| 396 |
# non-zero value, then the interface will not be allowed to continue
|
| 397 |
# deconfiguration.
|
| 398 |
#
|
| 399 |
# The return values for the postup, postdown, failup and faildown functions are
|
| 400 |
# ignored since there's nothing to do if they indicate failure.
|
| 401 |
#
|
| 402 |
# ${IFACE} is set to the interface being brought up/down
|
| 403 |
# ${IFVAR} is ${IFACE} converted to variable name bash allows
|
| 404 |
|
| 405 |
#preup() {
|
| 406 |
# # Remember to return 0 on success
|
| 407 |
# return 0
|
| 408 |
#}
|
| 409 |
|
| 410 |
#predown() {
|
| 411 |
# # The default in the script is to test for NFS root and disallow
|
| 412 |
# # downing interfaces in that case. Note that if you specify a
|
| 413 |
# # predown() function you will override that logic. Here it is, in
|
| 414 |
# # case you still want it...
|
| 415 |
# if is_net_fs /; then
|
| 416 |
# eerror "root filesystem is network mounted -- can't stop ${IFACE}"
|
| 417 |
# return 1
|
| 418 |
# fi
|
| 419 |
#
|
| 420 |
# # Remember to return 0 on success
|
| 421 |
# return 0
|
| 422 |
#}
|
| 423 |
|
| 424 |
#postup() {
|
| 425 |
# # This function could be used, for example, to register with a
|
| 426 |
# # dynamic DNS service. Another possibility would be to
|
| 427 |
# # send/receive mail once the interface is brought up.
|
| 428 |
|
| 429 |
#}
|
| 430 |
|
| 431 |
#postdown() {
|
| 432 |
# # Return 0 always
|
| 433 |
# return 0
|
| 434 |
#}
|
| 435 |
|
| 436 |
#failup() {
|
| 437 |
# # This function is mostly here for completeness... I haven't
|
| 438 |
# # thought of anything nifty to do with it yet ;-)
|
| 439 |
#}
|
| 440 |
|
| 441 |
#faildown() {
|
| 442 |
# # This function is mostly here for completeness... I haven't
|
| 443 |
# # thought of anything nifty to do with it yet ;-)
|
| 444 |
#}
|