| 1 |
# /etc/conf.d/wireless:
|
| 2 |
# Global wireless config file for net.* rc-scripts
|
| 3 |
|
| 4 |
##############################################################################
|
| 5 |
# IMPORTANT
|
| 6 |
# linux-wlan-ng is not supported as they have their own configuration program
|
| 7 |
# ensure that /etc/conf.d/net has the entry "!iwconfig" in it's modules line
|
| 8 |
# Try and use an alternative driver if you need to use this - hostap-driver
|
| 9 |
# supports non-usb linux-wlan-ng driven devices
|
| 10 |
##############################################################################
|
| 11 |
|
| 12 |
##############################################################################
|
| 13 |
# HINTS
|
| 14 |
##############################################################################
|
| 15 |
# Remember to change eth0 to your wireless interface which may be
|
| 16 |
# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure
|
| 17 |
# you can type "iwconfig" at the command prompt and it will tell you which
|
| 18 |
# interfaces are wireless.
|
| 19 |
# Say that your wireless interface is ath0 - the line
|
| 20 |
# #essid_eth0="any"
|
| 21 |
# becomes
|
| 22 |
# #essid_ath0="any"
|
| 23 |
#
|
| 24 |
# Remember to change ESSID to your ESSID.
|
| 25 |
# Say that your ESSID is My NET - the line
|
| 26 |
# #key_ESSID="s:passkey"
|
| 27 |
# becomes
|
| 28 |
# #key_My_NET="s:passkey"
|
| 29 |
# Notice that the space has changed to an underscore - do the same with all
|
| 30 |
# characters not in a-z A-Z (english alphabet) 0-9. This only applies to
|
| 31 |
# variables and not values.
|
| 32 |
#
|
| 33 |
# Any ESSID's in values like essid_eth0="My NET" may need to be escaped
|
| 34 |
# This means placing the character \ before the character
|
| 35 |
# \" need to be escaped for example
|
| 36 |
# So if your ESSID is
|
| 37 |
# My "\ NET
|
| 38 |
# it becomes
|
| 39 |
# My \"\\ NET
|
| 40 |
# for example
|
| 41 |
# #essid_eth0="My\"\\NET"
|
| 42 |
#
|
| 43 |
# So using the above we can use
|
| 44 |
# #dns_domain_My____NET="My\"\\NET"
|
| 45 |
# which is an invalid dns domain, but shows the how to use the variable
|
| 46 |
# structure
|
| 47 |
#
|
| 48 |
# As a final note, most users will just need to set the following options
|
| 49 |
# key_ESSID1="s:yourkeyhere enc open" # s: means a text key
|
| 50 |
# key_ESSID2="aaaa-bbbb-cccc-dd" # no s: means a hex key
|
| 51 |
# preferred_aps=( "ESSID1" "ESSID2" )
|
| 52 |
#
|
| 53 |
# Clear? Good. Now configure your wireless network below
|
| 54 |
#########################################################
|
| 55 |
|
| 56 |
##############################################################################
|
| 57 |
# SETTINGS
|
| 58 |
##############################################################################
|
| 59 |
# Hard code an ESSID to an interface - leave this unset if you wish the driver
|
| 60 |
# to scan for available Access Points
|
| 61 |
# Set to "any" to connect to any ESSID - the driver picks an Access Point
|
| 62 |
# This needs to be done when the driver doesn't support scanning
|
| 63 |
# This may work for drivers that don't support scanning but you need automatic
|
| 64 |
# AP association
|
| 65 |
# I would only set this as a last resort really - use the preferred_aps
|
| 66 |
# setting at the bottom of this file
|
| 67 |
|
| 68 |
# However, using ad-hoc (without scanning for APs) and master mode
|
| 69 |
# do require the ESSID to be set - do this here
|
| 70 |
#essid_eth0="any"
|
| 71 |
|
| 72 |
# Set the mode of the interface (managed, ad-hoc, master or auto)
|
| 73 |
# The default is auto
|
| 74 |
# If it's ad-hoc or master you also may need to specify the channel below
|
| 75 |
#mode_eth0="auto"
|
| 76 |
|
| 77 |
# If managed mode fails, drop to ad-hoc mode with the below ESSID?
|
| 78 |
#adhoc_essid_eth0="WLAN"
|
| 79 |
|
| 80 |
#Channel can be set (1-14), but defaults to 3 if not set.
|
| 81 |
#
|
| 82 |
# The below is taken verbatim from the BSD wavelan documentation found at
|
| 83 |
# http://www.netbsd.org/Documentation/network/wavelan.html
|
| 84 |
# There are 14 channels possible; We are told that channels 1-11 are legal for
|
| 85 |
# North America, channels 1-13 for most of Europe, channels 10-13 for France,
|
| 86 |
# and only channel 14 for Japan. If in doubt, please refer to the documentation
|
| 87 |
# that came with your card or access point. Make sure that the channel you
|
| 88 |
# select is the same channel your access point (or the other card in an ad-hoc
|
| 89 |
# network) is on. The default for cards sold in North America and most of Europe
|
| 90 |
# is 3; the default for cards sold in France is 11, and the default for cards
|
| 91 |
# sold in Japan is 14.
|
| 92 |
#channel_eth0="3"
|
| 93 |
|
| 94 |
# Setup any other config commands. This is basically the iwconfig argument
|
| 95 |
# without the iwconfig $iface
|
| 96 |
#iwconfig_eth0=""
|
| 97 |
|
| 98 |
# Set private driver ioctls. This is basically the iwpriv argument without
|
| 99 |
# the iwpriv $iface
|
| 100 |
#iwpriv_eth0=""
|
| 101 |
|
| 102 |
# Seconds to wait before scanning
|
| 103 |
# Some drivers need to wait until they have finished "loading"
|
| 104 |
# before they can scan - otherwise they error and claim that they cannot scan
|
| 105 |
# or resource is unavailable. The default is to wait zero seconds
|
| 106 |
#sleep_scan_eth0="1"
|
| 107 |
|
| 108 |
# Seconds to wait until associated. The default is to wait 10 seconds
|
| 109 |
#sleep_associate_eth0="5"
|
| 110 |
|
| 111 |
# By default a successful association in Managed mode sets the MAC
|
| 112 |
# address of the AP connected to. However, some drivers (namely
|
| 113 |
# the ipw2100) don't set an invalid MAC address when association
|
| 114 |
# fails - so we need to check on link quality which some drivers
|
| 115 |
# don't report properly either.
|
| 116 |
# So if you have connection problems try flipping this setting
|
| 117 |
# Valid options are MAC, quality and all - defaults to MAC
|
| 118 |
#associate_test_eth0="MAC"
|
| 119 |
|
| 120 |
# Some driver/card combinations need to scan in Ad-Hoc mode
|
| 121 |
# After scanning, the mode is reset to the one defined above
|
| 122 |
#scan_mode_eth0="Ad-Hoc"
|
| 123 |
|
| 124 |
# Below you can define private ioctls to run before and after scanning
|
| 125 |
# Format is the same as the iwpriv_eth0 above
|
| 126 |
# This is needed for the HostAP drivers
|
| 127 |
#iwpriv_scan_pre_eth0="host_roaming 2"
|
| 128 |
#iwpriv_scan_post_eth0="host_roaming 0"
|
| 129 |
|
| 130 |
# Define a WEP key per ESSID or MAC address (of the AP, not your card)
|
| 131 |
# The encryption type (open or restricted) must match the
|
| 132 |
# encryption type on the Access Point
|
| 133 |
# You can't use "any" for an ESSID here
|
| 134 |
#key_ESSID="1234-1234-1234-1234-1234-1234-56"
|
| 135 |
# or you can use strings. Passphrase IS NOT supported
|
| 136 |
# To use a string, prefix it with s:
|
| 137 |
# Note - this example also sets the encryption method to open
|
| 138 |
# which is regarded as more secure than restricted
|
| 139 |
#key_ESSID="s:foobar enc open"
|
| 140 |
#key_ESSID="s:foobar enc restricted"
|
| 141 |
|
| 142 |
# If you have whitespace in your key, here's how to set it and use other
|
| 143 |
# commands like using open encryption.
|
| 144 |
#key_ESSID="s:'foo bar' enc open"
|
| 145 |
|
| 146 |
# WEP key for the AP with MAC address 001122334455
|
| 147 |
#key_001122334455="s:foobar"
|
| 148 |
|
| 149 |
# Here are some more examples of keys as some users find others work
|
| 150 |
# and some don't where they should all do the same thing
|
| 151 |
#key_ESSID="open s:foobar"
|
| 152 |
#key_ESSID="open 1234-5678-9012"
|
| 153 |
#key_ESSID="s:foobar enc open"
|
| 154 |
#key_ESSID="1234-5678-9012 enc open"
|
| 155 |
|
| 156 |
# You may want to set muliple keys - here's an example
|
| 157 |
# It sets 4 keys on the card and instructs to use key 2 by default
|
| 158 |
#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"
|
| 159 |
|
| 160 |
# You can also override the interface settings found in /etc/conf.d/net
|
| 161 |
# per ESSID - which is very handy if you use different networks a lot
|
| 162 |
#config_ESSID=( "dhcp" )
|
| 163 |
#dhcpcd_ESSID="-t 5"
|
| 164 |
#routes_ESSID=()
|
| 165 |
#fallback_ESSID=()
|
| 166 |
|
| 167 |
# Setting name/domain server causes /etc/resolv.conf to be overwritten
|
| 168 |
# Note that if DHCP is used, and you want this to take precedence then
|
| 169 |
# please put -R in your dhcpcd options
|
| 170 |
#dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" )
|
| 171 |
#dns_domain_ESSID="some.domain"
|
| 172 |
#dns_search_path_ESSID="search.this.domain search.that.domain"
|
| 173 |
# Please check the man page for resolv.conf for more information
|
| 174 |
# as domain and search (searchdomains) are mutually exclusive and
|
| 175 |
# searchdomains takes precedence
|
| 176 |
|
| 177 |
# You can also set any of the /etc/conf.d/net variables per MAC address
|
| 178 |
# incase you use Access Points with the same ESSID but need different
|
| 179 |
# networking configs. Below is an example - of course you use the same
|
| 180 |
# method with other variables
|
| 181 |
#config_001122334455=( "dhcp" )
|
| 182 |
#dhcpcd_001122334455="-t 10"
|
| 183 |
#dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )
|
| 184 |
|
| 185 |
# Map a MAC address to an ESSID
|
| 186 |
# This is used when the Access Point is not broadcasting it's ESSID
|
| 187 |
# WARNING: This will override the ESSID being broadcast due to some
|
| 188 |
# Access Points sending an ESSID even when they have been configured
|
| 189 |
# not too!
|
| 190 |
# Change 001122334455 to the MAC address and ESSID to the ESSID
|
| 191 |
# it should map to
|
| 192 |
#essid_001122334455="ESSID"
|
| 193 |
|
| 194 |
# This lists the preferred ESSIDs to connect to in order
|
| 195 |
# ESSID's can contain any characters here as they must match the broadcast
|
| 196 |
# ESSID exactly.
|
| 197 |
# Surround each ESSID with the " character and seperate them with a space
|
| 198 |
# If the first ESSID isn't found then it moves onto the next
|
| 199 |
# If this isn't defined then it connects to the first one found
|
| 200 |
#preferred_aps=( "ESSID 1" "ESSID 2" )
|
| 201 |
|
| 202 |
# You can also define a preferred_aps list per interface
|
| 203 |
#preferred_aps_eth0=( "ESSID 3" "ESSID 4" )
|
| 204 |
|
| 205 |
# You can also say whether we only connect to preferred APs or not
|
| 206 |
# Values are "any", "preferredonly", "forcepreferred", "forcepreferredonly" and "forceany"
|
| 207 |
# "any" means it will connect to visible APs in the preferred list and then any
|
| 208 |
# other available AP
|
| 209 |
# "preferredonly" means it will only connect to visible APs in the preferred list
|
| 210 |
# "forcepreferred" means it will forceably connect to APs in order if it does not find
|
| 211 |
# them in a scan
|
| 212 |
# "forcepreferredonly" means it forceably connects to the APs in order and does not bother
|
| 213 |
# to scan
|
| 214 |
# "forceany" does the same as forcepreferred + connects to any other available AP
|
| 215 |
# Default is "any"
|
| 216 |
#associate_order="any"
|
| 217 |
#associate_order_eth0="any"
|
| 218 |
|
| 219 |
# You can define blacklisted Access Points in the same way
|
| 220 |
#blacklist_aps=( "ESSID 1" "ESSID 2" )
|
| 221 |
#blacklist_aps_eth0=( "ESSID 3" ESSID 4" )
|
| 222 |
|
| 223 |
# If you have more than one wireless card, you can say if you want
|
| 224 |
# to allow each card to associate with the same Access Point or not
|
| 225 |
# Values are "yes" and "no"
|
| 226 |
# Default is "yes"
|
| 227 |
#unique_ap="yes"
|
| 228 |
#unique_ap_eth0="yes"
|
| 229 |
|
| 230 |
# IMPORTANT: preferred_only, blacklisted_aps and unique_ap only work when
|
| 231 |
# essid_eth0 is not set and your card is capable of scanning
|
| 232 |
|
| 233 |
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have
|
| 234 |
# the same ESSID in both, well, you're a bit silly :p
|
| 235 |
|
| 236 |
|
| 237 |
##############################################################################
|
| 238 |
# ADVANCED CONFIGURATION
|
| 239 |
#
|
| 240 |
# Two functions can be defined which will be called surrounding the
|
| 241 |
# associate function. The functions are called with the interface
|
| 242 |
# name first so that one function can control multiple adapters.
|
| 243 |
#
|
| 244 |
# The return values for the preassociate function should be 0
|
| 245 |
# (success) to indicate that configuration or deconfiguration of the
|
| 246 |
# interface can continue. If preassociate returns a non-zero value, then
|
| 247 |
# interface configuration will be aborted.
|
| 248 |
#
|
| 249 |
# The return value for the postassociate function is ignored
|
| 250 |
# since there's nothing to do if it indicates failure.
|
| 251 |
|
| 252 |
#preassociate() {
|
| 253 |
# # The below adds two configuration variables leap_user_ESSID
|
| 254 |
# # and leap_pass_ESSID. When they are both confiugred for the ESSID
|
| 255 |
# # being connected to then we run the CISCO LEAP script
|
| 256 |
#
|
| 257 |
# local user pass
|
| 258 |
# eval user=\"\$\{leap_user_${ESSIDVAR}\}\"
|
| 259 |
# eval pass=\"\$\{leap_pass_${ESSIDVAR}\}\"
|
| 260 |
#
|
| 261 |
# if [[ -n ${user} && -n ${pass} ]]; then
|
| 262 |
# if [[ ! -x /opt/cisco/bin/leapscript ]]; then
|
| 263 |
# eend "For LEAP support, please emerge net-misc/cisco-aironet-client-utils"
|
| 264 |
# return 1
|
| 265 |
# fi
|
| 266 |
# einfo "Waiting for LEAP Authentication on \"${ESSID//\\\\//}\""
|
| 267 |
# if /opt/cisco/bin/leapscript ${user} ${pass} | grep -q 'Login incorrect'; then
|
| 268 |
# ewarn "Login Failed for ${user}"
|
| 269 |
# return 1
|
| 270 |
# fi
|
| 271 |
# fi
|
| 272 |
#
|
| 273 |
# return 0
|
| 274 |
#}
|
| 275 |
|
| 276 |
#postassociate() {
|
| 277 |
# # This function is mostly here for completeness... I haven't
|
| 278 |
# # thought of anything nifty to do with it yet ;-)
|
| 279 |
# # Return 0 always
|
| 280 |
# return 0
|
| 281 |
#}
|