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>-BddfhKLqqsTtuvW</arg>
16 <arg>-i<replaceable>ifname</replaceable></arg>
17 <arg>-c<replaceable>config file</replaceable></arg>
18 <arg>-D<replaceable>driver</replaceable></arg>
19 <arg>-P<replaceable>PID_file</replaceable></arg>
20 <arg>-f<replaceable>output file</replaceable></arg>
24 <title>Overview</title>
27 Wireless networks do not require physical access to the network equipment
28 in the same way as wired networks. This makes it easier for unauthorized
29 users to passively monitor a network and capture all transmitted frames.
30 In addition, unauthorized use of the network is much easier. In many cases,
31 this can happen even without user's explicit knowledge since the wireless
32 LAN adapter may have been configured to automatically join any available
37 Link-layer encryption can be used to provide a layer of security for
38 wireless networks. The original wireless LAN standard, IEEE 802.11,
39 included a simple encryption mechanism, WEP. However, that proved to
40 be flawed in many areas and network protected with WEP cannot be consider
41 secure. IEEE 802.1X authentication and frequently changed dynamic WEP keys
42 can be used to improve the network security, but even that has inherited
43 security issues due to the use of WEP for encryption. Wi-Fi Protected
44 Access and IEEE 802.11i amendment to the wireless LAN standard introduce
45 a much improvement mechanism for securing wireless networks. IEEE 802.11i
46 enabled networks that are using CCMP (encryption mechanism based on strong
47 cryptographic algorithm AES) can finally be called secure used for
48 applications which require efficient protection against unauthorized
52 <para><command>wpa_supplicant</command> is an implementation of
53 the WPA Supplicant component, i.e., the part that runs in the
54 client stations. It implements WPA key negotiation with a WPA
55 Authenticator and EAP authentication with Authentication
56 Server. In addition, it controls the roaming and IEEE 802.11
57 authentication/association of the wireless LAN driver.</para>
59 <para><command>wpa_supplicant</command> is designed to be a
60 "daemon" program that runs in the background and acts as the
61 backend component controlling the wireless
62 connection. <command>wpa_supplicant</command> supports separate
63 frontend programs and an example text-based frontend,
64 <command>wpa_cli</command>, is included with
65 wpa_supplicant.</para>
67 <para>Before wpa_supplicant can do its work, the network interface
68 must be available. That means that the physical device must be
69 present and enabled, and the driver for the device must be
70 loaded. The daemon will exit immediately if the device is not already
73 <para>After <command>wpa_supplicant</command> has configured the
74 network device, higher level configuration such as DHCP may
75 proceed. There are a variety of ways to integrate wpa_supplicant
76 into a machine's networking scripts, a few of which are described
77 in sections below.</para>
79 <para>The following steps are used when associating with an AP
84 <para><command>wpa_supplicant</command> requests the kernel
85 driver to scan neighboring BSSes</para>
89 <para><command>wpa_supplicant</command> selects a BSS based on
90 its configuration</para>
94 <para><command>wpa_supplicant</command> requests the kernel
95 driver to associate with the chosen BSS</para>
99 <para>If WPA-EAP: integrated IEEE 802.1X Supplicant
100 completes EAP authentication with the
101 authentication server (proxied by the Authenticator in the
106 <para>If WPA-EAP: master key is received from the IEEE 802.1X
111 <para>If WPA-PSK: <command>wpa_supplicant</command> uses PSK
112 as the master session key</para>
116 <para><command>wpa_supplicant</command> completes WPA 4-Way
117 Handshake and Group Key Handshake with the Authenticator
122 <para><command>wpa_supplicant</command> configures encryption
123 keys for unicast and broadcast</para>
127 <para>normal data packets can be transmitted and received</para>
133 <title>Supported Features</title>
134 <para>Supported WPA/IEEE 802.11i features:</para>
137 <para>WPA-PSK ("WPA-Personal")</para>
141 <para>WPA with EAP (e.g., with RADIUS authentication server)
142 ("WPA-Enterprise") Following authentication methods are
143 supported with an integrate IEEE 802.1X Supplicant:</para>
153 <para>EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)</para>
158 <para>EAP-PEAP/TLS (both PEAPv0 and PEAPv1)</para>
162 <para>EAP-PEAP/GTC (both PEAPv0 and PEAPv1)</para>
166 <para>EAP-PEAP/OTP (both PEAPv0 and PEAPv1)</para>
170 <para>EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)</para>
174 <para>EAP-TTLS/EAP-MD5-Challenge</para>
178 <para>EAP-TTLS/EAP-GTC</para>
181 <listitem><para>EAP-TTLS/EAP-OTP</para></listitem>
183 <listitem><para>EAP-TTLS/EAP-MSCHAPv2</para></listitem>
185 <listitem><para>EAP-TTLS/EAP-TLS</para></listitem>
187 <listitem><para>EAP-TTLS/MSCHAPv2</para></listitem>
189 <listitem><para>EAP-TTLS/MSCHAP</para></listitem>
191 <listitem><para>EAP-TTLS/PAP</para></listitem>
193 <listitem><para>EAP-TTLS/CHAP</para></listitem>
195 <listitem><para>EAP-SIM</para></listitem>
197 <listitem><para>EAP-AKA</para></listitem>
199 <listitem><para>EAP-PSK</para></listitem>
201 <listitem><para>EAP-PAX</para></listitem>
203 <listitem><para>LEAP (note: requires special support from
204 the driver for IEEE 802.11 authentication)</para></listitem>
206 <listitem><para>(following methods are supported, but since
207 they do not generate keying material, they cannot be used
208 with WPA or IEEE 802.1X WEP keying)</para></listitem>
210 <listitem><para>EAP-MD5-Challenge </para></listitem>
212 <listitem><para>EAP-MSCHAPv2</para></listitem>
214 <listitem><para>EAP-GTC</para></listitem>
216 <listitem><para>EAP-OTP</para></listitem>
221 <para>key management for CCMP, TKIP, WEP104, WEP40</para>
225 <para>RSN/WPA2 (IEEE 802.11i)</para>
228 <para>pre-authentication</para>
232 <para>PMKSA caching</para>
240 <title>Available Drivers</title>
241 <para>A summary of available driver backends is below. Support for each
242 of the driver backends is chosen at wpa_supplicant compile time. For a
243 list of supported driver backends that may be used with the -D option on
244 your system, refer to the help output of wpa_supplicant
245 (<emphasis>wpa_supplicant -h</emphasis>).</para>
251 <para>Linux wireless extensions (generic).</para>
258 <para>wpa_supplicant wired Ethernet driver</para>
263 <term>roboswitch</term>
265 <para>wpa_supplicant Broadcom switch driver</para>
272 <para>BSD 802.11 support (Atheros, etc.).</para>
279 <para>Windows NDIS driver.</para>
286 <title>Command Line Options</title>
287 <para>Most command line options have global scope. Some are given per
288 interface, and are only valid if at least one <option>-i</option> option
289 is specified, otherwise they're ignored. Option groups for different
290 interfaces must be separated by <option>-N</option> option.</para>
293 <term>-b br_ifname</term>
295 <para>Optional bridge interface name. (Per interface)</para>
302 <para>Run daemon in the background.</para>
307 <term>-c filename</term>
309 <para>Path to configuration file. (Per interface)</para>
314 <term>-C ctrl_interface</term>
316 <para>Path to ctrl_interface socket (Per interface. Only used if
317 <option>-c</option> is not).</para>
322 <term>-i ifname</term>
324 <para>Interface to listen on. Multiple instances of this option can
325 be present, one per interface, separated by <option>-N</option>
326 option (see below).</para>
333 <para>Increase debugging verbosity (<option>-dd</option> even
339 <term>-D driver</term>
341 <para>Driver to use (can be multiple drivers: nl80211,wext).
342 (Per interface, see the available options below.)</para>
347 <term>-e entropy file</term>
349 <para>File for <command>wpa_supplicant</command> to use to
350 maintain its internal entropy store in over restarts.</para>
355 <term>-f output file</term>
357 <para>Log output to specified file instead of stdout. (This
358 is only available if <command>wpa_supplicant</command> was
359 built with the <literal>CONFIG_DEBUG_FILE</literal>
365 <term>-g global ctrl_interface</term>
367 <para>Path to global ctrl_interface socket. If specified, interface
368 definitions may be omitted.</para>
375 <para>Include keys (passwords, etc.) in debug output.</para>
382 <para>Include timestamp in debug messages.</para>
389 <para>Help. Show a usage message.</para>
396 <para>Show license (BSD).</para>
401 <term>-o override driver</term>
403 <para>Override the driver parameter for new
409 <term>-O override ctrl_interface</term>
411 <para>Override the ctrl_interface parameter for new
419 <para>Driver parameters. (Per interface)</para>
424 <term>-P PID_file</term>
426 <para>Path to PID file.</para>
433 <para>Decrease debugging verbosity (<option>-qq</option> even
441 <para>Log output to syslog instead of stdout. (This is only
442 available if <command>wpa_supplicant</command> was built
443 with the <literal>CONFIG_DEBUG_SYSLOG</literal>
451 <para>Log output to Linux tracing in addition to any other
452 destinations. (This is only available
453 if <command>wpa_supplicant</command> was built with
454 the <literal>CONFIG_DEBUG_LINUX_TRACING</literal>
462 <para>Include timestamp in debug messages.</para>
469 <para>Enable DBus control interface. If enabled, interface
470 definitions may be omitted. (This is only available
471 if <command>wpa_supplicant</command> was built with
472 the <literal>CONFIG_DBUS</literal> option.)</para>
479 <para>Show version.</para>
486 <para>Wait for a control interface monitor before starting.</para>
493 <para>Start describing new interface.</para>
500 <title>Examples</title>
502 <para>In most common cases, <command>wpa_supplicant</command> is
505 <blockquote><programlisting>
506 wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
507 </programlisting></blockquote>
509 <para>This makes the process fork into background.</para>
511 <para>The easiest way to debug problems, and to get debug log for
512 bug reports, is to start <command>wpa_supplicant</command> on
513 foreground with debugging enabled:</para>
515 <blockquote><programlisting>
516 wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
517 </programlisting></blockquote>
519 <para>If the specific driver wrapper is not known beforehand, it is
520 possible to specify multiple comma separated driver wrappers on the command
521 line. <command>wpa_supplicant</command> will use the first driver
522 wrapper that is able to initialize the interface.</para>
524 <blockquote><programlisting>
525 wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
526 </programlisting></blockquote>
528 <para><command>wpa_supplicant</command> can control multiple
529 interfaces (radios) either by running one process for each
530 interface separately or by running just one process and list of
531 options at command line. Each interface is separated with -N
532 argument. As an example, following command would start
533 wpa_supplicant for two interfaces:</para>
535 <blockquote><programlisting>
537 -c wpa1.conf -i wlan0 -D nl80211 -N \
538 -c wpa2.conf -i ath0 -D wext
539 </programlisting></blockquote>
543 <title>OS Requirements</title>
544 <para>Current hardware/software requirements:</para>
548 <para>Linux kernel 2.4.x or 2.6.x with Linux Wireless
549 Extensions v15 or newer</para>
554 <para>FreeBSD 6-CURRENT</para>
558 <para>Microsoft Windows with WinPcap (at least WinXP, may work
559 with other versions)</para>
565 <title>Supported Drivers</title>
568 <term>Linux wireless extensions</term>
570 <para>In theory, any driver that supports Linux wireless
571 extensions can be used with IEEE 802.1X (i.e., not WPA) when
572 using ap_scan=0 option in configuration file.</para>
577 <term>Wired Ethernet drivers</term>
579 <para>Use ap_scan=0.</para>
584 <term>BSD net80211 layer (e.g., Atheros driver)</term>
586 <para>At the moment, this is for FreeBSD 6-CURRENT branch.</para>
591 <term>Windows NDIS</term>
593 <para>The current Windows port requires WinPcap
594 (http://winpcap.polito.it/). See README-Windows.txt for more
601 <para>wpa_supplicant was designed to be portable for different
602 drivers and operating systems. Hopefully, support for more wlan
603 cards and OSes will be added in the future. See developer.txt for
604 more information about the design of wpa_supplicant and porting to
605 other drivers. One main goal is to add full WPA/WPA2 support to
606 Linux wireless extensions to allow new drivers to be supported
607 without having to implement new driver-specific interface code in
608 wpa_supplicant.</para>
612 <title>Architecture</title> <para>The
613 <command>wpa_supplicant</command> system consists of the following
618 <term><filename>wpa_supplicant.conf</filename> </term>
620 <para>the configuration file describing all networks that the
621 user wants the computer to connect to. </para>
625 <term><command>wpa_supplicant</command></term>
626 <listitem><para>the program that directly interacts with the
627 network interface. </para></listitem>
630 <term><command>wpa_cli</command></term> <listitem><para> the
631 client program that provides a high-level interface to the
632 functionality of the daemon. </para></listitem>
635 <term><command>wpa_passphrase</command></term>
636 <listitem><para>a utility needed to construct
637 <filename>wpa_supplicant.conf</filename> files that include
638 encrypted passwords.</para></listitem>
644 <title>Quick Start</title>
646 <para>First, make a configuration file, e.g.
647 <filename>/etc/wpa_supplicant.conf</filename>, that describes the networks
648 you are interested in. See <citerefentry>
649 <refentrytitle>wpa_supplicant.conf</refentrytitle>
650 <manvolnum>5</manvolnum>
654 <para>Once the configuration is ready, you can test whether the
655 configuration works by running <command>wpa_supplicant</command>
656 with following command to start it on foreground with debugging
659 <blockquote><programlisting>
660 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
661 </programlisting></blockquote>
663 <para>Assuming everything goes fine, you can start using following
664 command to start <command>wpa_supplicant</command> on background
665 without debugging:</para>
667 <blockquote><programlisting>
668 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
669 </programlisting></blockquote>
671 <para>Please note that if you included more than one driver
672 interface in the build time configuration (.config), you may need
673 to specify which interface to use by including -D<driver
674 name> option on the command line.</para>
676 <!-- XXX at this point, the page could include a little script
677 based on wpa_cli to wait for a connection and then run
683 <title>Interface to pcmcia-cs/cardmrg</title>
685 <para>For example, following small changes to pcmcia-cs scripts
686 can be used to enable WPA support:</para>
688 <para>Add MODE="Managed" and WPA="y" to the network scheme in
689 <filename>/etc/pcmcia/wireless.opts</filename>.</para>
691 <para>Add the following block to the end of <emphasis>start</emphasis>
692 action handler in <filename>/etc/pcmcia/wireless</filename>:</para>
694 <blockquote><programlisting>
695 if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
696 /usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf -i$DEVICE
698 </programlisting></blockquote>
701 <para>Add the following block to the end of <emphasis>stop</emphasis>
702 action handler (may need to be separated from other actions) in
703 <filename>/etc/pcmcia/wireless</filename>:</para>
705 <blockquote><programlisting>
706 if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
707 killall wpa_supplicant
709 </programlisting></blockquote>
711 <para>This will make <command>cardmgr</command> start
712 <command>wpa_supplicant</command> when the card is plugged
717 <title>See Also</title>
720 <refentrytitle>wpa_background</refentrytitle>
721 <manvolnum>8</manvolnum>
724 <refentrytitle>wpa_supplicant.conf</refentrytitle>
725 <manvolnum>5</manvolnum>
728 <refentrytitle>wpa_cli</refentrytitle>
729 <manvolnum>8</manvolnum>
732 <refentrytitle>wpa_passphrase</refentrytitle>
733 <manvolnum>8</manvolnum>
739 <para>wpa_supplicant is copyright (c) 2003-2015,
740 Jouni Malinen <email>j@w1.fi</email> and
742 All Rights Reserved.</para>
744 <para>This program is licensed under the BSD license (the one with
745 advertisement clause removed).</para>