1WPA_CLI(8) WPA_CLI(8)
2
3
4
6 wpa_cli - WPA command line client
7
9 wpa_cli [ -p path to ctrl sockets ] [ -g path to global ctrl_interface
10 socket ] [ -i ifname ] [ -hvB ] [ -a action file ] [ -P pid file ]
11 [ -G ping interval ] [ command ... ]
12
14 wpa_cli is a text-based frontend program for interacting with wpa_sup‐
15 plicant. It is used to query current status, change configuration,
16 trigger events, and request interactive user input.
17
18 wpa_cli can show the current authentication status, selected security
19 mode, dot11 and dot1x MIBs, etc. In addition, it can configure some
20 variables like EAPOL state machine parameters and trigger events like
21 reassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user
22 interface to request authentication information, like username and
23 password, if these are not included in the configuration. This can be
24 used to implement, e.g., one-time-passwords or generic token card
25 authentication where the authentication is based on a challenge-
26 response that uses an external device for generating the response.
27
28 The control interface of wpa_supplicant can be configured to allow non-
29 root user access (ctrl_interface GROUP= parameter in the configuration
30 file). This makes it possible to run wpa_cli with a normal user
31 account.
32
33 wpa_cli supports two modes: interactive and command line. Both modes
34 share the same command set and the main difference is in interactive
35 mode providing access to unsolicited messages (event messages, user‐
36 name/password requests).
37
38 Interactive mode is started when wpa_cli is executed without including
39 the command as a command line parameter. Commands are then entered on
40 the wpa_cli prompt. In command line mode, the same commands are entered
41 as command line arguments for wpa_cli.
42
44 When wpa_supplicant need authentication parameters, like username and
45 password, which are not present in the configuration file, it sends a
46 request message to all attached frontend programs, e.g., wpa_cli in
47 interactive mode. wpa_cli shows these requests with "CTRL-
48 REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or OTP
49 (one-time-password). <id> is a unique identifier for the current net‐
50 work. <text> is description of the request. In case of OTP request, it
51 includes the challenge from the authentication server.
52
53 The reply to these requests can be given with identity, password, and
54 otp commands. <id> needs to be copied from the matching request. pass‐
55 word and otp commands can be used regardless of whether the request was
56 for PASSWORD or OTP. The main difference between these two commands is
57 that values given with password are remembered as long as wpa_suppli‐
58 cant is running whereas values given with otp are used only once and
59 then forgotten, i.e., wpa_supplicant will ask frontend for a new value
60 for every use. This can be used to implement one-time-password lists
61 and generic token card -based authentication.
62
63 Example request for password and a matching reply:
64
65
66 CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
67 > password 1 mysecretpassword
68
69
70
71 Example request for generic token card challenge-response:
72
73
74 CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
75 > otp 2 9876
76
77
78
80 -p path
81 Change the path where control sockets should be found.
82
83 -g control socket path
84 Connect to the global control socket at the indicated path
85 rather than an interface-specific control socket.
86
87 -i ifname
88 Specify the interface that is being configured. By default,
89 choose the first interface found with a control socket in the
90 socket path.
91
92 -h Help. Show a usage message.
93
94 -v Show version information.
95
96 -B Run as a daemon in the background.
97
98 -a file
99 Run in daemon mode executing the action file based on events
100 from wpa_supplicant. The specified file will be executed with
101 the first argument set to interface name and second to "CON‐
102 NECTED" or "DISCONNECTED" depending on the event. This can be
103 used to execute networking tools required to configure the
104 interface.
105
106 Additionally, three environmental variables are available to the
107 file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR con‐
108 tains the absolute path to the ctrl_interface socket. WPA_ID
109 contains the unique network_id identifier assigned to the active
110 network, and WPA_ID_STR contains the content of the id_str
111 option.
112
113 -P file
114 Set the location of the PID file.
115
116 -G ping interval
117 Set the interval (in seconds) at which wpa_cli pings the suppli‐
118 cant.
119
120 command
121 Run a command. The available commands are listed in the next
122 section.
123
125 The following commands are available:
126
127 status get current WPA/EAPOL/EAP status
128
129 mib get MIB variables (dot1x, dot11)
130
131 help show this usage help
132
133 interface [ifname]
134 show interfaces/select interface
135
136 level <debug level>
137 change debug level
138
139 license
140 show full wpa_cli license
141
142 logoff IEEE 802.1X EAPOL state machine logoff
143
144 logon IEEE 802.1X EAPOL state machine logon
145
146 set set variables (shows list of variables when run without argu‐
147 ments)
148
149 pmksa show PMKSA cache
150
151 reassociate
152 force reassociation
153
154 reconfigure
155 force wpa_supplicant to re-read its configuration file
156
157 preauthenticate <BSSID>
158 force preauthentication
159
160 identity <network id> <identity>
161 configure identity for an SSID
162
163 password <network id> <password>
164 configure password for an SSID
165
166 pin <network id> <pin>
167 configure pin for an SSID
168
169 otp <network id> <password>
170 configure one-time-password for an SSID
171
172 bssid <network id> <BSSID>
173 set preferred BSSID for an SSID
174
175 list_networks
176 list configured networks
177
178 terminate
179 terminate wpa_supplicant
180
181 quit exit wpa_cli
182
184 wpa_supplicant(8)
185
187 wpa_supplicant is copyright (c) 2003-2019, Jouni Malinen <j@w1.fi> and
188 contributors. All Rights Reserved.
189
190 This program is licensed under the BSD license (the one with advertise‐
191 ment clause removed).
192
193
194
195 30 October 2019 WPA_CLI(8)