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 ] [ -i ifname ] [ -hvB ] [ -a action
10 file ] [ -P pid file ] [ command ... ]
11
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 in the configuration file). This
30 makes it possible to run wpa_cli with a normal user account.
31
32 wpa_cli supports two modes: interactive and command line. Both modes
33 share the same command set and the main difference is in interactive
34 mode providing access to unsolicited messages (event messages, user‐
35 name/password requests).
36
37 Interactive mode is started when wpa_cli is executed without including
38 the command as a command line parameter. Commands are then entered on
39 the wpa_cli prompt. In command line mode, the same commands are entered
40 as command line arguments for wpa_cli.
41
43 When wpa_supplicant need authentication parameters, like username and
44 password, which are not present in the configuration file, it sends a
45 request message to all attached frontend programs, e.g., wpa_cli in
46 interactive mode. wpa_cli shows these requests with "CTRL-
47 REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or OTP
48 (one-time-password). <id> is a unique identifier for the current net‐
49 work. <text> is description of the request. In case of OTP request, it
50 includes the challenge from the authentication server.
51
52 The reply to these requests can be given with 'identity', the matching
53 request. 'password' and 'otp' commands can be used regardless of
54 whether the request was for PASSWORD or OTP. The main difference
55 between these two commands is that values given with 'password' are
56 remembered as long as wpa_supplicant is running whereas values given
57 with 'otp' are used only once and then forgotten, i.e., wpa_supplicant
58 will ask frontend for a new value for every use. This can be used to
59 implement one-time-password lists and generic token card -based authen‐
60 tication.
61
62 Example request for password and a matching reply:
63
64
65 CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
66 > password 1 mysecretpassword
67
68 Example request for generic token card challenge-response:
69
70
71 CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
72 > otp 2 9876
73
75 -p path
76 Change the path where control sockets should be found.
77
78 -i ifname
79 Specify the interface that is being configured. By default,
80 choose the first interface found with a control socket in the
81 socket path.
82
83 -h Help. Show a usage message.
84
85 -v Show version information.
86
87 -B Run as a daemon in the background.
88
89 -a file
90 Run in daemon mode executing the action file based on events
91 from wpa_supplicant. The specified file will be executed with
92 the first argument set to interface name and second to "CONNECT"
93 or "DISCONNECT" depending on the event. This can be used to
94 execute networking tools required to configure the interface.
95
96 Additionally, three environmental variables are available to the
97 file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR con‐
98 tains the absolute path to the ctrl_interface socket. WPA_ID
99 contains the unique network_id identifier assigned to the active
100 network, and WPA_ID_STR contains the content of the id_str
101 option.
102
103 -P file
104 Set the location of the PID file.
105
106 command
107 Run a command. The available commands are listed in the next
108 section.
109
111 The following commands are available:
112
113 status get current WPA/EAPOL/EAP status
114
115 mib get MIB variables (dot1x, dot11)
116
117 help show this usage help
118
119 interface [ifname]
120 show interfaces/select interface
121
122 level <debug level>
123 change debug level
124
125 license
126 show full wpa_cli license
127
128 logoff IEEE 802.1X EAPOL state machine logoff
129
130 logon IEEE 802.1X EAPOL state machine logon
131
132 set set variables (shows list of variables when run without argu‐
133 ments)
134
135 pmksa show PMKSA cache
136
137 reassociate
138 force reassociation
139
140 reconfigure
141 force wpa_supplicant to re-read its configuration file
142
143 preauthenticate <BSSID>
144 force preauthentication
145
146 identity <network id> <identity>
147 configure identity for an SSID
148
149 password <network id> <password>
150 configure password for an SSID
151
152 pin <network id> <pin>
153 configure pin for an SSID
154
155 otp <network id> <password>
156 configure one-time-password for an SSID
157
158 bssid <network id> <BSSID>
159 set preferred BSSID for an SSID
160
161 list_networks
162 list configured networks
163
164 terminate
165 terminate wpa_supplicant
166
167 quit exit wpa_cli
168
170 wpa_supplicant(8)
171
173 wpa_supplicant is copyright (c) 2003-2005, Jouni Malinen <jkma‐
174 line@cc.hut.fi> and contributors. All Rights Reserved.
175
176 This program is dual-licensed under both the GPL version 2 and BSD
177 license. Either license may be used at your option.
178
179
180
181 31 December 2006 WPA_CLI(8)