aboutsummaryrefslogtreecommitdiff
path: root/doc/net.example.BSD.in
blob: 2329fa22754c045f422ff482991bf389972d616d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
##############################################################################
# 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
# down to the section labeled INTERFACE HANDLERS.
#
# 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
# compatibility with existing ones.
#
# Modules load by default if the package they need is installed.  If
# you specify a module here that doesn't have its package installed
# 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
#config_eth0="192.168.0.2/24 192.168.0.3/24 192.168.0.4/24"

# You can also use IPv6 addresses
# (you should always specify a prefix length with IPv6 here)
#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"

# 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
#config_eth0="noop 192.168.0.2/24"

# 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
#routes_eth0="default via 192.168.0.1
#10.0.0.0/8 via 192.168.0.1
#::/0"

# If a specified module fails (like dhcp - see below), you can specify a
# fallback like so
#fallback_eth0="192.168.0.2 netmask 255.255.255.0"
#fallback_routes_eth0="default via 192.168.0.1"

# NOTE: fallback entry must match the entry location in config_eth0
# As such you can only have one fallback route.
# Also, if you do not set a fallback_routes entry for an interface, the
# routes entry will be used if that is set.

# 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
# the interface. -1 is disable, 0 is infinite and any other number of seconds
# is how long we wait for carrier. The current default is 3 seconds
#carrier_timeout_eth0=-1

# You may wish to disable the interface being brought down when stopping.
# This is only of use for WakeOnLan.
#ifdown_eth0="NO"

##############################################################################
# OPTIONAL MODULES

#-----------------------------------------------------------------------------
# WIRELESS (802.11 support)
# Wireless can be provided by BSDs ifconfig (iwconfig) or wpa_supplicant
# wpa_supplicant is preferred, use the modules directive to prefer iwconfig.
#modules="iwconfig"

# ifconfig (iwconig) support is a one shot script - wpa_supplicant is daemon
# that scans, associates and re-configures if association is lost.
# We call it iwconfig to separate the wireless setup from ifconfig.
####################################
# HINTS
#
# Most users will just need to set the following options
# key_SSID1="s:yourkeyhere enc open" # s: means a text key
# key_SSID2="aaaa-bbbb-cccc-dd"      # no s: means a hex key
# preferred_aps="SSID1 SSID2"
#
# Clear? Good. Now configure your wireless network below

####################################
# SETTINGS
# Hard code an SSID to an interface - leave this unset if you wish the driver
# 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=""
# You can do the same per SSID too.
#ifconfig_SSID=""

# 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"

# Define a WEP key per SSID or MAC address (of the AP, not your card)
# The encryption type (open or restricted) must match the
# encryption type on the Access Point.
# To set a hex key, prefix with 0x
#key_SSID="0x12341234123412341234123456"
# or you can use strings. Passphrase IS NOT supported
#key_SSID="foobar"
#key_SSID="foobar"

# 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
# per SSID - which is very handy if you use different networks a lot
#config_SSID="dhcp"
#routes_SSID=
#fallback_SSID=

# 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
#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"
# 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
# incase 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
#config_001122334455="dhcp"
#dns_servers_001122334455="192.168.0.1 192.168.0.2"

# Map a MAC address to an SSID
# This is used when the Access Point is not broadcasting its SSID
# WARNING: This will override the SSID being broadcast due to some
# Access Points sending an SSID even when they have been configured
# not to!
# Change 001122334455 to the MAC address and SSID to the SSID
# it should map to
#mac_essid_001122334455="SSID"

# 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.
# Surround each SSID with the " character and separate them with a space
# If the first SSID isn't found then it moves onto the next
# If this isn't defined then it connects to the first one found
#preferred_aps="SSID1 SSID2"

# You can also define a preferred_aps list per interface
#preferred_aps_eth0="SSID3 SSID4"

# 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
# "forcepreferred" means it will forcibly connect to APs in order if it does
# not find them in a scan
# "forcepreferredonly" means it forcibly connects to the APs in order and
# does not bother to scan
# "forceany" does the same as forcepreferred + connects to any other
# available AP
# Default is "any"
#associate_order="any"
#associate_order_eth0="any"

# You can define blacklisted Access Points in the same way
#blacklist_aps="SSID1 SSID2"
#blacklist_aps_eth0="SSID3 SSID4"

# 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
# the same SSID in both, well, you're a bit silly :p

##################################################
# wpa_supplicant
# emerge net-wireless/wpa_supplicant
# Wireless options are held in /etc/wpa_supplicant/wpa_supplicant.conf
# Consult the wpa_supplicant.conf.example that is installed in
# /usr/share/doc/wpa_supplicant

# By default we don't wait for wpa_supplicant to associate and authenticate.
# 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
# you have installed wpa_supplicant, you need to disable wpa_supplicant
#modules="!iwconfig !wpa_supplicant"
#or
#modules="!wireless"

##############################################################################
# WIRELESS SSID IN VARIABLES
##############################################################################
# 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"

# This tells the dhcp client to release its lease when it stops, not to
# 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
# their configs based on SSID.

# 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"
#dns_options_eth0="timeout:1 rotate"
#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
#
# 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

#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 ;-)
#}