1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
5 <refentrytitle>wpa_cli</refentrytitle>
6 <manvolnum>8</manvolnum>
9 <refname>wpa_cli</refname>
11 <refpurpose>WPA command line client</refpurpose>
16 <command>wpa_cli</command>
17 <arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
18 <arg>-g <replaceable>path to global ctrl_interface socket</replaceable></arg>
19 <arg>-i <replaceable>ifname</replaceable></arg>
21 <arg>-a <replaceable>action file</replaceable></arg>
22 <arg>-P <replaceable>pid file</replaceable></arg>
23 <arg>-G <replaceable>ping interval</replaceable></arg>
24 <arg><replaceable>command ...</replaceable></arg>
29 <title>Overview</title>
31 <para>wpa_cli is a text-based frontend program for interacting
32 with wpa_supplicant. It is used to query current status, change
33 configuration, trigger events, and request interactive user
36 <para>wpa_cli can show the current authentication status, selected
37 security mode, dot11 and dot1x MIBs, etc. In addition, it can
38 configure some variables like EAPOL state machine parameters and
39 trigger events like reassociation and IEEE 802.1X
40 logoff/logon. wpa_cli provides a user interface to request
41 authentication information, like username and password, if these
42 are not included in the configuration. This can be used to
43 implement, e.g., one-time-passwords or generic token card
44 authentication where the authentication is based on a
45 challenge-response that uses an external device for generating the
48 <para>The control interface of wpa_supplicant can be configured to
49 allow non-root user access (ctrl_interface GROUP= parameter in the
50 configuration file). This makes it possible to run wpa_cli with a
51 normal user account.</para>
53 <para>wpa_cli supports two modes: interactive and command
54 line. Both modes share the same command set and the main
55 difference is in interactive mode providing access to unsolicited
56 messages (event messages, username/password requests).</para>
58 <para>Interactive mode is started when wpa_cli is executed without
59 including the command as a command line parameter. Commands are
60 then entered on the wpa_cli prompt. In command line mode, the same
61 commands are entered as command line arguments for wpa_cli.</para>
64 <title>Interactive authentication parameters request</title>
66 <para>When wpa_supplicant need authentication parameters, like
67 username and password, which are not present in the configuration
68 file, it sends a request message to all attached frontend programs,
69 e.g., wpa_cli in interactive mode. wpa_cli shows these requests
70 with "CTRL-REQ-<type>-<id>:<text>"
71 prefix. <type> is IDENTITY, PASSWORD, or OTP
72 (one-time-password). <id> is a unique identifier for the
73 current network. <text> is description of the request. In
74 case of OTP request, it includes the challenge from the
75 authentication server.</para>
77 <para>The reply to these requests can be given with
78 <emphasis>identity</emphasis>, <emphasis>password</emphasis>, and
79 <emphasis>otp</emphasis> commands. <id> needs to be copied from
80 the matching request. <emphasis>password</emphasis> and
81 <emphasis>otp</emphasis> commands can be used regardless of whether
82 the request was for PASSWORD or OTP. The main difference between these
83 two commands is that values given with <emphasis>password</emphasis> are
84 remembered as long as wpa_supplicant is running whereas values given
85 with <emphasis>otp</emphasis> are used only once and then forgotten,
86 i.e., wpa_supplicant will ask frontend for a new value for every use.
87 This can be used to implement one-time-password lists and generic token
88 card -based authentication.</para>
90 <para>Example request for password and a matching reply:</para>
92 <blockquote><programlisting>
93 CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
94 > password 1 mysecretpassword
95 </programlisting></blockquote>
97 <para>Example request for generic token card challenge-response:</para>
99 <blockquote><programlisting>
100 CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
102 </programlisting></blockquote>
106 <title>Command Arguments</title>
111 <listitem><para>Change the path where control sockets should
112 be found.</para></listitem>
116 <term>-g control socket path</term>
118 <listitem><para>Connect to the global control socket at the
119 indicated path rather than an interface-specific control
120 socket.</para></listitem>
124 <term>-i ifname</term>
126 <listitem><para>Specify the interface that is being
127 configured. By default, choose the first interface found with
128 a control socket in the socket path.</para></listitem>
133 <listitem><para>Help. Show a usage message.</para></listitem>
139 <listitem><para>Show version information.</para></listitem>
145 <listitem><para>Run as a daemon in the background.</para></listitem>
151 <listitem><para>Run in daemon mode executing the action file
152 based on events from wpa_supplicant. The specified file will
153 be executed with the first argument set to interface name and
154 second to "CONNECTED" or "DISCONNECTED" depending on the event.
155 This can be used to execute networking tools required to configure
156 the interface.</para>
158 <para>Additionally, three environmental variables are available to
159 the file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR
160 contains the absolute path to the ctrl_interface socket. WPA_ID
161 contains the unique network_id identifier assigned to the active
162 network, and WPA_ID_STR contains the content of the id_str option.
169 <listitem><para>Set the location of the PID
170 file.</para></listitem>
174 <term>-G ping interval</term>
176 <listitem><para>Set the interval (in seconds) at which
177 wpa_cli pings the supplicant.</para></listitem>
183 <listitem><para>Run a command. The available commands are
184 listed in the next section.</para></listitem>
190 <title>Commands</title>
191 <para>The following commands are available:</para>
197 <para>get current WPA/EAPOL/EAP status</para>
204 <para>get MIB variables (dot1x, dot11)</para>
211 <para>show this usage help</para>
216 <term>interface [ifname]</term>
218 <para>show interfaces/select interface</para>
223 <term>level <debug level></term>
225 <para>change debug level</para>
232 <para>show full wpa_cli license</para>
239 <para>IEEE 802.1X EAPOL state machine logoff</para>
246 <para>IEEE 802.1X EAPOL state machine logon</para>
253 <para>set variables (shows list of variables when run without arguments)</para>
259 <para>show PMKSA cache</para>
263 <term>reassociate</term>
265 <para>force reassociation</para>
269 <term>reconfigure</term>
271 <para>force wpa_supplicant to re-read its configuration file</para>
276 <term>preauthenticate <BSSID></term>
278 <para>force preauthentication</para>
283 <term>identity <network id> <identity></term>
285 <para>configure identity for an SSID</para>
290 <term>password <network id> <password></term>
292 <para>configure password for an SSID</para>
297 <term>pin <network id> <pin></term>
299 <para>configure pin for an SSID</para>
304 <term>otp <network id> <password></term>
306 <para>configure one-time-password for an SSID</para>
311 <term>bssid <network id> <BSSID></term>
313 <para>set preferred BSSID for an SSID</para>
318 <term>list_networks</term>
320 <para>list configured networks</para>
325 <term>terminate</term>
327 <para>terminate <command>wpa_supplicant</command></para>
333 <listitem><para>exit wpa_cli</para></listitem>
338 <title>See Also</title>
341 <refentrytitle>wpa_supplicant</refentrytitle>
342 <manvolnum>8</manvolnum>
348 <para>wpa_supplicant is copyright (c) 2003-2016,
349 Jouni Malinen <email>j@w1.fi</email> and
351 All Rights Reserved.</para>
353 <para>This program is licensed under the BSD license (the one with
354 advertisement clause removed).</para>