wpa_cli.sgml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
  2. <refentry>
  3. <refmeta>
  4. <refentrytitle>wpa_cli</refentrytitle>
  5. <manvolnum>8</manvolnum>
  6. </refmeta>
  7. <refnamediv>
  8. <refname>wpa_cli</refname>
  9. <refpurpose>WPA command line client</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <cmdsynopsis>
  13. <command>wpa_cli</command>
  14. <arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
  15. <arg>-g <replaceable>path to global ctrl_interface socket</replaceable></arg>
  16. <arg>-i <replaceable>ifname</replaceable></arg>
  17. <arg>-hvB</arg>
  18. <arg>-a <replaceable>action file</replaceable></arg>
  19. <arg>-P <replaceable>pid file</replaceable></arg>
  20. <arg>-G <replaceable>ping interval</replaceable></arg>
  21. <arg><replaceable>command ...</replaceable></arg>
  22. </cmdsynopsis>
  23. </refsynopsisdiv>
  24. <refsect1>
  25. <title>Overview</title>
  26. <para>wpa_cli is a text-based frontend program for interacting
  27. with wpa_supplicant. It is used to query current status, change
  28. configuration, trigger events, and request interactive user
  29. input.</para>
  30. <para>wpa_cli can show the current authentication status, selected
  31. security mode, dot11 and dot1x MIBs, etc. In addition, it can
  32. configure some variables like EAPOL state machine parameters and
  33. trigger events like reassociation and IEEE 802.1X
  34. logoff/logon. wpa_cli provides a user interface to request
  35. authentication information, like username and password, if these
  36. are not included in the configuration. This can be used to
  37. implement, e.g., one-time-passwords or generic token card
  38. authentication where the authentication is based on a
  39. challenge-response that uses an external device for generating the
  40. response.</para>
  41. <para>The control interface of wpa_supplicant can be configured to
  42. allow non-root user access (ctrl_interface GROUP= parameter in the
  43. configuration file). This makes it possible to run wpa_cli with a
  44. normal user account.</para>
  45. <para>wpa_cli supports two modes: interactive and command
  46. line. Both modes share the same command set and the main
  47. difference is in interactive mode providing access to unsolicited
  48. messages (event messages, username/password requests).</para>
  49. <para>Interactive mode is started when wpa_cli is executed without
  50. including the command as a command line parameter. Commands are
  51. then entered on the wpa_cli prompt. In command line mode, the same
  52. commands are entered as command line arguments for wpa_cli.</para>
  53. </refsect1>
  54. <refsect1>
  55. <title>Interactive authentication parameters request</title>
  56. <para>When wpa_supplicant need authentication parameters, like
  57. username and password, which are not present in the configuration
  58. file, it sends a request message to all attached frontend programs,
  59. e.g., wpa_cli in interactive mode. wpa_cli shows these requests
  60. with "CTRL-REQ-&lt;type&gt;-&lt;id&gt;:&lt;text&gt;"
  61. prefix. &lt;type&gt; is IDENTITY, PASSWORD, or OTP
  62. (one-time-password). &lt;id&gt; is a unique identifier for the
  63. current network. &lt;text&gt; is description of the request. In
  64. case of OTP request, it includes the challenge from the
  65. authentication server.</para>
  66. <para>The reply to these requests can be given with
  67. <emphasis>identity</emphasis>, <emphasis>password</emphasis>, and
  68. <emphasis>otp</emphasis> commands. &lt;id&gt; needs to be copied from
  69. the matching request. <emphasis>password</emphasis> and
  70. <emphasis>otp</emphasis> commands can be used regardless of whether
  71. the request was for PASSWORD or OTP. The main difference between these
  72. two commands is that values given with <emphasis>password</emphasis> are
  73. remembered as long as wpa_supplicant is running whereas values given
  74. with <emphasis>otp</emphasis> are used only once and then forgotten,
  75. i.e., wpa_supplicant will ask frontend for a new value for every use.
  76. This can be used to implement one-time-password lists and generic token
  77. card -based authentication.</para>
  78. <para>Example request for password and a matching reply:</para>
  79. <blockquote><programlisting>
  80. CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
  81. > password 1 mysecretpassword
  82. </programlisting></blockquote>
  83. <para>Example request for generic token card challenge-response:</para>
  84. <blockquote><programlisting>
  85. CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
  86. > otp 2 9876
  87. </programlisting></blockquote>
  88. </refsect1>
  89. <refsect1>
  90. <title>Command Arguments</title>
  91. <variablelist>
  92. <varlistentry>
  93. <term>-p path</term>
  94. <listitem><para>Change the path where control sockets should
  95. be found.</para></listitem>
  96. </varlistentry>
  97. <varlistentry>
  98. <term>-g control socket path</term>
  99. <listitem><para>Connect to the global control socket at the
  100. indicated path rather than an interface-specific control
  101. socket.</para></listitem>
  102. </varlistentry>
  103. <varlistentry>
  104. <term>-i ifname</term>
  105. <listitem><para>Specify the interface that is being
  106. configured. By default, choose the first interface found with
  107. a control socket in the socket path.</para></listitem>
  108. </varlistentry>
  109. <varlistentry>
  110. <term>-h</term>
  111. <listitem><para>Help. Show a usage message.</para></listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term>-v</term>
  115. <listitem><para>Show version information.</para></listitem>
  116. </varlistentry>
  117. <varlistentry>
  118. <term>-B</term>
  119. <listitem><para>Run as a daemon in the background.</para></listitem>
  120. </varlistentry>
  121. <varlistentry>
  122. <term>-a file</term>
  123. <listitem><para>Run in daemon mode executing the action file
  124. based on events from wpa_supplicant. The specified file will
  125. be executed with the first argument set to interface name and
  126. second to "CONNECTED" or "DISCONNECTED" depending on the event.
  127. This can be used to execute networking tools required to configure
  128. the interface.</para>
  129. <para>Additionally, three environmental variables are available to
  130. the file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR
  131. contains the absolute path to the ctrl_interface socket. WPA_ID
  132. contains the unique network_id identifier assigned to the active
  133. network, and WPA_ID_STR contains the content of the id_str option.
  134. </para></listitem>
  135. </varlistentry>
  136. <varlistentry>
  137. <term>-P file</term>
  138. <listitem><para>Set the location of the PID
  139. file.</para></listitem>
  140. </varlistentry>
  141. <varlistentry>
  142. <term>-G ping interval</term>
  143. <listitem><para>Set the interval (in seconds) at which
  144. wpa_cli pings the supplicant.</para></listitem>
  145. </varlistentry>
  146. <varlistentry>
  147. <term>command</term>
  148. <listitem><para>Run a command. The available commands are
  149. listed in the next section.</para></listitem>
  150. </varlistentry>
  151. </variablelist>
  152. </refsect1>
  153. <refsect1>
  154. <title>Commands</title>
  155. <para>The following commands are available:</para>
  156. <variablelist>
  157. <varlistentry>
  158. <term>status</term>
  159. <listitem>
  160. <para>get current WPA/EAPOL/EAP status</para>
  161. </listitem>
  162. </varlistentry>
  163. <varlistentry>
  164. <term>mib</term>
  165. <listitem>
  166. <para>get MIB variables (dot1x, dot11)</para>
  167. </listitem>
  168. </varlistentry>
  169. <varlistentry>
  170. <term>help</term>
  171. <listitem>
  172. <para>show this usage help</para>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry>
  176. <term>interface [ifname]</term>
  177. <listitem>
  178. <para>show interfaces/select interface</para>
  179. </listitem>
  180. </varlistentry>
  181. <varlistentry>
  182. <term>level &lt;debug level&gt;</term>
  183. <listitem>
  184. <para>change debug level</para>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry>
  188. <term>license</term>
  189. <listitem>
  190. <para>show full wpa_cli license</para>
  191. </listitem>
  192. </varlistentry>
  193. <varlistentry>
  194. <term>logoff</term>
  195. <listitem>
  196. <para>IEEE 802.1X EAPOL state machine logoff</para>
  197. </listitem>
  198. </varlistentry>
  199. <varlistentry>
  200. <term>logon</term>
  201. <listitem>
  202. <para>IEEE 802.1X EAPOL state machine logon</para>
  203. </listitem>
  204. </varlistentry>
  205. <varlistentry>
  206. <term>set</term>
  207. <listitem>
  208. <para>set variables (shows list of variables when run without arguments)</para>
  209. </listitem>
  210. </varlistentry>
  211. <varlistentry>
  212. <term>pmksa</term>
  213. <listitem>
  214. <para>show PMKSA cache</para>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry>
  218. <term>reassociate</term>
  219. <listitem>
  220. <para>force reassociation</para>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry>
  224. <term>reconfigure</term>
  225. <listitem>
  226. <para>force wpa_supplicant to re-read its configuration file</para>
  227. </listitem>
  228. </varlistentry>
  229. <varlistentry>
  230. <term>preauthenticate &lt;BSSID&gt;</term>
  231. <listitem>
  232. <para>force preauthentication</para>
  233. </listitem>
  234. </varlistentry>
  235. <varlistentry>
  236. <term>identity &lt;network id&gt; &lt;identity&gt;</term>
  237. <listitem>
  238. <para>configure identity for an SSID</para>
  239. </listitem>
  240. </varlistentry>
  241. <varlistentry>
  242. <term>password &lt;network id&gt; &lt;password&gt;</term>
  243. <listitem>
  244. <para>configure password for an SSID</para>
  245. </listitem>
  246. </varlistentry>
  247. <varlistentry>
  248. <term>pin &lt;network id&gt; &lt;pin&gt;</term>
  249. <listitem>
  250. <para>configure pin for an SSID</para>
  251. </listitem>
  252. </varlistentry>
  253. <varlistentry>
  254. <term>otp &lt;network id&gt; &lt;password&gt;</term>
  255. <listitem>
  256. <para>configure one-time-password for an SSID</para>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry>
  260. <term>bssid &lt;network id&gt; &lt;BSSID&gt;</term>
  261. <listitem>
  262. <para>set preferred BSSID for an SSID</para>
  263. </listitem>
  264. </varlistentry>
  265. <varlistentry>
  266. <term>list_networks</term>
  267. <listitem>
  268. <para>list configured networks</para>
  269. </listitem>
  270. </varlistentry>
  271. <varlistentry>
  272. <term>terminate</term>
  273. <listitem>
  274. <para>terminate <command>wpa_supplicant</command></para>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry>
  278. <term>quit</term>
  279. <listitem><para>exit wpa_cli</para></listitem>
  280. </varlistentry>
  281. </variablelist>
  282. </refsect1>
  283. <refsect1>
  284. <title>See Also</title>
  285. <para>
  286. <citerefentry>
  287. <refentrytitle>wpa_supplicant</refentrytitle>
  288. <manvolnum>8</manvolnum>
  289. </citerefentry>
  290. </para>
  291. </refsect1>
  292. <refsect1>
  293. <title>Legal</title>
  294. <para>wpa_supplicant is copyright (c) 2003-2017,
  295. Jouni Malinen <email>j@w1.fi</email> and
  296. contributors.
  297. All Rights Reserved.</para>
  298. <para>This program is licensed under the BSD license (the one with
  299. advertisement clause removed).</para>
  300. </refsect1>
  301. </refentry>