aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/doc/docbook/wpa_cli.sgml
blob: be3045a6a9e6e0026994363de00a8f9af426d5ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">

<refentry>
  <refmeta>
    <refentrytitle>wpa_cli</refentrytitle>
    <manvolnum>8</manvolnum>
  </refmeta>
  <refnamediv>
    <refname>wpa_cli</refname>

    <refpurpose>WPA command line client</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>wpa_cli</command>
      <arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
      <arg>-g <replaceable>path to global ctrl_interface socket</replaceable></arg>
      <arg>-i <replaceable>ifname</replaceable></arg>
      <arg>-hvB</arg>
      <arg>-a <replaceable>action file</replaceable></arg>
      <arg>-P <replaceable>pid file</replaceable></arg>
      <arg>-G <replaceable>ping interval</replaceable></arg>
      <arg><replaceable>command ...</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Overview</title>

    <para>wpa_cli is a text-based frontend program for interacting
    with wpa_supplicant. It is used to query current status, change
    configuration, trigger events, and request interactive user
    input.</para>

    <para>wpa_cli can show the current authentication status, selected
    security mode, dot11 and dot1x MIBs, etc. In addition, it can
    configure some variables like EAPOL state machine parameters and
    trigger events like reassociation and IEEE 802.1X
    logoff/logon. wpa_cli provides a user interface to request
    authentication information, like username and password, if these
    are not included in the configuration. This can be used to
    implement, e.g., one-time-passwords or generic token card
    authentication where the authentication is based on a
    challenge-response that uses an external device for generating the
    response.</para>

    <para>The control interface of wpa_supplicant can be configured to
    allow non-root user access (ctrl_interface GROUP= parameter in the
    configuration file). This makes it possible to run wpa_cli with a
    normal user account.</para>

    <para>wpa_cli supports two modes: interactive and command
    line. Both modes share the same command set and the main
    difference is in interactive mode providing access to unsolicited
    messages (event messages, username/password requests).</para>

    <para>Interactive mode is started when wpa_cli is executed without
    including the command as a command line parameter. Commands are
    then entered on the wpa_cli prompt. In command line mode, the same
    commands are entered as command line arguments for wpa_cli.</para>
 </refsect1>
 <refsect1>
   <title>Interactive authentication parameters request</title>

   <para>When wpa_supplicant need authentication parameters, like
   username and password, which are not present in the configuration
   file, it sends a request message to all attached frontend programs,
   e.g., wpa_cli in interactive mode. wpa_cli shows these requests
   with "CTRL-REQ-&lt;type&gt;-&lt;id&gt;:&lt;text&gt;"
   prefix. &lt;type&gt; is IDENTITY, PASSWORD, or OTP
   (one-time-password). &lt;id&gt; is a unique identifier for the
   current network. &lt;text&gt; is description of the request. In
   case of OTP request, it includes the challenge from the
   authentication server.</para>

    <para>The reply to these requests can be given with
    <emphasis>identity</emphasis>, <emphasis>password</emphasis>, and
    <emphasis>otp</emphasis> commands. &lt;id&gt; needs to be copied from
    the matching request. <emphasis>password</emphasis> and
    <emphasis>otp</emphasis> commands can be used regardless of whether
    the request was for PASSWORD or OTP. The main difference between these
    two commands is that values given with <emphasis>password</emphasis> are
    remembered as long as wpa_supplicant is running whereas values given
    with <emphasis>otp</emphasis> are used only once and then forgotten,
    i.e., wpa_supplicant will ask frontend for a new value for every use.
    This can be used to implement one-time-password lists and generic token
    card -based authentication.</para>

    <para>Example request for password and a matching reply:</para>

<blockquote><programlisting>
CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
> password 1 mysecretpassword
</programlisting></blockquote>

    <para>Example request for generic token card challenge-response:</para>

