wpa_cli.sgml 9.8 KB

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