7a7d528e8ce16d3961e7c77b1d3b3fab3e5b30c8
[openwrt.git] / docs / wireless.tex
1 The WiFi settings are configured in the file \texttt{/etc/config/wireless}
2 (currently supported on Broadcom and Atheros). When booting the router for the first time
3 it should detect your card and create a sample configuration file. By default '\texttt{option network  lan}' is
4 commented. This prevents unsecured sharing of the network over the wireless interface.
5
6 \paragraph{Generic Broadcom wireless config:}
7
8 \begin{Verbatim}
9 config wifi-device      "wl0"
10     option type         "broadcom"
11     option channel      "5"
12
13 config wifi-iface
14     option device       "wl0"
15 #   option network  lan
16     option mode         "ap"
17     option ssid         "OpenWrt"
18     option hidden       "0"
19     option encryption   "none"
20 \end{Verbatim}
21
22 \paragraph{Generic Atheros wireless config:}
23
24 \begin{Verbatim}
25 config wifi-device      "wifi0"
26     option type         "atheros"
27     option channel      "5"
28     option mode         "11g"
29
30 config wifi-iface
31     option device       "wifi0"
32 #   option network  lan
33     option mode         "ap"
34     option ssid         "OpenWrt"
35     option hidden       "0"
36     option encryption   "none"
37 \end{Verbatim}
38
39 \paragraph{Generic multi-radio Atheros wireless config:}
40
41 \begin{Verbatim}
42 config wifi-device  wifi0
43     option type     atheros
44     option channel  1
45
46 config wifi-iface
47     option device   wifi0
48 #   option network  lan
49     option mode     ap
50     option ssid     OpenWrt_private
51     option hidden   0
52     option encryption none
53
54 config wifi-device  wifi1
55     option type     atheros
56     option channel  11
57
58 config wifi-iface
59     option device   wifi1
60 #   option network  lan
61     option mode     ap
62     option ssid     OpenWrt_public
63     option hidden   1
64     option encryption none
65 \end{Verbatim}
66
67 There are two types of config sections in this file. The '\texttt{wifi-device}' refers to
68 the physical wifi interface and '\texttt{wifi-iface}' configures a virtual interface on top
69 of that (if supported by the driver).
70
71 A full outline of the wireless configuration file with description of each field:
72
73 \begin{Verbatim}
74 config wifi-device     wifi device name
75     option type     broadcom, atheros
76     option country  us, uk, fr, de, etc.
77     option channel  1-14
78     option maxassoc 1-128 (broadcom only)
79     option distance 1-n
80     option mode     11b, 11g, 11a, 11bg (atheros only)
81
82 config wifi-iface
83     option network  the interface you want wifi to bridge with 
84     option device   wifi0, wifi1, wifi2, wifiN
85     option mode     ap, sta, adhoc, or wds
86     option ssid     ssid name
87     option bssid    bssid address
88     option encryption none, wep, psk, psk2, wpa, wpa2 
89     option key      encryption key
90     option key1     key 1
91     option key2     key 2
92     option key3     key 3
93     option key4     key 4
94     option server   ip address
95     option port     port
96     option hidden   0,1
97     option isolate  0,1
98 \end{Verbatim}
99
100 \paragraph{Options for the \texttt{wifi-device}:}
101
102 \begin{itemize}
103     \item \texttt{type} \\
104         The driver to use for this interface.
105         
106     \item \texttt{country} \\
107         The country code used to determine the regulatory settings.
108
109     \item \texttt{channel} \\
110         The wifi channel (e.g. 1-14, depending on your country setting).
111
112     \item \texttt{maxassoc} \\
113         Optional: Maximum number of associated clients. This feature is supported only on the broadcom chipset.
114
115     \item \texttt{distance} \\
116         Optional: Distance between the ap and the furthest client in meters. This feature is supported only on the atheros chipset.
117
118         \item \texttt{mode} \\
119                 The frequency band (\texttt{b}, \texttt{g}, \texttt{bg}, \texttt{a}). This feature is only supported on the atheros chipset.
120
121
122 \end{itemize}
123
124 \paragraph{Options for the \texttt{wifi-iface}:}
125
126 \begin{itemize}
127     \item \texttt{network} \\
128         Selects the interface section from \texttt{/etc/config/network} to be
129         used with this interface
130
131     \item \texttt{device} \\
132         Set the wifi device name.
133
134     \item \texttt{mode} \\
135         Operating mode:
136
137         \begin{itemize}
138             \item \texttt{ap} \\
139                 Access point mode
140
141             \item \texttt{sta} \\
142                 Client mode
143
144             \item \texttt{adhoc} \\
145                 Ad-Hoc mode
146
147             \item \texttt{wds} \\
148                 WDS point-to-point link
149
150         \end{itemize}
151
152     \item \texttt{ssid}
153         Set the SSID to be used on the wifi device.
154
155     \item \texttt{bssid}
156         Set the BSSID address to be used for wds to set the mac address of the other wds unit.
157
158     \item \texttt{encryption} \\
159         Encryption setting. Accepts the following values:
160
161         \begin{itemize}
162             \item \texttt{none}
163             \item \texttt{wep}
164             \item \texttt{psk}, \texttt{psk2} \\
165                 WPA(2) Pre-shared Key
166
167             \item \texttt{wpa}, \texttt{wpa2} \\
168                 WPA(2) RADIUS
169         \end{itemize}
170
171     \item \texttt{key, key1, key2, key3, key4} (wep, wpa and psk) \\
172         WEP key, WPA key (PSK mode) or the RADIUS shared secret (WPA RADIUS mode)
173
174     \item \texttt{server} (wpa) \\
175         The RADIUS server ip address
176
177     \item \texttt{port} (wpa) \\
178         The RADIUS server port
179
180     \item \texttt{hidden} \\
181         0 broadcasts the ssid; 1 disables broadcasting of the ssid
182
183     \item \texttt{isolate} \\
184         Optional: Isolation is a mode usually set on hotspots that limits the clients to communicate only with the AP and not with other wireless clients.
185         0 disables ap isolation (default); 1 enables ap isolation.
186
187 \end{itemize}
188
189
190 \paragraph{Limitations:}
191
192 There are certain limitations when combining modes.
193 Only the following mode combinations are supported:
194
195 \begin{itemize}
196     \item \textbf{Broadcom}: \\
197         \begin{itemize}
198             \item 1x \texttt{sta}, 0-3x \texttt{ap}
199             \item 1-4x \texttt{ap}
200             \item 1x \texttt{adhoc}
201         \end{itemize}
202
203         WDS links can only be used in pure AP mode and cannot use WEP (except when sharing the
204         settings with the master interface, which is done automatically).
205
206     \item \textbf{Atheros}: \\
207         \begin{itemize}
208             \item 1x \texttt{sta}, 0-4x \texttt{ap}
209             \item 1-4x \texttt{ap}
210             \item 1x \texttt{adhoc}
211         \end{itemize}
212 \end{itemize}