<blockquote><programlisting>
CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
> otp 2 9876
</programlisting></blockquote>

  </refsect1>
  <refsect1>
    <title>Command Arguments</title>
    <variablelist>
      <varlistentry>
	<term>-p path</term>

	<listitem><para>Change the path where control sockets should
	be found.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-g control socket path</term>

	<listitem><para>Connect to the global control socket at the
	indicated path rather than an interface-specific control
	socket.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-i ifname</term>

        <listitem><para>Specify the interface that is being
	configured.  By default, choose the first interface found with
	a control socket in the socket path.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-h</term>
	<listitem><para>Help.  Show a usage message.</para></listitem>
      </varlistentry>


      <varlistentry>
	<term>-v</term>
	<listitem><para>Show version information.</para></listitem>
      </varlistentry>


      <varlistentry>
	<term>-B</term>
	<listitem><para>Run as a daemon in the background.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-a file</term>

	<listitem><para>Run in daemon mode executing the action file
        based on events from wpa_supplicant.  The specified file will
	be executed with the first argument set to interface name and
	second to "CONNECTED" or "DISCONNECTED" depending on the event.
	This can be used to execute networking tools required to configure
	the interface.</para>

	<para>Additionally, three environmental variables are available to
	the file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR
	contains the absolute path to the ctrl_interface socket. WPA_ID
	contains the unique network_id identifier assigned to the active
	network, and WPA_ID_STR contains the content of the id_str option.
	</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-P file</term>

	<listitem><para>Set the location of the PID
	file.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>-G ping interval</term>

	<listitem><para>Set the interval (in seconds) at which
	wpa_cli pings the supplicant.</para></listitem>
      </varlistentry>

      <varlistentry>
	<term>command</term>

	<listitem><para>Run a command.  The available commands are
	listed in the next section.</para></listitem>

      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>Commands</title>
    <para>The following commands are available:</para>

    <variablelist>
      <varlistentry>
	<term>status</term>
	<listitem>
	  <para>get current WPA/EAPOL/EAP status</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>mib</term>
	<listitem>
	  <para>get MIB variables (dot1x, dot11)</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>help</term>
	<listitem>
	  <para>show this usage help</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>interface [ifname]</term>
	<listitem>
	  <para>show interfaces/select interface</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>level &lt;debug level&gt;</term>
	<listitem>
	  <para>change debug level</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>license</term>
	<listitem>
	  <para>show full wpa_cli license</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>logoff</term>
	<listitem>
	  <para>IEEE 802.1X EAPOL state machine logoff</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>logon</term>
	<listitem>
	  <para>IEEE 802.1X EAPOL state machine logon</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>set</term>
	<listitem>
	  <para>set variables (shows list of variables when run without arguments)</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>pmksa</term>
	<listitem>
	  <para>show PMKSA cache</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>reassociate</term>
	<listitem>
	  <para>force reassociation</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>reconfigure</term>
	<listitem>
	  <para>force wpa_supplicant to re-read its configuration file</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>preauthenticate &lt;BSSID&gt;</term>
	<listitem>
	  <para>force preauthentication</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>identity &lt;network id&gt; &lt;identity&gt;</term>
	<listitem>
	  <para>configure identity for an SSID</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>password &lt;network id&gt; &lt;password&gt;</term>
	<listitem>
	  <para>configure password for an SSID</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>pin &lt;network id&gt; &lt;pin&gt;</term>
	<listitem>
	  <para>configure pin for an SSID</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>otp &lt;network id&gt; &lt;password&gt;</term>
	<listitem>
	  <para>configure one-time-password for an SSID</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>bssid &lt;network id&gt; &lt;BSSID&gt;</term>
	<listitem>
	  <para>set preferred BSSID for an SSID</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>list_networks</term>
	<listitem>
	  <para>list configured networks</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>terminate</term>
	<listitem>
	  <para>terminate <command>wpa_supplicant</command></para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>quit</term>
	<listitem><para>exit wpa_cli</para></listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry>
	<refentrytitle>wpa_supplicant</refentrytitle>
	<manvolnum>8</manvolnum>
      </citerefentry>
    </para>
  </refsect1>
  <refsect1>
    <title>Legal</title>
    <para>wpa_supplicant is copyright (c) 2003-2017,
    Jouni Malinen <email>j@w1.fi</email> and
    contributors.
    All Rights Reserved.</para>

    <para>This program is licensed under the BSD license (the one with
    advertisement clause removed).</para>
  </refsect1>
</refentry>