~ubuntu-branches/ubuntu/gutsy/wpasupplicant/gutsy

« back to all changes in this revision

Viewing changes to wpa_supplicant/README

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Alexander Sack
  • Date: 2007-08-26 16:06:57 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070826160657-2m8pxoweuxe8f93t
Tags: 0.6.0+0.5.8-0ubuntu1
* New upstream release
* remove patch 11_erroneous_manpage_ref, applied upstream
* remove patch 25_wpas_dbus_unregister_iface_fix, applied upstream

[ Alexander Sack ]
* bumping upstream version to replace development version 0.6.0 with
  this package from stable release branch.
* attempt to fix wierd timeout and high latency issues by going
  back to stable upstream version (0.5.9) (LP: #140763,
  LP: #141233).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
WPA Supplicant
2
 
==============
3
 
 
4
 
Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> and contributors
5
 
All Rights Reserved.
6
 
 
7
 
This program is dual-licensed under both the GPL version 2 and BSD
8
 
license. Either license may be used at your option.
9
 
 
10
 
 
11
 
 
12
 
License
13
 
-------
14
 
 
15
 
GPL v2:
16
 
 
17
 
This program is free software; you can redistribute it and/or modify
18
 
it under the terms of the GNU General Public License version 2 as
19
 
published by the Free Software Foundation.
20
 
 
21
 
This program is distributed in the hope that it will be useful,
22
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 
GNU General Public License for more details.
25
 
 
26
 
You should have received a copy of the GNU General Public License
27
 
along with this program; if not, write to the Free Software
28
 
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
29
 
 
30
 
(this copy of the license is in COPYING file)
31
 
 
32
 
 
33
 
Alternatively, this software may be distributed, used, and modified
34
 
under the terms of BSD license:
35
 
 
36
 
Redistribution and use in source and binary forms, with or without
37
 
modification, are permitted provided that the following conditions are
38
 
met:
39
 
 
40
 
1. Redistributions of source code must retain the above copyright
41
 
   notice, this list of conditions and the following disclaimer.
42
 
 
43
 
2. Redistributions in binary form must reproduce the above copyright
44
 
   notice, this list of conditions and the following disclaimer in the
45
 
   documentation and/or other materials provided with the distribution.
46
 
 
47
 
3. Neither the name(s) of the above-listed copyright holder(s) nor the
48
 
   names of its contributors may be used to endorse or promote products
49
 
   derived from this software without specific prior written permission.
50
 
 
51
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52
 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53
 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54
 
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55
 
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56
 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57
 
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58
 
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59
 
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60
 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
 
 
63
 
 
64
 
 
65
 
Features
66
 
--------
67
 
 
68
 
Supported WPA/IEEE 802.11i features:
69
 
- WPA-PSK ("WPA-Personal")
70
 
- WPA with EAP (e.g., with RADIUS authentication server) ("WPA-Enterprise")
71
 
  Following authentication methods are supported with an integrate IEEE 802.1X
72
 
  Supplicant:
73
 
  * EAP-TLS
74
 
  * EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)
75
 
  * EAP-PEAP/TLS (both PEAPv0 and PEAPv1)
76
 
  * EAP-PEAP/GTC (both PEAPv0 and PEAPv1)
77
 
  * EAP-PEAP/OTP (both PEAPv0 and PEAPv1)
78
 
  * EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)
79
 
  * EAP-TTLS/EAP-MD5-Challenge
80
 
  * EAP-TTLS/EAP-GTC
81
 
  * EAP-TTLS/EAP-OTP
82
 
  * EAP-TTLS/EAP-MSCHAPv2
83
 
  * EAP-TTLS/EAP-TLS
84
 
  * EAP-TTLS/MSCHAPv2
85
 
  * EAP-TTLS/MSCHAP
86
 
  * EAP-TTLS/PAP
87
 
  * EAP-TTLS/CHAP
88
 
  * EAP-SIM
89
 
  * EAP-AKA
90
 
  * EAP-PSK
91
 
  * EAP-PAX
92
 
  * EAP-SAKE
93
 
  * EAP-GPSK
94
 
  * LEAP (note: requires special support from the driver for IEEE 802.11
95
 
          authentication)
96
 
  (following methods are supported, but since they do not generate keying
97
 
   material, they cannot be used with WPA or IEEE 802.1X WEP keying)
98
 
  * EAP-MD5-Challenge 
99
 
  * EAP-MSCHAPv2
100
 
  * EAP-GTC
101
 
  * EAP-OTP
102
 
- key management for CCMP, TKIP, WEP104, WEP40
103
 
- RSN/WPA2 (IEEE 802.11i)
104
 
  * pre-authentication
105
 
  * PMKSA caching
106
 
 
107
 
Supported TLS/crypto libraries:
108
 
- OpenSSL (default)
109
 
- GnuTLS
110
 
 
111
 
Internal TLS/crypto implementation (optional):
112
 
- can be used in place of an external TLS/crypto library
113
 
- TLSv1
114
 
- X.509 certificate processing
115
 
- PKCS #1
116
 
- ASN.1
117
 
- RSA
118
 
- bignum
119
 
- minimal size (ca. 50 kB binary, parts of which are already needed for WPA;
120
 
  TLSv1/X.509/ASN.1/RSA/bignum parts are about 25 kB on x86)
121
 
 
122
 
 
123
 
Requirements
124
 
------------
125
 
 
126
 
Current hardware/software requirements:
127
 
- Linux kernel 2.4.x or 2.6.x with Linux Wireless Extensions v15 or newer
128
 
