/[baselayout]/trunk/conf.d.Linux/wireless.example
Gentoo

Contents of /trunk/conf.d.Linux/wireless.example

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2547 - (show annotations) (download)
Thu Apr 5 11:18:42 2007 UTC (6 years, 1 month ago) by uberlord
File size: 10989 byte(s)
    Rewrite the core parts in C. We now provide librc so other programs can
    query runlevels, services and state without using bash. We also provide
    libeinfo so other programs can easily use our informational functions.

    As such, we have dropped the requirement of using bash as the init script
    shell. We now use /bin/sh and have strived to make the scripts as portable
    as possible. Shells that work are bash and dash. busybox works provided
    you disable s-s-d. If you have WIPE_TMP set to yes in conf.d/bootmisc you
    should disable find too.
    zsh and ksh do not work at this time.

    Networking support is currently being re-vamped also as it was heavily bash
    array based. As such, a new config format is available like so
    config_eth0="1.2.3.4/24 5.6.7.8/16"
    or like so
    config_eth0="'1.2.3.4 netmask 255.255.255.0' '5.6.7.8 netmask 255.255.0.0'"

    We will still support the old bash array format provided that /bin/sh IS
    a link it bash.

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

  ViewVC Help
Powered by ViewVC 1.1.13