1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
5 <refentrytitle>wpa_supplicant</refentrytitle>
6 <manvolnum>8</manvolnum>
9 <refname>wpa_supplicant</refname>
10 <refpurpose>Wi-Fi Protected Access client and IEEE 802.1X supplicant</refpurpose>
14 <command>wpa_supplicant</command>
15 <arg>-BddehLqqvw</arg>
16 <arg>-i<replaceable>ifname</replaceable></arg>
17 <arg>-c<replaceable>config file</replaceable></arg>
18 <arg>-D<replaceable>driver</replaceable></arg>
22 <title>Overview</title>
25 Wireless networks do not require physical access to the network equipment
26 in the same way as wired networks. This makes it easier for unauthorized
27 users to passively monitor a network and capture all transmitted frames.
28 In addition, unauthorized use of the network is much easier. In many cases,
29 this can happen even without user's explicit knowledge since the wireless
30 LAN adapter may have been configured to automatically join any available
35 Link-layer encryption can be used to provide a layer of security for
36 wireless networks. The original wireless LAN standard, IEEE 802.11,
37 included a simple encryption mechanism, WEP. However, that proved to
38 be flawed in many areas and network protected with WEP cannot be consider
39 secure. IEEE 802.1X authentication and frequently changed dynamic WEP keys
40 can be used to improve the network security, but even that has inherited
41 security issues due to the use of WEP for encryption. Wi-Fi Protected
42 Access and IEEE 802.11i amendment to the wireless LAN standard introduce
43 a much improvement mechanism for securing wireless networks. IEEE 802.11i
44 enabled networks that are using CCMP (encryption mechanism based on strong
45 cryptographic algorithm AES) can finally be called secure used for
46 applications which require efficient protection against unauthorized
50 <para><command>wpa_supplicant</command> is an implementation of
51 the WPA Supplicant component, i.e., the part that runs in the
52 client stations. It implements WPA key negotiation with a WPA
53 Authenticator and EAP authentication with Authentication
54 Server. In addition, it controls the roaming and IEEE 802.11
55 authentication/association of the wireless LAN driver.</para>
57 <para><command>wpa_supplicant</command> is designed to be a
58 "daemon" program that runs in the background and acts as the
59 backend component controlling the wireless
60 connection. <command>wpa_supplicant</command> supports separate
61 frontend programs and an example text-based frontend,
62 <command>wpa_cli</command>, is included with
63 wpa_supplicant.</para>
65 <para>Before wpa_supplicant can do its work, the network interface
66 must be available. That means that the physical device must be
67 present and enabled, and the driver for the device must have be
68 loaded. Note, however, that the '-w' option of the wpa_supplicant
69 daemon instructs the daemon to continue running and to wait for
70 the interface to become available. Without the '-w' option, the
71 daemon will exit immediately if the device is not already
74 <para>After <command>wpa_supplicant</command> has configured the
75 network device, higher level configuration such as DHCP may
76 proceed. There are a variety of ways to integrate wpa_supplicant
77 into a machine's networking scripts, a few of which are described
78 in sections below.</para>
80 <para>The following steps are used when associating with an AP
85 <para><command>wpa_supplicant</command> requests the kernel
86 driver to scan neighboring BSSes</para>
90 <para><command>wpa_supplicant</command> selects a BSS based on
91 its configuration</para>
95 <para><command>wpa_supplicant</command> requests the kernel
96 driver to associate with the chosen BSS</para>
100 <para>If WPA-EAP: integrated IEEE 802.1X Supplicant or
101 external Xsupplicant completes EAP authentication with the
102 authentication server (proxied by the Authenticator in the
107 <para>If WPA-EAP: master key is received from the IEEE 802.1X
112 <para>If WPA-PSK: <command>wpa_supplicant</command> uses PSK
113 as the master session key</para>
117 <para><command>wpa_supplicant</command> completes WPA 4-Way
118 Handshake and Group Key Handshake with the Authenticator
123 <para><command>wpa_supplicant</command> configures encryption
124 keys for unicast and broadcast</para>
128 <para>normal data packets can be transmitted and received</para>
134 <title>Supported Features</title>
135 <para>Supported WPA/IEEE 802.11i features:</para>
138 <para>WPA-PSK ("WPA-Personal")</para>
142 <para>WPA with EAP (e.g., with RADIUS authentication server)
143 ("WPA-Enterprise") Following authentication methods are
144 supported with an integrate IEEE 802.1X Supplicant:</para>
154 <para>EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)</para>
159 <para>EAP-PEAP/TLS (both PEAPv0 and PEAPv1)</para>
163 <para>EAP-PEAP/GTC (both PEAPv0 and PEAPv1)</para>
167 <para>EAP-PEAP/OTP (both PEAPv0 and PEAPv1)</para>
171 <para>EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)</para>
175 <para>EAP-TTLS/EAP-MD5-Challenge</para>
179 <para>EAP-TTLS/EAP-GTC</para>
182 <listitem><para>EAP-TTLS/EAP-OTP</para></listitem>
184 <listitem><para>EAP-TTLS/EAP-MSCHAPv2</para></listitem>
186 <listitem><para>EAP-TTLS/EAP-TLS</para></listitem>
188 <listitem><para>EAP-TTLS/MSCHAPv2</para></listitem>
190 <listitem><para>EAP-TTLS/MSCHAP</para></listitem>
192 <listitem><para>EAP-TTLS/PAP</para></listitem>
194 <listitem><para>EAP-TTLS/CHAP</para></listitem>
196 <listitem><para>EAP-SIM</para></listitem>
198 <listitem><para>EAP-AKA</para></listitem>
200 <listitem><para>EAP-PSK</para></listitem>
202 <listitem><para>EAP-PAX</para></listitem>
204 <listitem><para>LEAP (note: requires special support from
205 the driver for IEEE 802.11 authentication)</para></listitem>
207 <listitem><para>(following methods are supported, but since
208 they do not generate keying material, they cannot be used
209 with WPA or IEEE 802.1X WEP keying)</para></listitem>
211 <listitem><para>EAP-MD5-Challenge </para></listitem>
213 <listitem><para>EAP-MSCHAPv2</para></listitem>
215 <listitem><para>EAP-GTC</para></listitem>
217 <listitem><para>EAP-OTP</para></listitem>
222 <para>key management for CCMP, TKIP, WEP104, WEP40</para>
226 <para>RSN/WPA2 (IEEE 802.11i)</para>
229 <para>pre-authentication</para>
233 <para>PMKSA caching</para>
241 <title>Available Drivers</title>
242 <para>The available drivers to specify with the -D option are:</para>
248 <para>(default) Host AP driver (Intersil Prism2/2.5/3).
249 (this can also be used with Linuxant DriverLoader).</para>
256 <para>Agere Systems Inc. driver (Hermes-I/Hermes-II).</para>
263 <para>MADWIFI 802.11 support (Atheros, etc.).</para>
270 <para>ATMEL AT76C5XXx (USB, PCMCIA).</para>
277 <para>Linux wireless extensions (generic).</para>
282 <term>ndiswrapper</term>
284 <para>Linux ndiswrapper.</para>
289 <term>broadcom</term>
291 <para>Broadcom wl.o driver.</para>
298 <para>Intel ipw2100/2200 driver.</para>
305 <para>wpa_supplicant wired Ethernet driver</para>
312 <para>BSD 802.11 support (Atheros, etc.).</para>
319 <para>Windows NDIS driver.</para>
326 <title>Command Line Options</title>
331 <para>Run daemon in the background.</para>
336 <term>-i ifname</term>
338 <para>Interface to listen on.</para>
343 <term>-c filename</term>
345 <para>Path to configuration file.</para>
350 <term>-D driver</term>
352 <para>Driver to use. See the available options below.</para>
359 <para>Increase debugging verbosity (-dd even more).</para>
366 <para>Include keys (passwords, etc.) in debug output.</para>
373 <para>Include timestamp in debug messages.</para>
380 <para>Use external IEEE 802.1X Supplicant (e.g.,
381 <command>xsupplicant</command>) (this disables the internal
389 <para>Help. Show a usage message.</para>
396 <para>Show license (GPL and BSD).</para>
403 <para>Decrease debugging verbosity (-qq even less).</para>
409 <para>Show version.</para>
416 <para>wait for interface to be added, if needed. normally,
417 <command>wpa_supplicant</command> will exit if the interface
418 is not there yet.</para>
425 <para>Start describing new interface.</para>
432 <title>Examples</title>
434 <para>In most common cases, <command>wpa_supplicant</command> is
437 <blockquote><programlisting>
438 wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0
439 </programlisting></blockquote>
441 <para>This makes the process fork into background and wait for the wlan0
442 interface if it is not available at startup time.</para>
444 <para>The easiest way to debug problems, and to get debug log for
445 bug reports, is to start <command>wpa_supplicant</command> on
446 foreground with debugging enabled:</para>
448 <blockquote><programlisting>
449 wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
450 </programlisting></blockquote>
452 <para><command>wpa_supplicant</command> can control multiple
453 interfaces (radios) either by running one process for each
454 interface separately or by running just one process and list of
455 options at command line. Each interface is separated with -N
456 argument. As an example, following command would start
457 wpa_supplicant for two interfaces:</para>
459 <blockquote><programlisting>
461 -c wpa1.conf -i wlan0 -D hostap -N \
462 -c wpa2.conf -i ath0 -D madwifi
463 </programlisting></blockquote>
467 <title>OS Requirements</title>
468 <para>Current hardware/software requirements:</para>
472 <para>Linux kernel 2.4.x or 2.6.x with Linux Wireless
473 Extensions v15 or newer</para>
478 <para>FreeBSD 6-CURRENT</para>
482 <para>Microsoft Windows with WinPcap (at least WinXP, may work
483 with other versions)</para>
489 <title>Supported Drivers</title>
492 <term>Host AP driver for Prism2/2.5/3 (development
493 snapshot/v0.2.x)</term>
495 <para> (http://hostap.epitest.fi/) Driver needs to be set in
496 Managed mode ('iwconfig wlan0 mode managed'). Please note
497 that station firmware version needs to be 1.7.0 or newer to
498 work in WPA mode.</para>
503 <term>Linuxant DriverLoader</term>
505 <para>(http://www.linuxant.com/driverloader/)
506 with Windows NDIS driver for your wlan card supporting WPA.</para>
511 <term>Agere Systems Inc. Linux Driver</term>
513 <para> (http://www.agere.com/support/drivers/) Please note
514 that the driver interface file (driver_hermes.c) and hardware
515 specific include files are not included in the wpa_supplicant
516 distribution. You will need to copy these from the source
517 package of the Agere driver.</para>
522 <term>madwifi driver for cards based on Atheros chip set (ar521x)</term>
524 <para> (http://sourceforge.net/projects/madwifi/) Please
525 note that you will need to modify the wpa_supplicant .config
526 file to use the correct path for the madwifi driver root
527 directory (CFLAGS += -I../madwifi/wpa line in example
533 <term>ATMEL AT76C5XXx driver for USB and PCMCIA cards</term>
535 <para> (http://atmelwlandriver.sourceforge.net/).</para>
540 <term>Linux ndiswrapper</term>
542 <para> (http://ndiswrapper.sourceforge.net/) with Windows
548 <term>Broadcom wl.o driver</term>
550 <para> This is a generic Linux driver for Broadcom IEEE
551 802.11a/g cards. However, it is proprietary driver that is
552 not publicly available except for couple of exceptions, mainly
553 Broadcom-based APs/wireless routers that use Linux. The driver
554 binary can be downloaded, e.g., from Linksys support site
555 (http://www.linksys.com/support/gpl.asp) for Linksys
556 WRT54G. The GPL tarball includes cross-compiler and the needed
557 header file, wlioctl.h, for compiling wpa_supplicant. This
558 driver support in wpa_supplicant is expected to work also with
559 other devices based on Broadcom driver (assuming the driver
560 includes client mode support).</para>
565 <term> Intel ipw2100 driver</term>
567 <para> (http://sourceforge.net/projects/ipw2100/)</para>
572 <term>Intel ipw2200 driver</term>
574 <para> (http://sourceforge.net/projects/ipw2200/)</para>
579 <term>Linux wireless extensions</term>
581 <para>In theory, any driver that supports Linux wireless
582 extensions can be used with IEEE 802.1X (i.e., not WPA) when
583 using ap_scan=0 option in configuration file.</para>
588 <term>Wired Ethernet drivers</term>
590 <para>Use ap_scan=0.</para>
595 <term>BSD net80211 layer (e.g., Atheros driver)</term>
597 <para>At the moment, this is for FreeBSD 6-CURRENT branch.</para>
602 <term>Windows NDIS</term>
604 <para>The current Windows port requires WinPcap
605 (http://winpcap.polito.it/). See README-Windows.txt for more
612 <para>wpa_supplicant was designed to be portable for different
613 drivers and operating systems. Hopefully, support for more wlan
614 cards and OSes will be added in the future. See developer.txt for
615 more information about the design of wpa_supplicant and porting to
616 other drivers. One main goal is to add full WPA/WPA2 support to
617 Linux wireless extensions to allow new drivers to be supported
618 without having to implement new driver-specific interface code in
619 wpa_supplicant.</para>
623 <title>Architecture</title> <para>The
624 <command>wpa_supplicant</command> system consists of the following
629 <term><filename>wpa_supplicant.conf</filename> </term>
631 <para>the configuration file describing all networks that the
632 user wants the computer to connect to. </para>
636 <term><command>wpa_supplicant</command></term>
637 <listitem><para>the program that directly interacts with the
638 network interface. </para></listitem>
641 <term><command>wpa_cli</command></term> <listitem><para> the
642 client program that provides a high-level interface to the
643 functionality of the daemon. </para></listitem>
646 <term><command>wpa_passphrase</command></term>
647 <listitem><para>a utility needed to construct
648 <filename>wpa_supplicant.conf</filename> files that include
649 encrypted passwords.</para></listitem>
655 <title>Quick Start</title>
657 <para>First, make a configuration file, e.g.
658 <filename>/etc/wpa_supplicant.conf</filename>, that describes the networks
659 you are interested in. See <citerefentry>
660 <refentrytitle>wpa_supplicant</refentrytitle>
661 <manvolnum>5</manvolnum>
665 <para>Once the configuration is ready, you can test whether the
666 configuration works by running <command>wpa_supplicant</command>
667 with following command to start it on foreground with debugging
670 <blockquote><programlisting>
671 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
672 </programlisting></blockquote>
674 <para>Assuming everything goes fine, you can start using following
675 command to start <command>wpa_supplicant</command> on background
676 without debugging:</para>
678 <blockquote><programlisting>
679 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
680 </programlisting></blockquote>
682 <para>Please note that if you included more than one driver
683 interface in the build time configuration (.config), you may need
684 to specify which interface to use by including -D<driver
685 name> option on the command line.</para>
687 <!-- XXX at this point, the page could include a little script
688 based on wpa_cli to wait for a connection and then run
694 <title>Interface to pcmcia-cs/cardmrg</title>
696 <para>For example, following small changes to pcmcia-cs scripts
697 can be used to enable WPA support:</para>
699 <para>Add MODE="Managed" and WPA="y" to the network scheme in
700 <filename>/etc/pcmcia/wireless.opts</filename>.</para>
702 <para>Add the following block to the end of 'start' action handler
703 in <filename>/etc/pcmcia/wireless</filename>:</para>
705 <blockquote><programlisting>
706 if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
707 /usr/local/bin/wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -i$DEVICE
709 </programlisting></blockquote>
712 <para>Add the following block to the end of 'stop' action handler
713 (may need to be separated from other actions) in
714 <filename>/etc/pcmcia/wireless</filename>:</para>
716 <blockquote><programlisting>
717 if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
718 killall wpa_supplicant
720 </programlisting></blockquote>
722 <para>This will make <command>cardmgr</command> start
723 <command>wpa_supplicant</command> when the card is plugged
724 in. <command>wpa_supplicant</command> will wait until the
725 interface is set up--either when a static IP address is configured
726 or when DHCP client is started--and will then negotiate keys with
731 <title>See Also</title>
734 <refentrytitle>wpa_background</refentrytitle>
735 <manvolnum>8</manvolnum>
738 <refentrytitle>wpa_supplicant.conf</refentrytitle>
739 <manvolnum>5</manvolnum>
742 <refentrytitle>wpa_cli</refentrytitle>
743 <manvolnum>8</manvolnum>
746 <refentrytitle>wpa_passphrase</refentrytitle>
747 <manvolnum>8</manvolnum>
753 <para>wpa_supplicant is copyright (c) 2003-2005,
754 Jouni Malinen <email>jkmaline@cc.hut.fi</email> and
756 All Rights Reserved.</para>
758 <para>This program is dual-licensed under both the GPL version 2
759 and BSD license. Either license may be used at your option.</para>