- FreeBSD 6-CURRENT
129
 
- NetBSD-current
130
 
- Microsoft Windows with WinPcap (at least WinXP, may work with other versions)
131
 
- drivers:
132
 
        Linux drivers that support WPA/WPA2 configuration with the generic
133
 
        Linux wireless extensions (WE-18 or newer). Even though there are
134
 
        number of driver specific interface included in wpa_supplicant, please
135
 
        note that Linux drivers are moving to use generic wireless extensions
136
 
        and driver_wext (-Dwext on wpa_supplicant command line) should be the
137
 
        default option to start with before falling back to driver specific
138
 
        interface.
139
 
 
140
 
        Host AP driver for Prism2/2.5/3 (development snapshot/v0.2.x)
141
 
        (http://hostap.epitest.fi/)
142
 
        Driver need to be set in Managed mode ('iwconfig wlan0 mode managed').
143
 
        Please note that station firmware version needs to be 1.7.0 or newer
144
 
        to work in WPA mode.
145
 
 
146
 
        Linuxant DriverLoader (http://www.linuxant.com/driverloader/)
147
 
        with Windows NDIS driver for your wlan card supporting WPA.
148
 
 
149
 
        Agere Systems Inc. Linux Driver
150
 
        (http://www.agere.com/support/drivers/)
151
 
        Please note that the driver interface file (driver_hermes.c) and
152
 
        hardware specific include files are not included in the
153
 
        wpa_supplicant distribution. You will need to copy these from the
154
 
        source package of the Agere driver.
155
 
 
156
 
        madwifi driver for cards based on Atheros chip set (ar521x)
157
 
        (http://sourceforge.net/projects/madwifi/)
158
 
        Please note that you will need to modify the wpa_supplicant .config
159
 
        file to use the correct path for the madwifi driver root directory
160
 
        (CFLAGS += -I../madwifi/wpa line in example defconfig).
161
 
 
162
 
        ATMEL AT76C5XXx driver for USB and PCMCIA cards
163
 
        (http://atmelwlandriver.sourceforge.net/).
164
 
 
165
 
        Linux ndiswrapper (http://ndiswrapper.sourceforge.net/) with
166
 
        Windows NDIS driver.
167
 
 
168
 
        Broadcom wl.o driver
169
 
        This is a generic Linux driver for Broadcom IEEE 802.11a/g cards.
170
 
        However, it is proprietary driver that is not publicly available
171
 
        except for couple of exceptions, mainly Broadcom-based APs/wireless
172
 
        routers that use Linux. The driver binary can be downloaded, e.g.,
173
 
        from Linksys support site (http://www.linksys.com/support/gpl.asp)
174
 
        for Linksys WRT54G. The GPL tarball includes cross-compiler and
175
 
        the needed header file, wlioctl.h, for compiling wpa_supplicant.
176
 
        This driver support in wpa_supplicant is expected to work also with
177
 
        other devices based on Broadcom driver (assuming the driver includes
178
 
        client mode support).
179
 
 
180
 
        Intel ipw2100 driver
181
 
        (http://sourceforge.net/projects/ipw2100/)
182
 
 
183
 
        Intel ipw2200 driver
184
 
        (http://sourceforge.net/projects/ipw2200/)
185
 
 
186
 
        In theory, any driver that supports Linux wireless extensions can be
187
 
        used with IEEE 802.1X (i.e., not WPA) when using ap_scan=0 option in
188
 
        configuration file.
189
 
 
190
 
        Wired Ethernet drivers (with ap_scan=0)
191
 
 
192
 
        BSD net80211 layer (e.g., Atheros driver)
193
 
        At the moment, this is for FreeBSD 6-CURRENT branch and NetBSD-current.
194
 
 
195
 
        Windows NDIS
196
 
        The current Windows port requires WinPcap (http://winpcap.polito.it/).
197
 
        See README-Windows.txt for more information.
198
 
 
199
 
wpa_supplicant was designed to be portable for different drivers and
200
 
operating systems. Hopefully, support for more wlan cards and OSes will be
201
 
added in the future. See developer's documentation
202
 
(http://hostap.epitest.fi/wpa_supplicant/devel/) for more information about the
203
 
design of wpa_supplicant and porting to other drivers. One main goal
204
 
is to add full WPA/WPA2 support to Linux wireless extensions to allow
205
 
new drivers to be supported without having to implement new
206
 
driver-specific interface code in wpa_supplicant.
207
 
 
208
 
Optional libraries for layer2 packet processing:
209
 
- libpcap (tested with 0.7.2, most relatively recent versions assumed to work,
210
 
        this is likely to be available with most distributions,
211
 
        http://tcpdump.org/)
212
 
- libdnet (tested with v1.4, most versions assumed to work,
213
 
        http://libdnet.sourceforge.net/)
214
 
 
215
 
These libraries are _not_ used in the default Linux build. Instead,
216
 
internal Linux specific implementation is used. libpcap/libdnet are
217
 
more portable and they can be used by adding CONFIG_L2_PACKET=pcap into
218
 
.config. They may also be selected automatically for other operating
219
 
systems. In case of Windows builds, WinPcap is used by default
220
 
(CONFIG_L2_PACKET=winpcap).
221
 
 
222
 
 
223
 
Optional libraries for EAP-TLS, EAP-PEAP, and EAP-TTLS:
224
 
- OpenSSL (tested with 0.9.7c and 0.9.7d, and 0.9.8 versions; assumed to
225
 
  work with most relatively recent versions; this is likely to be
226
 
  available with most distributions, http://www.openssl.org/)
227
 
- GnuTLS
228
 
- internal TLSv1 implementation
229
 
 
230
 
TLS options for EAP-FAST:
231
 
- OpenSSL 0.9.8d _with_ openssl-0.9.8d-tls-extensions.patch applied
232
 
  (i.e., the default OpenSSL package does not include support for
233
 
  extensions needed for EAP-FAST)
234
 
- internal TLSv1 implementation
235
 
 
236
 
One of these libraries is needed when EAP-TLS, EAP-PEAP, EAP-TTLS, or
237
 
EAP-FAST support is enabled. WPA-PSK mode does not require this or EAPOL/EAP
238
 
implementation. A configuration file, .config, for compilation is
239
 
needed to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5,
240
 
EAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so
241
 
they should only be enabled if testing the EAPOL/EAP state
242
 
machines. However, there can be used as inner authentication
243
 
algorithms with EAP-PEAP and EAP-TTLS.
244
 
 
245
 
See Building and installing section below for more detailed
246
 
information about the wpa_supplicant build time configuration.
247
 
 
248
 
 
249
 
 
250
 
WPA
251
 
---
252
 
 
253
 
The original security mechanism of IEEE 802.11 standard was not
254
 
designed to be strong and has proven to be insufficient for most
255
 
networks that require some kind of security. Task group I (Security)
256
 
of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked
257
 
to address the flaws of the base standard and has in practice
258
 
completed its work in May 2004. The IEEE 802.11i amendment to the IEEE
259
 
802.11 standard was approved in June 2004 and published in July 2004.
260
 
 
261
 
Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the
262
 
IEEE 802.11i work (draft 3.0) to define a subset of the security
263
 
enhancements that can be implemented with existing wlan hardware. This
264
 
is called Wi-Fi Protected Access<TM> (WPA). This has now become a
265
 
mandatory component of interoperability testing and certification done
266
 
by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web
267
 
site (http://www.wi-fi.org/OpenSection/protected_access.asp).
268
 
 
269
 
IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm
270
 
for protecting wireless networks. WEP uses RC4 with 40-bit keys,
271
 
24-bit initialization vector (IV), and CRC32 to protect against packet
272
 
forgery. All these choices have proven to be insufficient: key space is
273
 
too small against current attacks, RC4 key scheduling is insufficient
274
 
(beginning of the pseudorandom stream should be skipped), IV space is
275
 
too small and IV reuse makes attacks easier, there is no replay
276
 
protection, and non-keyed authentication does not protect against bit
277
 
flipping packet data.
278
 
 
279
 
WPA is an intermediate solution for the security issues. It uses
280
 
Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a
281
 
compromise on strong security and possibility to use existing
282
 
hardware. It still uses RC4 for the encryption like WEP, but with
283
 
per-packet RC4 keys. In addition, it implements replay protection,
284
 
keyed packet authentication mechanism (Michael MIC).
285
 
 
286
 
Keys can be managed using two different mechanisms. WPA can either use
287
 
an external authentication server (e.g., RADIUS) and EAP just like
288
 
IEEE 802.1X is using or pre-shared keys without need for additional
289
 
servers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal",
290
 
respectively. Both mechanisms will generate a master session key for
291
 
the Authenticator (AP) and Supplicant (client station).
292
 
 
293
 
WPA implements a new key handshake (4-Way Handshake and Group Key
294
 
Handshake) for generating and exchanging data encryption keys between
295
 
the Authenticator and Supplicant. This handshake is also used to
296
 
verify that both Authenticator and Supplicant know the master session
297
 
key. These handshakes are identical regardless of the selected key
298
 
management mechanism (only the method for generating master session
299
 
key changes).
300
 
 
301
 
 
302
 
 
303
 
IEEE 802.11i / WPA2
304
 
-------------------
305
 
 
306
 
The design for parts of IEEE 802.11i that were not included in WPA has
307
 
finished (May 2004) and this amendment to IEEE 802.11 was approved in
308
 
June 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new
309
 
version of WPA called WPA2. This includes, e.g., support for more
310
 
robust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC)
311
 
to replace TKIP and optimizations for handoff (reduced number of
312
 
messages in initial key handshake, pre-authentication, and PMKSA caching).
313
 
 
314
 
 
315
 
 
316
 
wpa_supplicant
317
 
--------------
318
 
 
319
 
wpa_supplicant is an implementation of the WPA Supplicant component,
320
 
i.e., the part that runs in the client stations. It implements WPA key
321
 
negotiation with a WPA Authenticator and EAP authentication with
322
 
Authentication Server. In addition, it controls the roaming and IEEE
323
 
802.11 authentication/association of the wlan driver.
324
 
 
325
 
wpa_supplicant is designed to be a "daemon" program that runs in the
326
 
background and acts as the backend component controlling the wireless
327
 
connection. wpa_supplicant supports separate frontend programs and an
328
 
example text-based frontend, wpa_cli, is included with wpa_supplicant.
329
 
 
330
 
Following steps are used when associating with an AP using WPA:
331
 
 
332
 
- wpa_supplicant requests the kernel driver to scan neighboring BSSes
333
 
- wpa_supplicant selects a BSS based on its configuration
334
 
- wpa_supplicant requests the kernel driver to associate with the chosen
335
 
  BSS
336
 
- If WPA-EAP: integrated IEEE 802.1X Supplicant completes EAP
337
 
  authentication with the authentication server (proxied by the
338
 
  Authenticator in the AP)
339
 
- If WPA-EAP: master key is received from the IEEE 802.1X Supplicant
340
 
- If WPA-PSK: wpa_supplicant uses PSK as the master session key
341
 
- wpa_supplicant completes WPA 4-Way Handshake and Group Key Handshake
342
 
  with the Authenticator (AP)
343
 
- wpa_supplicant configures encryption keys for unicast and broadcast
344
 
- normal data packets can be transmitted and received
345
 
 
346
 
 
347
 
 
348
 
Building and installing
349
 
-----------------------
350
 
 
351
 
In order to be able to build wpa_supplicant, you will first need to
352
 
select which parts of it will be included. This is done by creating a
353
 
build time configuration file, .config, in the wpa_supplicant root
354
 
directory. Configuration options are text lines using following
355
 
format: CONFIG_<option>=y. Lines starting with # are considered
356
 
comments and are ignored. See defconfig file for an example configuration
357
 
and a list of available options and additional notes.
358
 
 
359
 
The build time configuration can be used to select only the needed
360
 
features and limit the binary size and requirements for external
361
 
libraries. The main configuration parts are the selection of which
362
 
driver interfaces (e.g., hostap, madwifi, ..) and which authentication
363
 
methods (e.g., EAP-TLS, EAP-PEAP, ..) are included.
364
 
 
365
 
Following build time configuration options are used to control IEEE
366
 
802.1X/EAPOL and EAP state machines and all EAP methods. Including
367
 
TLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSL
368
 
library for TLS implementation. Alternatively, GnuTLS or the internal
369
 
TLSv1 implementation can be used for TLS functionaly.
370
 
 
371
 
CONFIG_IEEE8021X_EAPOL=y
372
 
CONFIG_EAP_MD5=y
373
 
CONFIG_EAP_MSCHAPV2=y
374
 
CONFIG_EAP_TLS=y
375
 
CONFIG_EAP_PEAP=y
376
 
CONFIG_EAP_TTLS=y
377
 
CONFIG_EAP_GTC=y
378
 
CONFIG_EAP_OTP=y
379
 
CONFIG_EAP_SIM=y
380
 
CONFIG_EAP_AKA=y
381
 
CONFIG_EAP_PSK=y
382
 
CONFIG_EAP_SAKE=y
383
 
CONFIG_EAP_GPSK=y
384
 
CONFIG_EAP_PAX=y
385
 
CONFIG_EAP_LEAP=y
386
 
 
387
 
Following option can be used to include GSM SIM/USIM interface for GSM/UMTS
388
 
authentication algorithm (for EAP-SIM/EAP-AKA). This requires pcsc-lite
389
 
(http://www.linuxnet.com/) for smart card access.
390
 
 
391
 
CONFIG_PCSC=y
392
 
 
393
 
Following options can be added to .config to select which driver
394
 
interfaces are included. Hermes driver interface needs to be downloaded
395
 
from Agere (see above). CONFIG_WIRELESS_EXTENSION will be used
396
 
automatically if any of the selected drivers need it.
397
 
 
398
 
CONFIG_WIRELESS_EXTENSION=y
399
 
CONFIG_DRIVER_HOSTAP=y
400
 
CONFIG_DRIVER_HERMES=y
401
 
CONFIG_DRIVER_MADWIFI=y
402
 
CONFIG_DRIVER_ATMEL=y
403
 
CONFIG_DRIVER_WEXT=y
404
 
CONFIG_DRIVER_RALINK=y
405
 
CONFIG_DRIVER_NDISWRAPPER=y
406
 
CONFIG_DRIVER_BROADCOM=y
407
 
CONFIG_DRIVER_IPW=y
408
 
CONFIG_DRIVER_BSD=y
409
 
CONFIG_DRIVER_NDIS=y
410
 
 
411
 
Following example includes all features and driver interfaces that are
412
 
included in the wpa_supplicant package:
413
 
 
414
 
CONFIG_DRIVER_HOSTAP=y
415
 
CONFIG_DRIVER_HERMES=y
416
 
CONFIG_DRIVER_MADWIFI=y
417
 
CONFIG_DRIVER_ATMEL=y
418
 
CONFIG_DRIVER_WEXT=y
419
 
CONFIG_DRIVER_NDISWRAPPER=y
420
 
CONFIG_DRIVER_BROADCOM=y
421
 
CONFIG_DRIVER_IPW=y
422
 
CONFIG_DRIVER_BSD=y
423
 
CONFIG_DRIVER_NDIS=y
424
 
CONFIG_WIRELESS_EXTENSION=y
425
 
CONFIG_IEEE8021X_EAPOL=y
426
 
CONFIG_EAP_MD5=y
427
 
CONFIG_EAP_MSCHAPV2=y
428
 
CONFIG_EAP_TLS=y
429
 
CONFIG_EAP_PEAP=y
430
 
CONFIG_EAP_TTLS=y
431
 
CONFIG_EAP_GTC=y
432
 
CONFIG_EAP_OTP=y
433
 
CONFIG_EAP_SIM=y
434
 
CONFIG_EAP_AKA=y
435
 
CONFIG_EAP_PSK=y
436
 
CONFIG_EAP_SAKE=y
437
 
CONFIG_EAP_GPSK=y
438
 
CONFIG_EAP_PAX=y
439
 
CONFIG_EAP_LEAP=y
440
 
CONFIG_PCSC=y
441
 
 
442
 
EAP-PEAP and EAP-TTLS will automatically include configured EAP
443
 
methods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection.
444
 
 
445
 
 
446
 
After you have created a configuration file, you can build
447
 
wpa_supplicant and wpa_cli with 'make' command. You may then install
448
 
the binaries to a suitable system directory, e.g., /usr/local/bin.
449
 
 
450
 
Example commands:
451
 
 
452
 
# build wpa_supplicant and wpa_cli
453
 
make
454
 
# install binaries (this may need root privileges)
455
 
cp wpa_cli wpa_supplicant /usr/local/bin
456
 
 
457
 
 
458
 
You will need to make a configuration file, e.g.,
459
 
/etc/wpa_supplicant.conf, with network configuration for the networks
460
 
you are going to use. Configuration file section below includes
461
 
explanation fo the configuration file format and includes various
462
 
examples. Once the configuration is ready, you can test whether the
463
 
configuration work by first running wpa_supplicant with following
464
 
command to start it on foreground with debugging enabled:
465
 
 
466
 
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
467
 
 
468
 
Assuming everything goes fine, you can start using following command
469
 
to start wpa_supplicant on background without debugging:
470
 
 
471
 
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
472
 
 
473
 
Please note that if you included more than one driver interface in the
474
 
build time configuration (.config), you may need to specify which
475
 
interface to use by including -D<driver name> option on the command
476
 
line. See following section for more details on command line options
477
 
for wpa_supplicant.
478
 
 
479
 
 
480
 
 
481
 
Command line options
482
 
--------------------
483
 
 
484
 
usage:
485
 
  wpa_supplicant [-BddhKLqqtuvwW] [-P<pid file>] [-g<global ctrl>] \
486
 
        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
487
 
        [-b<br_ifname> [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
488
 
        [-p<driver_param>] [-b<br_ifname>] ...]
489
 
 
490
 
options:
491
 
  -b = optional bridge interface name
492
 
  -B = run daemon in the background
493
 
  -c = Configuration file
494
 
  -C = ctrl_interface parameter (only used if -c is not)
495
 
  -i = interface name
496
 
  -d = increase debugging verbosity (-dd even more)
497
 
  -D = driver name
498
 
  -g = global ctrl_interface
499
 
  -K = include keys (passwords, etc.) in debug output
500
 
  -t = include timestamp in debug messages
501
 
  -h = show this help text
502
 
  -L = show license (GPL and BSD)
503
 
  -p = driver parameters
504
 
  -P = PID file
505
 
  -q = decrease debugging verbosity (-qq even less)
506
 
  -u = enable DBus control interface
507
 
  -v = show version
508
 
  -w = wait for interface to be added, if needed
509
 
  -W = wait for a control interface monitor before starting
510
 
  -N = start describing new interface
511
 
 
512
 
drivers:
513
 
  hostap = Host AP driver (Intersil Prism2/2.5/3) [default]
514
 
        (this can also be used with Linuxant DriverLoader)
515
 
  hermes = Agere Systems Inc. driver (Hermes-I/Hermes-II)
516
 
  madwifi = MADWIFI 802.11 support (Atheros, etc.)
517
 
  atmel = ATMEL AT76C5XXx (USB, PCMCIA)
518
 
  wext = Linux wireless extensions (generic)
519
 
  ralink = Ralink Client driver
520
 
  ndiswrapper = Linux ndiswrapper
521
 
  broadcom = Broadcom wl.o driver
522
 
  ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer)
523
 
  wired = wpa_supplicant wired Ethernet driver
524
 
  bsd = BSD 802.11 support (Atheros, etc.)
525
 
  ndis = Windows NDIS driver
526
 
 
527
 
In most common cases, wpa_supplicant is started with
528
 
 
529
 
wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0
530
 
 
531
 
This makes the process fork into background and wait for the wlan0
532
 
interface if it is not available at startup time.
533
 
 
534
 
The easiest way to debug problems, and to get debug log for bug
535
 
reports, is to start wpa_supplicant on foreground with debugging
536
 
enabled:
537
 
 
538
 
wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
539
 
 
540
 
 
541
 
wpa_supplicant can control multiple interfaces (radios) either by
542
 
running one process for each interface separately or by running just
543
 
one process and list of options at command line. Each interface is
544
 
separated with -N argument. As an example, following command would
545
 
start wpa_supplicant for two interfaces:
546
 
 
547
 
wpa_supplicant \
548
 
        -c wpa1.conf -i wlan0 -D hostap -N \
549
 
        -c wpa2.conf -i ath0 -D madwifi
550
 
 
551
 
 
552
 
If the interface is added in a Linux bridge (e.g., br0), the bridge
553
 
interface needs to be configured to wpa_supplicant in addition to the
554
 
main interface:
555
 
 
556
 
wpa_supplicant -cw.conf -Dmadwifi -iath0 -bbr0
557
 
 
558
 
 
559
 
Configuration file
560
 
------------------
561
 
 
562
 
wpa_supplicant is configured using a text file that lists all accepted
563
 
networks and security policies, including pre-shared keys. See
564
 
example configuration file, wpa_supplicant.conf, for detailed
565
 
information about the configuration format and supported fields.
566
 
 
567
 
Changes to configuration file can be reloaded be sending SIGHUP signal
568
 
to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly,
569
 
reloading can be triggered with 'wpa_cli reconfigure' command.
570
 
 
571
 
Configuration file can include one or more network blocks, e.g., one
572
 
for each used SSID. wpa_supplicant will automatically select the best
573
 
betwork based on the order of network blocks in the configuration
574
 
file, network security level (WPA/WPA2 is preferred), and signal
575
 
strength.
576
 
 
577
 
Example configuration files for some common configurations:
578
 
 
579
 
1) WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work
580
 
   network
581
 
 
582
 
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
583
 
ctrl_interface=/var/run/wpa_supplicant
584
 
ctrl_interface_group=wheel
585
 
#
586
 
# home network; allow all valid ciphers
587
 
network={
588
 
        ssid="home"
589
 
        scan_ssid=1
590
 
        key_mgmt=WPA-PSK
591
 
        psk="very secret passphrase"
592
 
}
593
 
#
594
 
# work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers
595
 
network={
596
 
        ssid="work"
597
 
        scan_ssid=1
598
 
        key_mgmt=WPA-EAP
599
 
        pairwise=CCMP TKIP
600
 
        group=CCMP TKIP
601
 
        eap=TLS
602
 
        identity="user@example.com"
603
 
        ca_cert="/etc/cert/ca.pem"
604
 
        client_cert="/etc/cert/user.pem"
605
 
        private_key="/etc/cert/user.prv"
606
 
        private_key_passwd="password"
607
 
}
608
 
 
609
 
 
610
 
2) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel
611
 
   (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series)
612
 
 
613
 
ctrl_interface=/var/run/wpa_supplicant
614
 
ctrl_interface_group=wheel
615
 
network={
616
 
        ssid="example"
617
 
        scan_ssid=1
618
 
        key_mgmt=WPA-EAP
619
 
        eap=PEAP
620
 
        identity="user@example.com"
621
 
        password="foobar"
622
 
        ca_cert="/etc/cert/ca.pem"
623
 
        phase1="peaplabel=0"
624
 
        phase2="auth=MSCHAPV2"
625
 
}
626
 
 
627
 
 
628
 
3) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
629
 
   unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
630
 
 
631
 
ctrl_interface=/var/run/wpa_supplicant
632
 
ctrl_interface_group=wheel
633
 
network={
634
 
        ssid="example"
635
 
        scan_ssid=1
636
 
        key_mgmt=WPA-EAP
637
 
        eap=TTLS
638
 
        identity="user@example.com"
639
 
        anonymous_identity="anonymous@example.com"
640
 
        password="foobar"
641
 
        ca_cert="/etc/cert/ca.pem"
642
 
        phase2="auth=MD5"
643
 
}
644
 
 
645
 
 
646
 
4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and
647
 
   broadcast); use EAP-TLS for authentication
648
 
 
649
 
ctrl_interface=/var/run/wpa_supplicant
650
 
ctrl_interface_group=wheel
651
 
network={
652
 
        ssid="1x-test"
653
 
        scan_ssid=1
654
 
        key_mgmt=IEEE8021X
655
 
        eap=TLS
656
 
        identity="user@example.com"
657
 
        ca_cert="/etc/cert/ca.pem"
658
 
        client_cert="/etc/cert/user.pem"
659
 
        private_key="/etc/cert/user.prv"
660
 
        private_key_passwd="password"
661
 
        eapol_flags=3
662
 
}
663
 
 
664
 
 
665
 
5) Catch all example that allows more or less all configuration modes. The
666
 
   configuration options are used based on what security policy is used in the
667
 
   selected SSID. This is mostly for testing and is not recommended for normal
668
 
   use.
669
 
 
670
 
ctrl_interface=/var/run/wpa_supplicant
671
 
ctrl_interface_group=wheel
672
 
network={
673
 
        ssid="example"
674
 
        scan_ssid=1
675
 
        key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
676
 
        pairwise=CCMP TKIP
677
 
        group=CCMP TKIP WEP104 WEP40
678
 
        psk="very secret passphrase"
679
 
        eap=TTLS PEAP TLS
680
 
        identity="user@example.com"
681
 
        password="foobar"
682
 
        ca_cert="/etc/cert/ca.pem"
683
 
        client_cert="/etc/cert/user.pem"
684
 
        private_key="/etc/cert/user.prv"
685
 
        private_key_passwd="password"
686
 
        phase1="peaplabel=0"
687
 
        ca_cert2="/etc/cert/ca2.pem"
688
 
        client_cert2="/etc/cer/user.pem"
689
 
        private_key2="/etc/cer/user.prv"
690
 
        private_key2_passwd="password"
691
 
}
692
 
 
693
 
 
694
 
6) Authentication for wired Ethernet. This can be used with 'wired' interface
695
 
   (-Dwired on command line).
696
 
 
697
 
ctrl_interface=/var/run/wpa_supplicant
698
 
ctrl_interface_group=wheel
699
 
ap_scan=0
700
 
network={
701
 
        key_mgmt=IEEE8021X
702
 
        eap=MD5
703
 
        identity="user"
704
 
        password="password"
705
 
        eapol_flags=0
706
 
}
707
 
 
708
 
 
709
 
 
710
 
Certificates
711
 
------------
712
 
 
713
 
Some EAP authentication methods require use of certificates. EAP-TLS
714
 
uses both server side and client certificates whereas EAP-PEAP and
715
 
EAP-TTLS only require the server side certificate. When client
716
 
certificate is used, a matching private key file has to also be
717
 
included in configuration. If the private key uses a passphrase, this
718
 
has to be configured in wpa_supplicant.conf ("private_key_passwd").
719
 
 
720
 
wpa_supplicant supports X.509 certificates in PEM and DER
721
 
formats. User certificate and private key can be included in the same
722
 
file.
723
 
 
724
 
If the user certificate and private key is received in PKCS#12/PFX
725
 
format, they need to be converted to suitable PEM/DER format for
726
 
wpa_supplicant. This can be done, e.g., with following commands:
727
 
 
728
 
# convert client certificate and private key to PEM format
729
 
openssl pkcs12 -in example.pfx -out user.pem -clcerts
730
 
# convert CA certificate (if included in PFX file) to PEM format
731
 
openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
732
 
 
733
 
 
734
 
 
735
 
wpa_cli
736
 
-------
737
 
 
738
 
wpa_cli is a text-based frontend program for interacting with
739
 
wpa_supplicant. It is used to query current status, change
740
 
configuration, trigger events, and request interactive user input.
741
 
 
742
 
wpa_cli can show the current authentication status, selected security
743
 
mode, dot11 and dot1x MIBs, etc. In addition, it can configure some
744
 
variables like EAPOL state machine parameters and trigger events like
745
 
reassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user
746
 
interface to request authentication information, like username and
747
 
password, if these are not included in the configuration. This can be
748
 
used to implement, e.g., one-time-passwords or generic token card
749
 
authentication where the authentication is based on a
750
 
challenge-response that uses an external device for generating the
751
 
response.
752
 
 
753
 
The control interface of wpa_supplicant can be configured to allow
754
 
non-root user access (ctrl_interface_group in the configuration
755
 
file). This makes it possible to run wpa_cli with a normal user
756
 
account.
757
 
 
758
 
wpa_cli supports two modes: interactive and command line. Both modes
759
 
share the same command set and the main difference is in interactive
760
 
mode providing access to unsolicited messages (event messages,
761
 
username/password requests).
762
 
 
763
 
Interactive mode is started when wpa_cli is executed without including
764
 
the command as a command line parameter. Commands are then entered on
765
 
the wpa_cli prompt. In command line mode, the same commands are
766
 
entered as command line arguments for wpa_cli.
767
 
 
768
 
 
769
 
Interactive authentication parameters request
770
 
 
771
 
When wpa_supplicant need authentication parameters, like username and
772
 
password, which are not present in the configuration file, it sends a
773
 
request message to all attached frontend programs, e.g., wpa_cli in
774
 
interactive mode. wpa_cli shows these requests with
775
 
"CTRL-REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or
776
 
OTP (one-time-password). <id> is a unique identifier for the current
777
 
network. <text> is description of the request. In case of OTP request,
778
 
it includes the challenge from the authentication server.
779
 
 
780
 
The reply to these requests can be given with 'identity', 'password',
781
 
and 'otp' commands. <id> needs to be copied from the the matching
782
 
request. 'password' and 'otp' commands can be used regardless of
783
 
whether the request was for PASSWORD or OTP. The main difference
784
 
between these two commands is that values given with 'password' are
785
 
remembered as long as wpa_supplicant is running whereas values given
786
 
with 'otp' are used only once and then forgotten, i.e., wpa_supplicant
787
 
will ask frontend for a new value for every use. This can be used to
788
 
implement one-time-password lists and generic token card -based
789
 
authentication.
790
 
 
791
 
Example request for password and a matching reply:
792
 
 
793
 
CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
794
 
> password 1 mysecretpassword
795
 
 
796
 
Example request for generic token card challenge-response:
797
 
 
798
 
CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
799
 
> otp 2 9876
800
 
 
801
 
 
802
 
wpa_cli commands
803
 
 
804
 
  status = get current WPA/EAPOL/EAP status
805
 
  mib = get MIB variables (dot1x, dot11)
806
 
  help = show this usage help
807
 
  interface [ifname] = show interfaces/select interface
808
 
  level <debug level> = change debug level
809
 
  license = show full wpa_cli license
810
 
  logoff = IEEE 802.1X EAPOL state machine logoff
811
 
  logon = IEEE 802.1X EAPOL state machine logon
812
 
  set = set variables (shows list of variables when run without arguments)
813
 
  pmksa = show PMKSA cache
814
 
  reassociate = force reassociation
815
 
  reconfigure = force wpa_supplicant to re-read its configuration file
816
 
  preauthenticate <BSSID> = force preauthentication
817
 
  identity <network id> <identity> = configure identity for an SSID
818
 
  password <network id> <password> = configure password for an SSID
819
 
  pin <network id> <pin> = configure pin for an SSID
820
 
  otp <network id> <password> = configure one-time-password for an SSID
821
 
  passphrase <network id> <passphrase> = configure private key passphrase
822
 
    for an SSID
823
 
  bssid <network id> <BSSID> = set preferred BSSID for an SSID
824
 
  list_networks = list configured networks
825
 
  select_network <network id> = select a network (disable others)
826
 
  enable_network <network id> = enable a network
827
 
  disable_network <network id> = disable a network
828
 
  add_network = add a network
829
 
  remove_network <network id> = remove a network
830
 
  set_network <network id> <variable> <value> = set network variables (shows
831
 
    list of variables when run without arguments)
832
 
  get_network <network id> <variable> = get network variables
833
 
  save_config = save the current configuration
834
 
  disconnect = disconnect and wait for reassociate command before connecting
835
 
  scan = request new BSS scan
836
 
  scan_results = get latest scan results
837
 
  get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = get capabilies
838
 
  terminate = terminate wpa_supplicant
839
 
  quit = exit wpa_cli
840
 
 
841
 
 
842
 
wpa_cli command line options
843
 
 
844
 
wpa_cli [-p<path to ctrl sockets>] [-i<ifname>] [-hvB] [-a<action file>] \
845
 
        [-P<pid file>] [-g<global ctrl>]  [command..]
846
 
  -h = help (show this usage text)
847
 
  -v = shown version information
848
 
  -a = run in daemon mode executing the action file based on events from
849
 
       wpa_supplicant
850
 
  -B = run a daemon in the background
851
 
  default path: /var/run/wpa_supplicant
852
 
  default interface: first interface found in socket path
853
 
 
854
 
 
855
 
Using wpa_cli to run external program on connect/disconnect
856
 
-----------------------------------------------------------
857
 
 
858
 
wpa_cli can used to run external programs whenever wpa_supplicant
859
 
connects or disconnects from a network. This can be used, e.g., to
860
 
update network configuration and/or trigget DHCP client to update IP
861
 
addresses, etc.
862
 
 
863
 
One wpa_cli process in "action" mode needs to be started for each
864
 
interface. For example, the following command starts wpa_cli for the
865
 
default ingterface (-i can be used to select the interface in case of
866
 
more than one interface being used at the same time):
867
 
 
868
 
wpa_cli -a/sbin/wpa_action.sh -B
869
 
 
870
 
The action file (-a option, /sbin/wpa_action.sh in this example) will
871
 
be executed whenever wpa_supplicant completes authentication (connect
872
 
event) or detects disconnection). The action script will be called
873
 
with two command line arguments: interface name and event (CONNECTED
874
 
or DISCONNECTED). If the action script needs to get more information
875
 
about the current network, it can use 'wpa_cli status' to query
876
 
wpa_supplicant for more information.
877
 
 
878
 
Following example can be used as a simple template for an action
879
 
script:
880
 
 
881
 
#!/bin/sh
882
 
 
883
 
IFNAME=$1
884
 
CMD=$2
885
 
 
886
 
if [ "$CMD" == "CONNECTED" ]; then
887
 
    SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=`
888
 
    # configure network, signal DHCP client, etc.
889
 
fi
890
 
 
891
 
if [ "$CMD" == "DISCONNECTED" ]; then
892
 
    # remove network configuration, if needed
893
 
fi
894
 
 
895
 
 
896
 
 
897
 
Integrating with pcmcia-cs/cardmgr scripts
898
 
------------------------------------------
899
 
 
900
 
wpa_supplicant needs to be running when using a wireless network with
901
 
WPA. It can be started either from system startup scripts or from
902
 
pcmcia-cs/cardmgr scripts (when using PC Cards). WPA handshake must be
903
 
completed before data frames can be exchanged, so wpa_supplicant
904
 
should be started before DHCP client.
905
 
 
906
 
Command line option '-w' can be used if wpa_supplicant is started
907
 
before the wireless LAN interface is present (e.g., before inserting
908
 
the PC Card) or is not yet up.
909
 
 
910
 
For example, following small changes to pcmcia-cs scripts can be used
911
 
to enable WPA support:
912
 
 
913
 
Add MODE="Managed" and WPA="y" to the network scheme in
914
 
/etc/pcmcia/wireless.opts.
915
 
 
916
 
Add the following block to the end of 'start' action handler in
917
 
/etc/pcmcia/wireless:
918
 
 
919
 
    if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
920
 
        /usr/local/bin/wpa_supplicant -Bw -c/etc/wpa_supplicant.conf \
921
 
                -i$DEVICE
922
 
    fi
923
 
 
924
 
Add the following block to the end of 'stop' action handler (may need
925
 
to be separated from other actions) in /etc/pcmcia/wireless:
926
 
 
927
 
    if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
928
 
        killall wpa_supplicant
929
 
    fi
930
 
 
931
 
This will make cardmgr start wpa_supplicant when the card is plugged
932
 
in. wpa_supplicant will wait until the interface is set up--either
933
 
when a static IP address is configured or when DHCP client is
934
 
started--and will then negotiate keys with the AP.
935
 
 
936
 
 
937
 
 
938
 
Dynamic interface add and operation without configuration files
939
 
---------------------------------------------------------------
940
 
 
941
 
wpa_supplicant can be started without any configuration files or
942
 
network interfaces. When used in this way, a global (i.e., per
943
 
wpa_supplicant process) control interface is used to add and remove
944
 
network interfaces. Each network interface can then be configured
945
 
through a per-network interface control interface. For example,
946
 
following commands show how to start wpa_supplicant without any
947
 
network interfaces and then add a network interface and configure a
948
 
network (SSID):
949
 
 
950
 
# Start wpa_supplicant in the background
951
 
wpa_supplicant -g/var/run/wpa_supplicant-global -B
952
 
 
953
 
# Add a new interface (wlan0, no configuration file, driver=wext, and
954
 
# enable control interface)
955
 
wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan0 \
956
 
        "" wext /var/run/wpa_supplicant
957
 
 
958
 
# Configure a network using the newly added network interface:
959
 
wpa_cli -iwlan0 add_network
960
 
wpa_cli -iwlan0 set_network 0 ssid '"test"'
961
 
wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK
962
 
wpa_cli -iwlan0 set_network 0 psk '"12345678"'
963
 
wpa_cli -iwlan0 set_network 0 pairwise TKIP
964
 
wpa_cli -iwlan0 set_network 0 group TKIP
965
 
wpa_cli -iwlan0 set_network 0 proto WPA
966
 
wpa_cli -iwlan0 enable_network 0
967
 
 
968
 
# At this point, the new network interface should start trying to associate
969
 
# with the WPA-PSK network using SSID test.
970
 
 
971
 
# Remove network interface
972
 
wpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0