• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
2
3<refentry>
4  <refmeta>
5    <refentrytitle>wpa_supplicant</refentrytitle>
6    <manvolnum>8</manvolnum>
7  </refmeta>
8  <refnamediv>
9    <refname>wpa_supplicant</refname>
10    <refpurpose>Wi-Fi Protected Access client and IEEE 802.1X supplicant</refpurpose>
11  </refnamediv>
12  <refsynopsisdiv>
13    <cmdsynopsis>
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>
21    </cmdsynopsis>
22  </refsynopsisdiv>
23  <refsect1>
24    <title>Overview</title>
25
26    <para>
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
33    network.
34    </para>
35
36    <para>
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
49    access.
50    </para>
51
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>
58
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>
66
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
71    available.</para>
72
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>
78
79    <para>The following steps are used when associating with an AP
80    using WPA:</para>
81
82    <itemizedlist>
83      <listitem>
84	<para><command>wpa_supplicant</command> requests the kernel
85	driver to scan neighboring BSSes</para>
86      </listitem>
87
88      <listitem>
89	<para><command>wpa_supplicant</command> selects a BSS based on
90	its configuration</para>
91      </listitem>
92
93      <listitem>
94	<para><command>wpa_supplicant</command> requests the kernel
95        driver to associate with the chosen BSS</para>
96      </listitem>
97
98      <listitem>
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
102        AP)</para>
103      </listitem>
104
105      <listitem>
106	<para>If WPA-EAP: master key is received from the IEEE 802.1X
107	Supplicant</para>
108      </listitem>
109
110      <listitem>
111	<para>If WPA-PSK: <command>wpa_supplicant</command> uses PSK
112	as the master session key</para>
113      </listitem>
114
115      <listitem>
116	<para><command>wpa_supplicant</command> completes WPA 4-Way
117        Handshake and Group Key Handshake with the Authenticator
118        (AP)</para>
119      </listitem>
120
121      <listitem>
122	<para><command>wpa_supplicant</command> configures encryption
123	keys for unicast and broadcast</para>
124      </listitem>
125
126      <listitem>
127	<para>normal data packets can be transmitted and received</para>
128      </listitem>
129    </itemizedlist>
130  </refsect1>
131
132  <refsect1>
133    <title>Supported Features</title>
134    <para>Supported WPA/IEEE 802.11i features:</para>
135    <itemizedlist>
136      <listitem>
137	<para>WPA-PSK ("WPA-Personal")</para>
138      </listitem>
139
140      <listitem>
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>
144
145	<itemizedlist>
146	  <listitem>
147	    <para>EAP-TLS</para>
148	  </listitem>
149	</itemizedlist>
150
151	<itemizedlist>
152	  <listitem>
153	    <para>EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)</para>
154	  </listitem>
155
156
157	  <listitem>
158	    <para>EAP-PEAP/TLS (both PEAPv0 and PEAPv1)</para>
159	  </listitem>
160
161	  <listitem>
162	    <para>EAP-PEAP/GTC (both PEAPv0 and PEAPv1)</para>
163	  </listitem>
164
165	  <listitem>
166	    <para>EAP-PEAP/OTP (both PEAPv0 and PEAPv1)</para>
167	  </listitem>
168
169	  <listitem>
170	    <para>EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)</para>
171	  </listitem>
172
173	  <listitem>
174	    <para>EAP-TTLS/EAP-MD5-Challenge</para>
175	  </listitem>
176
177	  <listitem>
178	    <para>EAP-TTLS/EAP-GTC</para>
179	  </listitem>
180
181          <listitem><para>EAP-TTLS/EAP-OTP</para></listitem>
182
183          <listitem><para>EAP-TTLS/EAP-MSCHAPv2</para></listitem>
184
185          <listitem><para>EAP-TTLS/EAP-TLS</para></listitem>
186
187          <listitem><para>EAP-TTLS/MSCHAPv2</para></listitem>
188
189          <listitem><para>EAP-TTLS/MSCHAP</para></listitem>
190
191          <listitem><para>EAP-TTLS/PAP</para></listitem>
192
193          <listitem><para>EAP-TTLS/CHAP</para></listitem>
194
195          <listitem><para>EAP-SIM</para></listitem>
196
197          <listitem><para>EAP-AKA</para></listitem>
198
199          <listitem><para>EAP-PSK</para></listitem>
200
201          <listitem><para>EAP-PAX</para></listitem>
202
203          <listitem><para>LEAP (note: requires special support from
204          the driver for IEEE 802.11 authentication)</para></listitem>
205
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>
209
210          <listitem><para>EAP-MD5-Challenge </para></listitem>
211
212          <listitem><para>EAP-MSCHAPv2</para></listitem>
213
214          <listitem><para>EAP-GTC</para></listitem>
215
216          <listitem><para>EAP-OTP</para></listitem>
217	</itemizedlist>
218      </listitem>
219
220      <listitem>
221	<para>key management for CCMP, TKIP, WEP104, WEP40</para>
222      </listitem>
223
224      <listitem>
225	<para>RSN/WPA2 (IEEE 802.11i)</para>
226	<itemizedlist>
227	  <listitem>
228	    <para>pre-authentication</para>
229	  </listitem>
230
231	  <listitem>
232	    <para>PMKSA caching</para>
233	  </listitem>
234	</itemizedlist>
235      </listitem>
236    </itemizedlist>
237  </refsect1>
238
239  <refsect1>
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>
246
247    <variablelist>
248      <varlistentry>
249	<term>wext</term>
250	<listitem>
251	  <para>Linux wireless extensions (generic).</para>
252	</listitem>
253      </varlistentry>
254
255      <varlistentry>
256	<term>wired</term>
257	<listitem>
258	  <para>wpa_supplicant wired Ethernet driver</para>
259	</listitem>
260      </varlistentry>
261
262      <varlistentry>
263	<term>roboswitch</term>
264	<listitem>
265	  <para>wpa_supplicant Broadcom switch driver</para>
266	</listitem>
267      </varlistentry>
268
269      <varlistentry>
270	<term>bsd</term>
271	<listitem>
272	  <para>BSD 802.11 support (Atheros, etc.).</para>
273	</listitem>
274      </varlistentry>
275
276      <varlistentry>
277	<term>ndis</term>
278	<listitem>
279	  <para>Windows NDIS driver.</para>
280	</listitem>
281      </varlistentry>
282    </variablelist>
283  </refsect1>
284
285  <refsect1>
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>
291    <variablelist>
292      <varlistentry>
293	<term>-b br_ifname</term>
294	<listitem>
295	  <para>Optional bridge interface name. (Per interface)</para>
296	</listitem>
297      </varlistentry>
298
299      <varlistentry>
300	<term>-B</term>
301	<listitem>
302	  <para>Run daemon in the background.</para>
303	</listitem>
304      </varlistentry>
305
306      <varlistentry>
307	<term>-c filename</term>
308	<listitem>
309	  <para>Path to configuration file. (Per interface)</para>
310	</listitem>
311      </varlistentry>
312
313      <varlistentry>
314	<term>-C ctrl_interface</term>
315	<listitem>
316	  <para>Path to ctrl_interface socket (Per interface. Only used if
317		  <option>-c</option> is not).</para>
318	</listitem>
319      </varlistentry>
320
321      <varlistentry>
322	<term>-i ifname</term>
323	<listitem>
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>
327	</listitem>
328      </varlistentry>
329
330      <varlistentry>
331	<term>-d</term>
332	<listitem>
333	  <para>Increase debugging verbosity (<option>-dd</option> even
334		  more).</para>
335	</listitem>
336      </varlistentry>
337
338      <varlistentry>
339	<term>-D driver</term>
340	<listitem>
341	  <para>Driver to use (can be multiple drivers: nl80211,wext).
342		  (Per interface, see the available options below.)</para>
343	</listitem>
344      </varlistentry>
345
346      <varlistentry>
347	<term>-e entropy file</term>
348	<listitem>
349	  <para>File for <command>wpa_supplicant</command> to use to
350	  maintain its internal entropy store in over restarts.</para>
351	</listitem>
352      </varlistentry>
353
354      <varlistentry>
355	<term>-f output file</term>
356	<listitem>
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>
360	  option.)</para>
361	</listitem>
362      </varlistentry>
363
364      <varlistentry>
365	<term>-g global ctrl_interface</term>
366	<listitem>
367	  <para>Path to global ctrl_interface socket. If specified, interface
368	  definitions may be omitted.</para>
369	</listitem>
370      </varlistentry>
371
372      <varlistentry>
373	<term>-K</term>
374	<listitem>
375	  <para>Include keys (passwords, etc.) in debug output.</para>
376	</listitem>
377      </varlistentry>
378
379      <varlistentry>
380	<term>-t</term>
381	<listitem>
382	  <para>Include timestamp in debug messages.</para>
383	</listitem>
384      </varlistentry>
385
386      <varlistentry>
387	<term>-h</term>
388	<listitem>
389	  <para>Help.  Show a usage message.</para>
390	</listitem>
391      </varlistentry>
392
393      <varlistentry>
394	<term>-L</term>
395	<listitem>
396	  <para>Show license (BSD).</para>
397	</listitem>
398      </varlistentry>
399
400      <varlistentry>
401	<term>-o override driver</term>
402	<listitem>
403	  <para>Override the driver parameter for new
404	  interfaces.</para>
405	</listitem>
406      </varlistentry>
407
408      <varlistentry>
409	<term>-O override ctrl_interface</term>
410	<listitem>
411	  <para>Override the ctrl_interface parameter for new
412	  interfaces.</para>
413	</listitem>
414      </varlistentry>
415
416      <varlistentry>
417	<term>-p</term>
418	<listitem>
419	  <para>Driver parameters. (Per interface)</para>
420	</listitem>
421      </varlistentry>
422
423      <varlistentry>
424	<term>-P PID_file</term>
425	<listitem>
426	  <para>Path to PID file.</para>
427	</listitem>
428      </varlistentry>
429
430      <varlistentry>
431	<term>-q</term>
432	<listitem>
433	  <para>Decrease debugging verbosity (<option>-qq</option> even
434		  less).</para>
435	</listitem>
436      </varlistentry>
437
438      <varlistentry>
439	<term>-s</term>
440	<listitem>
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>
444	  option.)</para>
445	</listitem>
446      </varlistentry>
447
448      <varlistentry>
449	<term>-T</term>
450	<listitem>
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>
455	  option.)</para>
456	</listitem>
457      </varlistentry>
458
459      <varlistentry>
460	<term>-t</term>
461	<listitem>
462	  <para>Include timestamp in debug messages.</para>
463	</listitem>
464      </varlistentry>
465
466      <varlistentry>
467	<term>-u</term>
468	<listitem>
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>
473	</listitem>
474      </varlistentry>
475
476      <varlistentry>
477	<term>-v</term>
478	<listitem>
479	  <para>Show version.</para>
480	</listitem>
481      </varlistentry>
482
483      <varlistentry>
484	<term>-W</term>
485	<listitem>
486	  <para>Wait for a control interface monitor before starting.</para>
487	</listitem>
488      </varlistentry>
489
490      <varlistentry>
491	<term>-N</term>
492	<listitem>
493	  <para>Start describing new interface.</para>
494	</listitem>
495      </varlistentry>
496    </variablelist>
497  </refsect1>
498
499  <refsect1>
500    <title>Examples</title>
501
502    <para>In most common cases, <command>wpa_supplicant</command> is
503    started with:</para>
504
505<blockquote><programlisting>
506wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
507</programlisting></blockquote>
508
509    <para>This makes the process fork into background.</para>
510
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>
514
515<blockquote><programlisting>
516wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
517</programlisting></blockquote>
518
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>
523
524<blockquote><programlisting>
525wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
526</programlisting></blockquote>
527
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>
534
535<blockquote><programlisting>
536wpa_supplicant \
537	-c wpa1.conf -i wlan0 -D nl80211 -N \
538	-c wpa2.conf -i ath0 -D wext
539</programlisting></blockquote>
540  </refsect1>
541
542  <refsect1>
543    <title>OS Requirements</title>
544    <para>Current hardware/software requirements:</para>
545
546    <itemizedlist>
547      <listitem>
548	<para>Linux kernel 2.4.x or 2.6.x with Linux Wireless
549	Extensions v15 or newer</para>
550      </listitem>
551
552
553      <listitem>
554	<para>FreeBSD 6-CURRENT</para>
555      </listitem>
556
557      <listitem>
558	<para>Microsoft Windows with WinPcap (at least WinXP, may work
559	with other versions)</para>
560      </listitem>
561    </itemizedlist>
562  </refsect1>
563
564  <refsect1>
565    <title>Supported Drivers</title>
566    <variablelist>
567      <varlistentry>
568	<term>Linux wireless extensions</term>
569	<listitem>
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>
573	</listitem>
574      </varlistentry>
575
576      <varlistentry>
577	<term>Wired Ethernet drivers</term>
578	<listitem>
579	  <para>Use ap_scan=0.</para>
580	</listitem>
581      </varlistentry>
582
583      <varlistentry>
584	<term>BSD net80211 layer (e.g., Atheros driver)</term>
585	<listitem>
586	  <para>At the moment, this is for FreeBSD 6-CURRENT branch.</para>
587	</listitem>
588      </varlistentry>
589
590      <varlistentry>
591	<term>Windows NDIS</term>
592	<listitem>
593	  <para>The current Windows port requires WinPcap
594	(http://winpcap.polito.it/).  See README-Windows.txt for more
595	information.</para>
596	</listitem>
597      </varlistentry>
598    </variablelist>
599
600
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>
609  </refsect1>
610
611  <refsect1>
612    <title>Architecture</title> <para>The
613    <command>wpa_supplicant</command> system consists of the following
614    components:</para>
615
616    <variablelist>
617      <varlistentry>
618	<term><filename>wpa_supplicant.conf</filename> </term>
619	<listitem>
620        <para>the configuration file describing all networks that the
621        user wants the computer to connect to.  </para>
622	</listitem>
623      </varlistentry>
624      <varlistentry>
625	<term><command>wpa_supplicant</command></term>
626        <listitem><para>the program that directly interacts with the
627        network interface.  </para></listitem>
628      </varlistentry>
629      <varlistentry>
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>
633      </varlistentry>
634      <varlistentry>
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>
639      </varlistentry>
640    </variablelist>
641  </refsect1>
642
643  <refsect1>
644    <title>Quick Start</title>
645
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>
651      </citerefentry>
652    for details.</para>
653
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
657    enabled:</para>
658
659    <blockquote><programlisting>
660wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
661    </programlisting></blockquote>
662
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>
666
667    <blockquote><programlisting>
668wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
669    </programlisting></blockquote>
670
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&lt;driver
674    name&gt; option on the command line.</para>
675
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
678         dhclient -->
679
680  </refsect1>
681
682  <refsect1>
683    <title>Interface to pcmcia-cs/cardmrg</title>
684
685    <para>For example, following small changes to pcmcia-cs scripts
686    can be used to enable WPA support:</para>
687
688    <para>Add MODE="Managed" and WPA="y" to the network scheme in
689    <filename>/etc/pcmcia/wireless.opts</filename>.</para>
690
691    <para>Add the following block to the end of <emphasis>start</emphasis>
692    action handler in <filename>/etc/pcmcia/wireless</filename>:</para>
693
694    <blockquote><programlisting>
695if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
696    /usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf -i$DEVICE
697fi
698    </programlisting></blockquote>
699
700
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>
704
705    <blockquote><programlisting>
706if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
707    killall wpa_supplicant
708fi
709    </programlisting></blockquote>
710
711    <para>This will make <command>cardmgr</command> start
712    <command>wpa_supplicant</command> when the card is plugged
713    in.</para>
714  </refsect1>
715
716  <refsect1>
717    <title>See Also</title>
718    <para>
719      <citerefentry>
720	<refentrytitle>wpa_background</refentrytitle>
721	<manvolnum>8</manvolnum>
722      </citerefentry>
723      <citerefentry>
724	<refentrytitle>wpa_supplicant.conf</refentrytitle>
725	<manvolnum>5</manvolnum>
726      </citerefentry>
727      <citerefentry>
728	<refentrytitle>wpa_cli</refentrytitle>
729	<manvolnum>8</manvolnum>
730      </citerefentry>
731      <citerefentry>
732	<refentrytitle>wpa_passphrase</refentrytitle>
733	<manvolnum>8</manvolnum>
734      </citerefentry>
735    </para>
736  </refsect1>
737  <refsect1>
738    <title>Legal</title>
739    <para>wpa_supplicant is copyright (c) 2003-2016,
740    Jouni Malinen <email>j@w1.fi</email> and
741    contributors.
742    All Rights Reserved.</para>
743
744    <para>This program is licensed under the BSD license (the one with
745    advertisement clause removed).</para>
746  </refsect1>
747</refentry>
748