14bc52338SCy Schubertwpa_supplicant 239beb93cSSam Leffler============== 339beb93cSSam Leffler 4*a90b9d01SCy SchubertCopyright (c) 2003-2024, Jouni Malinen <j@w1.fi> and contributors 539beb93cSSam LefflerAll Rights Reserved. 639beb93cSSam Leffler 7f05cddf9SRui PauloThis program is licensed under the BSD license (the one with 8f05cddf9SRui Pauloadvertisement clause removed). 9f05cddf9SRui Paulo 10f05cddf9SRui PauloIf you are submitting changes to the project, please see CONTRIBUTIONS 11f05cddf9SRui Paulofile for more instructions. 1239beb93cSSam Leffler 1339beb93cSSam Leffler 1439beb93cSSam Leffler 1539beb93cSSam LefflerLicense 1639beb93cSSam Leffler------- 1739beb93cSSam Leffler 18f05cddf9SRui PauloThis software may be distributed, used, and modified under the terms of 19f05cddf9SRui PauloBSD license: 2039beb93cSSam Leffler 2139beb93cSSam LefflerRedistribution and use in source and binary forms, with or without 2239beb93cSSam Lefflermodification, are permitted provided that the following conditions are 2339beb93cSSam Lefflermet: 2439beb93cSSam Leffler 2539beb93cSSam Leffler1. Redistributions of source code must retain the above copyright 2639beb93cSSam Leffler notice, this list of conditions and the following disclaimer. 2739beb93cSSam Leffler 2839beb93cSSam Leffler2. Redistributions in binary form must reproduce the above copyright 2939beb93cSSam Leffler notice, this list of conditions and the following disclaimer in the 3039beb93cSSam Leffler documentation and/or other materials provided with the distribution. 3139beb93cSSam Leffler 3239beb93cSSam Leffler3. Neither the name(s) of the above-listed copyright holder(s) nor the 3339beb93cSSam Leffler names of its contributors may be used to endorse or promote products 3439beb93cSSam Leffler derived from this software without specific prior written permission. 3539beb93cSSam Leffler 3639beb93cSSam LefflerTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3739beb93cSSam Leffler"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3839beb93cSSam LefflerLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3939beb93cSSam LefflerA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 4039beb93cSSam LefflerOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4139beb93cSSam LefflerSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4239beb93cSSam LefflerLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 4339beb93cSSam LefflerDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 4439beb93cSSam LefflerTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 4539beb93cSSam Leffler(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 4639beb93cSSam LefflerOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4739beb93cSSam Leffler 4839beb93cSSam Leffler 4939beb93cSSam Leffler 5039beb93cSSam LefflerFeatures 5139beb93cSSam Leffler-------- 5239beb93cSSam Leffler 5339beb93cSSam LefflerSupported WPA/IEEE 802.11i features: 5439beb93cSSam Leffler- WPA-PSK ("WPA-Personal") 5539beb93cSSam Leffler- WPA with EAP (e.g., with RADIUS authentication server) ("WPA-Enterprise") 5639beb93cSSam Leffler Following authentication methods are supported with an integrate IEEE 802.1X 5739beb93cSSam Leffler Supplicant: 5839beb93cSSam Leffler * EAP-TLS 5939beb93cSSam Leffler * EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1) 6039beb93cSSam Leffler * EAP-PEAP/TLS (both PEAPv0 and PEAPv1) 6139beb93cSSam Leffler * EAP-PEAP/GTC (both PEAPv0 and PEAPv1) 6239beb93cSSam Leffler * EAP-PEAP/OTP (both PEAPv0 and PEAPv1) 6339beb93cSSam Leffler * EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1) 6439beb93cSSam Leffler * EAP-TTLS/EAP-MD5-Challenge 6539beb93cSSam Leffler * EAP-TTLS/EAP-GTC 6639beb93cSSam Leffler * EAP-TTLS/EAP-OTP 6739beb93cSSam Leffler * EAP-TTLS/EAP-MSCHAPv2 6839beb93cSSam Leffler * EAP-TTLS/EAP-TLS 6939beb93cSSam Leffler * EAP-TTLS/MSCHAPv2 7039beb93cSSam Leffler * EAP-TTLS/MSCHAP 7139beb93cSSam Leffler * EAP-TTLS/PAP 7239beb93cSSam Leffler * EAP-TTLS/CHAP 7339beb93cSSam Leffler * EAP-SIM 7439beb93cSSam Leffler * EAP-AKA 75780fb4a2SCy Schubert * EAP-AKA' 7639beb93cSSam Leffler * EAP-PSK 7739beb93cSSam Leffler * EAP-PAX 7839beb93cSSam Leffler * EAP-SAKE 7939beb93cSSam Leffler * EAP-IKEv2 8039beb93cSSam Leffler * EAP-GPSK 81780fb4a2SCy Schubert * EAP-pwd 8239beb93cSSam Leffler * LEAP (note: requires special support from the driver for IEEE 802.11 8339beb93cSSam Leffler authentication) 8439beb93cSSam Leffler (following methods are supported, but since they do not generate keying 8539beb93cSSam Leffler material, they cannot be used with WPA or IEEE 802.1X WEP keying) 8639beb93cSSam Leffler * EAP-MD5-Challenge 8739beb93cSSam Leffler * EAP-MSCHAPv2 8839beb93cSSam Leffler * EAP-GTC 8939beb93cSSam Leffler * EAP-OTP 9039beb93cSSam Leffler- key management for CCMP, TKIP, WEP104, WEP40 9139beb93cSSam Leffler- RSN/WPA2 (IEEE 802.11i) 9239beb93cSSam Leffler * pre-authentication 9339beb93cSSam Leffler * PMKSA caching 9439beb93cSSam Leffler 9539beb93cSSam LefflerSupported TLS/crypto libraries: 9639beb93cSSam Leffler- OpenSSL (default) 9739beb93cSSam Leffler- GnuTLS 9839beb93cSSam Leffler 9939beb93cSSam LefflerInternal TLS/crypto implementation (optional): 10039beb93cSSam Leffler- can be used in place of an external TLS/crypto library 10139beb93cSSam Leffler- TLSv1 10239beb93cSSam Leffler- X.509 certificate processing 10339beb93cSSam Leffler- PKCS #1 10439beb93cSSam Leffler- ASN.1 10539beb93cSSam Leffler- RSA 10639beb93cSSam Leffler- bignum 10739beb93cSSam Leffler- minimal size (ca. 50 kB binary, parts of which are already needed for WPA; 10839beb93cSSam Leffler TLSv1/X.509/ASN.1/RSA/bignum parts are about 25 kB on x86) 10939beb93cSSam Leffler 11039beb93cSSam Leffler 11139beb93cSSam LefflerRequirements 11239beb93cSSam Leffler------------ 11339beb93cSSam Leffler 11439beb93cSSam LefflerCurrent hardware/software requirements: 11539beb93cSSam Leffler- Linux kernel 2.4.x or 2.6.x with Linux Wireless Extensions v15 or newer 11639beb93cSSam Leffler- FreeBSD 6-CURRENT 11739beb93cSSam Leffler- NetBSD-current 11839beb93cSSam Leffler- Microsoft Windows with WinPcap (at least WinXP, may work with other versions) 11939beb93cSSam Leffler- drivers: 1205b9c547cSRui Paulo Linux drivers that support cfg80211/nl80211. Even though there are 12139beb93cSSam Leffler number of driver specific interface included in wpa_supplicant, please 1225b9c547cSRui Paulo note that Linux drivers are moving to use generic wireless configuration 1235b9c547cSRui Paulo interface driver_nl80211 (-Dnl80211 on wpa_supplicant command line) 1245b9c547cSRui Paulo should be the default option to start with before falling back to driver 1255b9c547cSRui Paulo specific interface. 1265b9c547cSRui Paulo 1275b9c547cSRui Paulo Linux drivers that support WPA/WPA2 configuration with the generic 1285b9c547cSRui Paulo Linux wireless extensions (WE-18 or newer). Obsoleted by nl80211. 12939beb93cSSam Leffler 13039beb93cSSam Leffler In theory, any driver that supports Linux wireless extensions can be 13139beb93cSSam Leffler used with IEEE 802.1X (i.e., not WPA) when using ap_scan=0 option in 13239beb93cSSam Leffler configuration file. 13339beb93cSSam Leffler 13439beb93cSSam Leffler Wired Ethernet drivers (with ap_scan=0) 13539beb93cSSam Leffler 13639beb93cSSam Leffler BSD net80211 layer (e.g., Atheros driver) 13739beb93cSSam Leffler At the moment, this is for FreeBSD 6-CURRENT branch and NetBSD-current. 13839beb93cSSam Leffler 13939beb93cSSam Leffler Windows NDIS 14039beb93cSSam Leffler The current Windows port requires WinPcap (http://winpcap.polito.it/). 14139beb93cSSam Leffler See README-Windows.txt for more information. 14239beb93cSSam Leffler 14339beb93cSSam Lefflerwpa_supplicant was designed to be portable for different drivers and 14439beb93cSSam Leffleroperating systems. Hopefully, support for more wlan cards and OSes will be 14539beb93cSSam Leffleradded in the future. See developer's documentation 14639beb93cSSam Leffler(http://hostap.epitest.fi/wpa_supplicant/devel/) for more information about the 14739beb93cSSam Lefflerdesign of wpa_supplicant and porting to other drivers. One main goal 14839beb93cSSam Leffleris to add full WPA/WPA2 support to Linux wireless extensions to allow 14939beb93cSSam Lefflernew drivers to be supported without having to implement new 15039beb93cSSam Lefflerdriver-specific interface code in wpa_supplicant. 15139beb93cSSam Leffler 15239beb93cSSam LefflerOptional libraries for layer2 packet processing: 15339beb93cSSam Leffler- libpcap (tested with 0.7.2, most relatively recent versions assumed to work, 15439beb93cSSam Leffler this is likely to be available with most distributions, 15539beb93cSSam Leffler http://tcpdump.org/) 15639beb93cSSam Leffler- libdnet (tested with v1.4, most versions assumed to work, 15739beb93cSSam Leffler http://libdnet.sourceforge.net/) 15839beb93cSSam Leffler 15939beb93cSSam LefflerThese libraries are _not_ used in the default Linux build. Instead, 16039beb93cSSam Lefflerinternal Linux specific implementation is used. libpcap/libdnet are 16139beb93cSSam Lefflermore portable and they can be used by adding CONFIG_L2_PACKET=pcap into 16239beb93cSSam Leffler.config. They may also be selected automatically for other operating 16339beb93cSSam Lefflersystems. In case of Windows builds, WinPcap is used by default 16439beb93cSSam Leffler(CONFIG_L2_PACKET=winpcap). 16539beb93cSSam Leffler 16639beb93cSSam Leffler 16739beb93cSSam LefflerOptional libraries for EAP-TLS, EAP-PEAP, and EAP-TTLS: 168780fb4a2SCy Schubert- OpenSSL (tested with 1.0.1 and 1.0.2 versions; assumed to 16939beb93cSSam Leffler work with most relatively recent versions; this is likely to be 17039beb93cSSam Leffler available with most distributions, http://www.openssl.org/) 17139beb93cSSam Leffler- GnuTLS 17239beb93cSSam Leffler- internal TLSv1 implementation 17339beb93cSSam Leffler 17439beb93cSSam LefflerOne of these libraries is needed when EAP-TLS, EAP-PEAP, EAP-TTLS, or 17539beb93cSSam LefflerEAP-FAST support is enabled. WPA-PSK mode does not require this or EAPOL/EAP 17639beb93cSSam Lefflerimplementation. A configuration file, .config, for compilation is 17739beb93cSSam Lefflerneeded to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5, 17839beb93cSSam LefflerEAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so 17939beb93cSSam Lefflerthey should only be enabled if testing the EAPOL/EAP state 18039beb93cSSam Lefflermachines. However, there can be used as inner authentication 18139beb93cSSam Leffleralgorithms with EAP-PEAP and EAP-TTLS. 18239beb93cSSam Leffler 18339beb93cSSam LefflerSee Building and installing section below for more detailed 18439beb93cSSam Lefflerinformation about the wpa_supplicant build time configuration. 18539beb93cSSam Leffler 18639beb93cSSam Leffler 18739beb93cSSam Leffler 18839beb93cSSam LefflerWPA 18939beb93cSSam Leffler--- 19039beb93cSSam Leffler 19139beb93cSSam LefflerThe original security mechanism of IEEE 802.11 standard was not 19239beb93cSSam Lefflerdesigned to be strong and has proven to be insufficient for most 19339beb93cSSam Lefflernetworks that require some kind of security. Task group I (Security) 19439beb93cSSam Lefflerof IEEE 802.11 working group (http://www.ieee802.org/11/) has worked 19539beb93cSSam Lefflerto address the flaws of the base standard and has in practice 19639beb93cSSam Lefflercompleted its work in May 2004. The IEEE 802.11i amendment to the IEEE 19739beb93cSSam Leffler802.11 standard was approved in June 2004 and published in July 2004. 19839beb93cSSam Leffler 19939beb93cSSam LefflerWi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the 20039beb93cSSam LefflerIEEE 802.11i work (draft 3.0) to define a subset of the security 20139beb93cSSam Lefflerenhancements that can be implemented with existing wlan hardware. This 20239beb93cSSam Leffleris called Wi-Fi Protected Access<TM> (WPA). This has now become a 20339beb93cSSam Lefflermandatory component of interoperability testing and certification done 20439beb93cSSam Lefflerby Wi-Fi Alliance. Wi-Fi provides information about WPA at its web 20539beb93cSSam Lefflersite (http://www.wi-fi.org/OpenSection/protected_access.asp). 20639beb93cSSam Leffler 20739beb93cSSam LefflerIEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm 20839beb93cSSam Lefflerfor protecting wireless networks. WEP uses RC4 with 40-bit keys, 20939beb93cSSam Leffler24-bit initialization vector (IV), and CRC32 to protect against packet 21039beb93cSSam Lefflerforgery. All these choices have proven to be insufficient: key space is 21139beb93cSSam Lefflertoo small against current attacks, RC4 key scheduling is insufficient 21239beb93cSSam Leffler(beginning of the pseudorandom stream should be skipped), IV space is 21339beb93cSSam Lefflertoo small and IV reuse makes attacks easier, there is no replay 21439beb93cSSam Lefflerprotection, and non-keyed authentication does not protect against bit 21539beb93cSSam Lefflerflipping packet data. 21639beb93cSSam Leffler 21739beb93cSSam LefflerWPA is an intermediate solution for the security issues. It uses 21839beb93cSSam LefflerTemporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a 21939beb93cSSam Lefflercompromise on strong security and possibility to use existing 22039beb93cSSam Lefflerhardware. It still uses RC4 for the encryption like WEP, but with 22139beb93cSSam Lefflerper-packet RC4 keys. In addition, it implements replay protection, 22239beb93cSSam Lefflerkeyed packet authentication mechanism (Michael MIC). 22339beb93cSSam Leffler 22439beb93cSSam LefflerKeys can be managed using two different mechanisms. WPA can either use 22539beb93cSSam Leffleran external authentication server (e.g., RADIUS) and EAP just like 22639beb93cSSam LefflerIEEE 802.1X is using or pre-shared keys without need for additional 22739beb93cSSam Lefflerservers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal", 22839beb93cSSam Lefflerrespectively. Both mechanisms will generate a master session key for 22939beb93cSSam Lefflerthe Authenticator (AP) and Supplicant (client station). 23039beb93cSSam Leffler 23139beb93cSSam LefflerWPA implements a new key handshake (4-Way Handshake and Group Key 23239beb93cSSam LefflerHandshake) for generating and exchanging data encryption keys between 23339beb93cSSam Lefflerthe Authenticator and Supplicant. This handshake is also used to 23439beb93cSSam Lefflerverify that both Authenticator and Supplicant know the master session 23539beb93cSSam Lefflerkey. These handshakes are identical regardless of the selected key 23639beb93cSSam Lefflermanagement mechanism (only the method for generating master session 23739beb93cSSam Lefflerkey changes). 23839beb93cSSam Leffler 23939beb93cSSam Leffler 24039beb93cSSam Leffler 24139beb93cSSam LefflerIEEE 802.11i / WPA2 24239beb93cSSam Leffler------------------- 24339beb93cSSam Leffler 24439beb93cSSam LefflerThe design for parts of IEEE 802.11i that were not included in WPA has 24539beb93cSSam Lefflerfinished (May 2004) and this amendment to IEEE 802.11 was approved in 24639beb93cSSam LefflerJune 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new 24739beb93cSSam Lefflerversion of WPA called WPA2. This includes, e.g., support for more 24839beb93cSSam Lefflerrobust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC) 24939beb93cSSam Lefflerto replace TKIP and optimizations for handoff (reduced number of 25039beb93cSSam Lefflermessages in initial key handshake, pre-authentication, and PMKSA caching). 25139beb93cSSam Leffler 25239beb93cSSam Leffler 25339beb93cSSam Leffler 25439beb93cSSam Lefflerwpa_supplicant 25539beb93cSSam Leffler-------------- 25639beb93cSSam Leffler 25739beb93cSSam Lefflerwpa_supplicant is an implementation of the WPA Supplicant component, 25839beb93cSSam Leffleri.e., the part that runs in the client stations. It implements WPA key 25939beb93cSSam Lefflernegotiation with a WPA Authenticator and EAP authentication with 26039beb93cSSam LefflerAuthentication Server. In addition, it controls the roaming and IEEE 26139beb93cSSam Leffler802.11 authentication/association of the wlan driver. 26239beb93cSSam Leffler 26339beb93cSSam Lefflerwpa_supplicant is designed to be a "daemon" program that runs in the 26439beb93cSSam Lefflerbackground and acts as the backend component controlling the wireless 26539beb93cSSam Lefflerconnection. wpa_supplicant supports separate frontend programs and an 26639beb93cSSam Lefflerexample text-based frontend, wpa_cli, is included with wpa_supplicant. 26739beb93cSSam Leffler 26839beb93cSSam LefflerFollowing steps are used when associating with an AP using WPA: 26939beb93cSSam Leffler 27039beb93cSSam Leffler- wpa_supplicant requests the kernel driver to scan neighboring BSSes 27139beb93cSSam Leffler- wpa_supplicant selects a BSS based on its configuration 27239beb93cSSam Leffler- wpa_supplicant requests the kernel driver to associate with the chosen 27339beb93cSSam Leffler BSS 27439beb93cSSam Leffler- If WPA-EAP: integrated IEEE 802.1X Supplicant completes EAP 27539beb93cSSam Leffler authentication with the authentication server (proxied by the 27639beb93cSSam Leffler Authenticator in the AP) 27739beb93cSSam Leffler- If WPA-EAP: master key is received from the IEEE 802.1X Supplicant 27839beb93cSSam Leffler- If WPA-PSK: wpa_supplicant uses PSK as the master session key 27939beb93cSSam Leffler- wpa_supplicant completes WPA 4-Way Handshake and Group Key Handshake 28039beb93cSSam Leffler with the Authenticator (AP) 28139beb93cSSam Leffler- wpa_supplicant configures encryption keys for unicast and broadcast 28239beb93cSSam Leffler- normal data packets can be transmitted and received 28339beb93cSSam Leffler 28439beb93cSSam Leffler 28539beb93cSSam Leffler 28639beb93cSSam LefflerBuilding and installing 28739beb93cSSam Leffler----------------------- 28839beb93cSSam Leffler 28939beb93cSSam LefflerIn order to be able to build wpa_supplicant, you will first need to 29039beb93cSSam Lefflerselect which parts of it will be included. This is done by creating a 29139beb93cSSam Lefflerbuild time configuration file, .config, in the wpa_supplicant root 29239beb93cSSam Lefflerdirectory. Configuration options are text lines using following 29339beb93cSSam Lefflerformat: CONFIG_<option>=y. Lines starting with # are considered 29439beb93cSSam Lefflercomments and are ignored. See defconfig file for an example configuration 29539beb93cSSam Lefflerand a list of available options and additional notes. 29639beb93cSSam Leffler 29739beb93cSSam LefflerThe build time configuration can be used to select only the needed 29839beb93cSSam Lefflerfeatures and limit the binary size and requirements for external 29939beb93cSSam Lefflerlibraries. The main configuration parts are the selection of which 300f05cddf9SRui Paulodriver interfaces (e.g., nl80211, wext, ..) and which authentication 30139beb93cSSam Lefflermethods (e.g., EAP-TLS, EAP-PEAP, ..) are included. 30239beb93cSSam Leffler 30339beb93cSSam LefflerFollowing build time configuration options are used to control IEEE 30439beb93cSSam Leffler802.1X/EAPOL and EAP state machines and all EAP methods. Including 30539beb93cSSam LefflerTLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSL 30639beb93cSSam Lefflerlibrary for TLS implementation. Alternatively, GnuTLS or the internal 307780fb4a2SCy SchubertTLSv1 implementation can be used for TLS functionality. 30839beb93cSSam Leffler 30939beb93cSSam LefflerCONFIG_IEEE8021X_EAPOL=y 31039beb93cSSam LefflerCONFIG_EAP_MD5=y 31139beb93cSSam LefflerCONFIG_EAP_MSCHAPV2=y 31239beb93cSSam LefflerCONFIG_EAP_TLS=y 31339beb93cSSam LefflerCONFIG_EAP_PEAP=y 31439beb93cSSam LefflerCONFIG_EAP_TTLS=y 31539beb93cSSam LefflerCONFIG_EAP_GTC=y 31639beb93cSSam LefflerCONFIG_EAP_OTP=y 31739beb93cSSam LefflerCONFIG_EAP_SIM=y 31839beb93cSSam LefflerCONFIG_EAP_AKA=y 319780fb4a2SCy SchubertCONFIG_EAP_AKA_PRIME=y 32039beb93cSSam LefflerCONFIG_EAP_PSK=y 32139beb93cSSam LefflerCONFIG_EAP_SAKE=y 32239beb93cSSam LefflerCONFIG_EAP_GPSK=y 32339beb93cSSam LefflerCONFIG_EAP_PAX=y 32439beb93cSSam LefflerCONFIG_EAP_LEAP=y 32539beb93cSSam LefflerCONFIG_EAP_IKEV2=y 326780fb4a2SCy SchubertCONFIG_EAP_PWD=y 32739beb93cSSam Leffler 32839beb93cSSam LefflerFollowing option can be used to include GSM SIM/USIM interface for GSM/UMTS 329780fb4a2SCy Schubertauthentication algorithm (for EAP-SIM/EAP-AKA/EAP-AKA'). This requires pcsc-lite 33039beb93cSSam Leffler(http://www.linuxnet.com/) for smart card access. 33139beb93cSSam Leffler 33239beb93cSSam LefflerCONFIG_PCSC=y 33339beb93cSSam Leffler 33439beb93cSSam LefflerFollowing options can be added to .config to select which driver 335f05cddf9SRui Paulointerfaces are included. 33639beb93cSSam Leffler 337f05cddf9SRui PauloCONFIG_DRIVER_NL80211=y 33839beb93cSSam LefflerCONFIG_DRIVER_WEXT=y 33939beb93cSSam LefflerCONFIG_DRIVER_BSD=y 34039beb93cSSam LefflerCONFIG_DRIVER_NDIS=y 34139beb93cSSam Leffler 342f05cddf9SRui PauloFollowing example includes some more features and driver interfaces that 343f05cddf9SRui Pauloare included in the wpa_supplicant package: 34439beb93cSSam Leffler 345f05cddf9SRui PauloCONFIG_DRIVER_NL80211=y 34639beb93cSSam LefflerCONFIG_DRIVER_WEXT=y 34739beb93cSSam LefflerCONFIG_DRIVER_BSD=y 34839beb93cSSam LefflerCONFIG_DRIVER_NDIS=y 34939beb93cSSam LefflerCONFIG_IEEE8021X_EAPOL=y 35039beb93cSSam LefflerCONFIG_EAP_MD5=y 35139beb93cSSam LefflerCONFIG_EAP_MSCHAPV2=y 35239beb93cSSam LefflerCONFIG_EAP_TLS=y 35339beb93cSSam LefflerCONFIG_EAP_PEAP=y 35439beb93cSSam LefflerCONFIG_EAP_TTLS=y 35539beb93cSSam LefflerCONFIG_EAP_GTC=y 35639beb93cSSam LefflerCONFIG_EAP_OTP=y 35739beb93cSSam LefflerCONFIG_EAP_SIM=y 35839beb93cSSam LefflerCONFIG_EAP_AKA=y 35939beb93cSSam LefflerCONFIG_EAP_PSK=y 36039beb93cSSam LefflerCONFIG_EAP_SAKE=y 36139beb93cSSam LefflerCONFIG_EAP_GPSK=y 36239beb93cSSam LefflerCONFIG_EAP_PAX=y 36339beb93cSSam LefflerCONFIG_EAP_LEAP=y 36439beb93cSSam LefflerCONFIG_EAP_IKEV2=y 36539beb93cSSam LefflerCONFIG_PCSC=y 36639beb93cSSam Leffler 36739beb93cSSam LefflerEAP-PEAP and EAP-TTLS will automatically include configured EAP 36839beb93cSSam Lefflermethods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection. 36939beb93cSSam Leffler 37039beb93cSSam Leffler 37139beb93cSSam LefflerAfter you have created a configuration file, you can build 37239beb93cSSam Lefflerwpa_supplicant and wpa_cli with 'make' command. You may then install 37339beb93cSSam Lefflerthe binaries to a suitable system directory, e.g., /usr/local/bin. 37439beb93cSSam Leffler 37539beb93cSSam LefflerExample commands: 37639beb93cSSam Leffler 37739beb93cSSam Leffler# build wpa_supplicant and wpa_cli 37839beb93cSSam Lefflermake 37939beb93cSSam Leffler# install binaries (this may need root privileges) 38039beb93cSSam Lefflercp wpa_cli wpa_supplicant /usr/local/bin 38139beb93cSSam Leffler 38239beb93cSSam Leffler 38339beb93cSSam LefflerYou will need to make a configuration file, e.g., 38439beb93cSSam Leffler/etc/wpa_supplicant.conf, with network configuration for the networks 38539beb93cSSam Leffleryou are going to use. Configuration file section below includes 386c1d255d3SCy Schubertexplanation of the configuration file format and includes various 38739beb93cSSam Lefflerexamples. Once the configuration is ready, you can test whether the 38839beb93cSSam Lefflerconfiguration work by first running wpa_supplicant with following 38939beb93cSSam Lefflercommand to start it on foreground with debugging enabled: 39039beb93cSSam Leffler 39139beb93cSSam Lefflerwpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d 39239beb93cSSam Leffler 39339beb93cSSam LefflerAssuming everything goes fine, you can start using following command 39439beb93cSSam Lefflerto start wpa_supplicant on background without debugging: 39539beb93cSSam Leffler 39639beb93cSSam Lefflerwpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B 39739beb93cSSam Leffler 39839beb93cSSam LefflerPlease note that if you included more than one driver interface in the 39939beb93cSSam Lefflerbuild time configuration (.config), you may need to specify which 40039beb93cSSam Lefflerinterface to use by including -D<driver name> option on the command 40139beb93cSSam Lefflerline. See following section for more details on command line options 40239beb93cSSam Lefflerfor wpa_supplicant. 40339beb93cSSam Leffler 40439beb93cSSam Leffler 40539beb93cSSam Leffler 40639beb93cSSam LefflerCommand line options 40739beb93cSSam Leffler-------------------- 40839beb93cSSam Leffler 40939beb93cSSam Lefflerusage: 410780fb4a2SCy Schubert wpa_supplicant [-BddfhKLqqtuvW] [-P<pid file>] [-g<global ctrl>] \ 4115b9c547cSRui Paulo [-G<group>] \ 41239beb93cSSam Leffler -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \ 413780fb4a2SCy Schubert [-b<br_ifname> [-MN -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \ 4145b9c547cSRui Paulo [-p<driver_param>] [-b<br_ifname>] [-m<P2P Device config file>] ... 41539beb93cSSam Leffler 41639beb93cSSam Leffleroptions: 41739beb93cSSam Leffler -b = optional bridge interface name 41839beb93cSSam Leffler -B = run daemon in the background 41939beb93cSSam Leffler -c = Configuration file 42039beb93cSSam Leffler -C = ctrl_interface parameter (only used if -c is not) 42139beb93cSSam Leffler -i = interface name 42239beb93cSSam Leffler -d = increase debugging verbosity (-dd even more) 423e28a4053SRui Paulo -D = driver name (can be multiple drivers: nl80211,wext) 42439beb93cSSam Leffler -f = Log output to default log location (normally /tmp) 42539beb93cSSam Leffler -g = global ctrl_interface 4265b9c547cSRui Paulo -G = global ctrl_interface group 42739beb93cSSam Leffler -K = include keys (passwords, etc.) in debug output 42839beb93cSSam Leffler -t = include timestamp in debug messages 42939beb93cSSam Leffler -h = show this help text 430f05cddf9SRui Paulo -L = show license (BSD) 43139beb93cSSam Leffler -p = driver parameters 43239beb93cSSam Leffler -P = PID file 43339beb93cSSam Leffler -q = decrease debugging verbosity (-qq even less) 43439beb93cSSam Leffler -u = enable DBus control interface 43539beb93cSSam Leffler -v = show version 43639beb93cSSam Leffler -W = wait for a control interface monitor before starting 437780fb4a2SCy Schubert -M = start describing matching interface 43839beb93cSSam Leffler -N = start describing new interface 4395b9c547cSRui Paulo -m = Configuration file for the P2P Device 44039beb93cSSam Leffler 44139beb93cSSam Lefflerdrivers: 4425b9c547cSRui Paulo nl80211 = Linux nl80211/cfg80211 44339beb93cSSam Leffler wext = Linux wireless extensions (generic) 44439beb93cSSam Leffler wired = wpa_supplicant wired Ethernet driver 445*a90b9d01SCy Schubert macsec_linux = MACsec Ethernet driver for Linux 44639beb93cSSam Leffler roboswitch = wpa_supplicant Broadcom switch driver 447*a90b9d01SCy Schubert none = no driver (RADIUS server/WPS ER only) 44839beb93cSSam Leffler bsd = BSD 802.11 support (Atheros, etc.) 44939beb93cSSam Leffler ndis = Windows NDIS driver 45039beb93cSSam Leffler 45139beb93cSSam LefflerIn most common cases, wpa_supplicant is started with 45239beb93cSSam Leffler 45339beb93cSSam Lefflerwpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 45439beb93cSSam Leffler 45539beb93cSSam LefflerThis makes the process fork into background. 45639beb93cSSam Leffler 45739beb93cSSam LefflerThe easiest way to debug problems, and to get debug log for bug 45839beb93cSSam Lefflerreports, is to start wpa_supplicant on foreground with debugging 45939beb93cSSam Lefflerenabled: 46039beb93cSSam Leffler 46139beb93cSSam Lefflerwpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d 46239beb93cSSam Leffler 463e28a4053SRui PauloIf the specific driver wrapper is not known beforehand, it is possible 464e28a4053SRui Pauloto specify multiple comma separated driver wrappers on the command 465e28a4053SRui Pauloline. wpa_supplicant will use the first driver wrapper that is able to 466e28a4053SRui Pauloinitialize the interface. 467e28a4053SRui Paulo 468e28a4053SRui Paulowpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0 469e28a4053SRui Paulo 47039beb93cSSam Leffler 47139beb93cSSam Lefflerwpa_supplicant can control multiple interfaces (radios) either by 47239beb93cSSam Lefflerrunning one process for each interface separately or by running just 47339beb93cSSam Lefflerone process and list of options at command line. Each interface is 47439beb93cSSam Lefflerseparated with -N argument. As an example, following command would 47539beb93cSSam Lefflerstart wpa_supplicant for two interfaces: 47639beb93cSSam Leffler 47739beb93cSSam Lefflerwpa_supplicant \ 478f05cddf9SRui Paulo -c wpa1.conf -i wlan0 -D nl80211 -N \ 479f05cddf9SRui Paulo -c wpa2.conf -i wlan1 -D wext 48039beb93cSSam Leffler 48139beb93cSSam Leffler 482780fb4a2SCy SchubertIf the interfaces on which wpa_supplicant is to run are not known or do 483780fb4a2SCy Schubertnot exist, wpa_supplicant can match an interface when it arrives. Each 484780fb4a2SCy Schubertmatched interface is separated with -M argument and the -i argument now 485780fb4a2SCy Schubertallows for pattern matching. 486780fb4a2SCy Schubert 487780fb4a2SCy SchubertAs an example, the following command would start wpa_supplicant for a 488780fb4a2SCy Schubertspecific wired interface called lan0, any interface starting with wlan 489780fb4a2SCy Schubertand lastly any other interface. Each match has its own configuration 490780fb4a2SCy Schubertfile, and for the wired interface a specific driver has also been given. 491780fb4a2SCy Schubert 492780fb4a2SCy Schubertwpa_supplicant \ 493780fb4a2SCy Schubert -M -c wpa_wired.conf -ilan0 -D wired \ 494780fb4a2SCy Schubert -M -c wpa1.conf -iwlan* \ 495780fb4a2SCy Schubert -M -c wpa2.conf 496780fb4a2SCy Schubert 497780fb4a2SCy Schubert 49839beb93cSSam LefflerIf the interface is added in a Linux bridge (e.g., br0), the bridge 49939beb93cSSam Lefflerinterface needs to be configured to wpa_supplicant in addition to the 50039beb93cSSam Lefflermain interface: 50139beb93cSSam Leffler 5025b9c547cSRui Paulowpa_supplicant -cw.conf -Dnl80211 -iwlan0 -bbr0 50339beb93cSSam Leffler 50439beb93cSSam Leffler 50539beb93cSSam LefflerConfiguration file 50639beb93cSSam Leffler------------------ 50739beb93cSSam Leffler 50839beb93cSSam Lefflerwpa_supplicant is configured using a text file that lists all accepted 50939beb93cSSam Lefflernetworks and security policies, including pre-shared keys. See 51039beb93cSSam Lefflerexample configuration file, wpa_supplicant.conf, for detailed 51139beb93cSSam Lefflerinformation about the configuration format and supported fields. 51239beb93cSSam Leffler 51339beb93cSSam LefflerChanges to configuration file can be reloaded be sending SIGHUP signal 51439beb93cSSam Lefflerto wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly, 51539beb93cSSam Lefflerreloading can be triggered with 'wpa_cli reconfigure' command. 51639beb93cSSam Leffler 51739beb93cSSam LefflerConfiguration file can include one or more network blocks, e.g., one 51839beb93cSSam Lefflerfor each used SSID. wpa_supplicant will automatically select the best 519780fb4a2SCy Schubertnetwork based on the order of network blocks in the configuration 52039beb93cSSam Lefflerfile, network security level (WPA/WPA2 is preferred), and signal 52139beb93cSSam Lefflerstrength. 52239beb93cSSam Leffler 52339beb93cSSam LefflerExample configuration files for some common configurations: 52439beb93cSSam Leffler 52539beb93cSSam Leffler1) WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work 52639beb93cSSam Leffler network 52739beb93cSSam Leffler 52839beb93cSSam Leffler# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group 52939beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 53039beb93cSSam Lefflerctrl_interface_group=wheel 53139beb93cSSam Leffler# 53239beb93cSSam Leffler# home network; allow all valid ciphers 53339beb93cSSam Lefflernetwork={ 53439beb93cSSam Leffler ssid="home" 53539beb93cSSam Leffler scan_ssid=1 53639beb93cSSam Leffler key_mgmt=WPA-PSK 53739beb93cSSam Leffler psk="very secret passphrase" 53839beb93cSSam Leffler} 53939beb93cSSam Leffler# 54039beb93cSSam Leffler# work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers 54139beb93cSSam Lefflernetwork={ 54239beb93cSSam Leffler ssid="work" 54339beb93cSSam Leffler scan_ssid=1 54439beb93cSSam Leffler key_mgmt=WPA-EAP 54539beb93cSSam Leffler pairwise=CCMP TKIP 54639beb93cSSam Leffler group=CCMP TKIP 54739beb93cSSam Leffler eap=TLS 54839beb93cSSam Leffler identity="user@example.com" 54939beb93cSSam Leffler ca_cert="/etc/cert/ca.pem" 55039beb93cSSam Leffler client_cert="/etc/cert/user.pem" 55139beb93cSSam Leffler private_key="/etc/cert/user.prv" 55239beb93cSSam Leffler private_key_passwd="password" 55339beb93cSSam Leffler} 55439beb93cSSam Leffler 55539beb93cSSam Leffler 55639beb93cSSam Leffler2) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel 55739beb93cSSam Leffler (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series) 55839beb93cSSam Leffler 55939beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 56039beb93cSSam Lefflerctrl_interface_group=wheel 56139beb93cSSam Lefflernetwork={ 56239beb93cSSam Leffler ssid="example" 56339beb93cSSam Leffler scan_ssid=1 56439beb93cSSam Leffler key_mgmt=WPA-EAP 56539beb93cSSam Leffler eap=PEAP 56639beb93cSSam Leffler identity="user@example.com" 56739beb93cSSam Leffler password="foobar" 56839beb93cSSam Leffler ca_cert="/etc/cert/ca.pem" 56939beb93cSSam Leffler phase1="peaplabel=0" 57039beb93cSSam Leffler phase2="auth=MSCHAPV2" 57139beb93cSSam Leffler} 57239beb93cSSam Leffler 57339beb93cSSam Leffler 57439beb93cSSam Leffler3) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the 57539beb93cSSam Leffler unencrypted use. Real identity is sent only within an encrypted TLS tunnel. 57639beb93cSSam Leffler 57739beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 57839beb93cSSam Lefflerctrl_interface_group=wheel 57939beb93cSSam Lefflernetwork={ 58039beb93cSSam Leffler ssid="example" 58139beb93cSSam Leffler scan_ssid=1 58239beb93cSSam Leffler key_mgmt=WPA-EAP 58339beb93cSSam Leffler eap=TTLS 58439beb93cSSam Leffler identity="user@example.com" 58539beb93cSSam Leffler anonymous_identity="anonymous@example.com" 58639beb93cSSam Leffler password="foobar" 58739beb93cSSam Leffler ca_cert="/etc/cert/ca.pem" 58839beb93cSSam Leffler phase2="auth=MD5" 58939beb93cSSam Leffler} 59039beb93cSSam Leffler 59139beb93cSSam Leffler 59239beb93cSSam Leffler4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and 59339beb93cSSam Leffler broadcast); use EAP-TLS for authentication 59439beb93cSSam Leffler 59539beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 59639beb93cSSam Lefflerctrl_interface_group=wheel 59739beb93cSSam Lefflernetwork={ 59839beb93cSSam Leffler ssid="1x-test" 59939beb93cSSam Leffler scan_ssid=1 60039beb93cSSam Leffler key_mgmt=IEEE8021X 60139beb93cSSam Leffler eap=TLS 60239beb93cSSam Leffler identity="user@example.com" 60339beb93cSSam Leffler ca_cert="/etc/cert/ca.pem" 60439beb93cSSam Leffler client_cert="/etc/cert/user.pem" 60539beb93cSSam Leffler private_key="/etc/cert/user.prv" 60639beb93cSSam Leffler private_key_passwd="password" 60739beb93cSSam Leffler eapol_flags=3 60839beb93cSSam Leffler} 60939beb93cSSam Leffler 61039beb93cSSam Leffler 61139beb93cSSam Leffler5) Catch all example that allows more or less all configuration modes. The 61239beb93cSSam Leffler configuration options are used based on what security policy is used in the 61339beb93cSSam Leffler selected SSID. This is mostly for testing and is not recommended for normal 61439beb93cSSam Leffler use. 61539beb93cSSam Leffler 61639beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 61739beb93cSSam Lefflerctrl_interface_group=wheel 61839beb93cSSam Lefflernetwork={ 61939beb93cSSam Leffler ssid="example" 62039beb93cSSam Leffler scan_ssid=1 62139beb93cSSam Leffler key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE 62239beb93cSSam Leffler pairwise=CCMP TKIP 62339beb93cSSam Leffler group=CCMP TKIP WEP104 WEP40 62439beb93cSSam Leffler psk="very secret passphrase" 62539beb93cSSam Leffler eap=TTLS PEAP TLS 62639beb93cSSam Leffler identity="user@example.com" 62739beb93cSSam Leffler password="foobar" 62839beb93cSSam Leffler ca_cert="/etc/cert/ca.pem" 62939beb93cSSam Leffler client_cert="/etc/cert/user.pem" 63039beb93cSSam Leffler private_key="/etc/cert/user.prv" 63139beb93cSSam Leffler private_key_passwd="password" 63239beb93cSSam Leffler phase1="peaplabel=0" 63339beb93cSSam Leffler ca_cert2="/etc/cert/ca2.pem" 63439beb93cSSam Leffler client_cert2="/etc/cer/user.pem" 63539beb93cSSam Leffler private_key2="/etc/cer/user.prv" 63639beb93cSSam Leffler private_key2_passwd="password" 63739beb93cSSam Leffler} 63839beb93cSSam Leffler 63939beb93cSSam Leffler 64039beb93cSSam Leffler6) Authentication for wired Ethernet. This can be used with 'wired' or 64139beb93cSSam Leffler 'roboswitch' interface (-Dwired or -Droboswitch on command line). 64239beb93cSSam Leffler 64339beb93cSSam Lefflerctrl_interface=/var/run/wpa_supplicant 64439beb93cSSam Lefflerctrl_interface_group=wheel 64539beb93cSSam Lefflerap_scan=0 64639beb93cSSam Lefflernetwork={ 64739beb93cSSam Leffler key_mgmt=IEEE8021X 64839beb93cSSam Leffler eap=MD5 64939beb93cSSam Leffler identity="user" 65039beb93cSSam Leffler password="password" 65139beb93cSSam Leffler eapol_flags=0 65239beb93cSSam Leffler} 65339beb93cSSam Leffler 65439beb93cSSam Leffler 65539beb93cSSam Leffler 65639beb93cSSam LefflerCertificates 65739beb93cSSam Leffler------------ 65839beb93cSSam Leffler 65939beb93cSSam LefflerSome EAP authentication methods require use of certificates. EAP-TLS 66039beb93cSSam Leffleruses both server side and client certificates whereas EAP-PEAP and 66139beb93cSSam LefflerEAP-TTLS only require the server side certificate. When client 66239beb93cSSam Lefflercertificate is used, a matching private key file has to also be 66339beb93cSSam Lefflerincluded in configuration. If the private key uses a passphrase, this 66439beb93cSSam Lefflerhas to be configured in wpa_supplicant.conf ("private_key_passwd"). 66539beb93cSSam Leffler 66639beb93cSSam Lefflerwpa_supplicant supports X.509 certificates in PEM and DER 66739beb93cSSam Lefflerformats. User certificate and private key can be included in the same 66839beb93cSSam Lefflerfile. 66939beb93cSSam Leffler 67039beb93cSSam LefflerIf the user certificate and private key is received in PKCS#12/PFX 67139beb93cSSam Lefflerformat, they need to be converted to suitable PEM/DER format for 67239beb93cSSam Lefflerwpa_supplicant. This can be done, e.g., with following commands: 67339beb93cSSam Leffler 67439beb93cSSam Leffler# convert client certificate and private key to PEM format 67539beb93cSSam Leffleropenssl pkcs12 -in example.pfx -out user.pem -clcerts 67639beb93cSSam Leffler# convert CA certificate (if included in PFX file) to PEM format 67739beb93cSSam Leffleropenssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys 67839beb93cSSam Leffler 67939beb93cSSam Leffler 68039beb93cSSam Leffler 68139beb93cSSam Lefflerwpa_cli 68239beb93cSSam Leffler------- 68339beb93cSSam Leffler 68439beb93cSSam Lefflerwpa_cli is a text-based frontend program for interacting with 68539beb93cSSam Lefflerwpa_supplicant. It is used to query current status, change 68639beb93cSSam Lefflerconfiguration, trigger events, and request interactive user input. 68739beb93cSSam Leffler 68839beb93cSSam Lefflerwpa_cli can show the current authentication status, selected security 68939beb93cSSam Lefflermode, dot11 and dot1x MIBs, etc. In addition, it can configure some 69039beb93cSSam Lefflervariables like EAPOL state machine parameters and trigger events like 69139beb93cSSam Lefflerreassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user 69239beb93cSSam Lefflerinterface to request authentication information, like username and 69339beb93cSSam Lefflerpassword, if these are not included in the configuration. This can be 69439beb93cSSam Lefflerused to implement, e.g., one-time-passwords or generic token card 69539beb93cSSam Lefflerauthentication where the authentication is based on a 69639beb93cSSam Lefflerchallenge-response that uses an external device for generating the 69739beb93cSSam Lefflerresponse. 69839beb93cSSam Leffler 69939beb93cSSam LefflerThe control interface of wpa_supplicant can be configured to allow 70039beb93cSSam Lefflernon-root user access (ctrl_interface_group in the configuration 70139beb93cSSam Lefflerfile). This makes it possible to run wpa_cli with a normal user 70239beb93cSSam Leffleraccount. 70339beb93cSSam Leffler 70439beb93cSSam Lefflerwpa_cli supports two modes: interactive and command line. Both modes 70539beb93cSSam Lefflershare the same command set and the main difference is in interactive 70639beb93cSSam Lefflermode providing access to unsolicited messages (event messages, 70739beb93cSSam Lefflerusername/password requests). 70839beb93cSSam Leffler 70939beb93cSSam LefflerInteractive mode is started when wpa_cli is executed without including 71039beb93cSSam Lefflerthe command as a command line parameter. Commands are then entered on 71139beb93cSSam Lefflerthe wpa_cli prompt. In command line mode, the same commands are 71239beb93cSSam Lefflerentered as command line arguments for wpa_cli. 71339beb93cSSam Leffler 71439beb93cSSam Leffler 71539beb93cSSam LefflerInteractive authentication parameters request 71639beb93cSSam Leffler 71739beb93cSSam LefflerWhen wpa_supplicant need authentication parameters, like username and 71839beb93cSSam Lefflerpassword, which are not present in the configuration file, it sends a 71939beb93cSSam Lefflerrequest message to all attached frontend programs, e.g., wpa_cli in 72039beb93cSSam Lefflerinteractive mode. wpa_cli shows these requests with 72139beb93cSSam Leffler"CTRL-REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or 72239beb93cSSam LefflerOTP (one-time-password). <id> is a unique identifier for the current 72339beb93cSSam Lefflernetwork. <text> is description of the request. In case of OTP request, 72439beb93cSSam Lefflerit includes the challenge from the authentication server. 72539beb93cSSam Leffler 72639beb93cSSam LefflerThe reply to these requests can be given with 'identity', 'password', 72739beb93cSSam Lefflerand 'otp' commands. <id> needs to be copied from the the matching 72839beb93cSSam Lefflerrequest. 'password' and 'otp' commands can be used regardless of 72939beb93cSSam Lefflerwhether the request was for PASSWORD or OTP. The main difference 73039beb93cSSam Lefflerbetween these two commands is that values given with 'password' are 73139beb93cSSam Lefflerremembered as long as wpa_supplicant is running whereas values given 73239beb93cSSam Lefflerwith 'otp' are used only once and then forgotten, i.e., wpa_supplicant 73339beb93cSSam Lefflerwill ask frontend for a new value for every use. This can be used to 73439beb93cSSam Lefflerimplement one-time-password lists and generic token card -based 73539beb93cSSam Lefflerauthentication. 73639beb93cSSam Leffler 73739beb93cSSam LefflerExample request for password and a matching reply: 73839beb93cSSam Leffler 73939beb93cSSam LefflerCTRL-REQ-PASSWORD-1:Password needed for SSID foobar 74039beb93cSSam Leffler> password 1 mysecretpassword 74139beb93cSSam Leffler 74239beb93cSSam LefflerExample request for generic token card challenge-response: 74339beb93cSSam Leffler 74439beb93cSSam LefflerCTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar 74539beb93cSSam Leffler> otp 2 9876 74639beb93cSSam Leffler 74739beb93cSSam Leffler 74839beb93cSSam Lefflerwpa_cli commands 74939beb93cSSam Leffler 75039beb93cSSam Leffler status = get current WPA/EAPOL/EAP status 75139beb93cSSam Leffler mib = get MIB variables (dot1x, dot11) 75239beb93cSSam Leffler help = show this usage help 75339beb93cSSam Leffler interface [ifname] = show interfaces/select interface 75439beb93cSSam Leffler level <debug level> = change debug level 75539beb93cSSam Leffler license = show full wpa_cli license 75639beb93cSSam Leffler logoff = IEEE 802.1X EAPOL state machine logoff 75739beb93cSSam Leffler logon = IEEE 802.1X EAPOL state machine logon 75839beb93cSSam Leffler set = set variables (shows list of variables when run without arguments) 75939beb93cSSam Leffler pmksa = show PMKSA cache 76039beb93cSSam Leffler reassociate = force reassociation 76139beb93cSSam Leffler reconfigure = force wpa_supplicant to re-read its configuration file 76239beb93cSSam Leffler preauthenticate <BSSID> = force preauthentication 76339beb93cSSam Leffler identity <network id> <identity> = configure identity for an SSID 76439beb93cSSam Leffler password <network id> <password> = configure password for an SSID 76539beb93cSSam Leffler pin <network id> <pin> = configure pin for an SSID 76639beb93cSSam Leffler otp <network id> <password> = configure one-time-password for an SSID 76739beb93cSSam Leffler passphrase <network id> <passphrase> = configure private key passphrase 76839beb93cSSam Leffler for an SSID 76939beb93cSSam Leffler bssid <network id> <BSSID> = set preferred BSSID for an SSID 77039beb93cSSam Leffler list_networks = list configured networks 77139beb93cSSam Leffler select_network <network id> = select a network (disable others) 77239beb93cSSam Leffler enable_network <network id> = enable a network 77339beb93cSSam Leffler disable_network <network id> = disable a network 77439beb93cSSam Leffler add_network = add a network 77539beb93cSSam Leffler remove_network <network id> = remove a network 77639beb93cSSam Leffler set_network <network id> <variable> <value> = set network variables (shows 77739beb93cSSam Leffler list of variables when run without arguments) 77839beb93cSSam Leffler get_network <network id> <variable> = get network variables 77939beb93cSSam Leffler save_config = save the current configuration 78039beb93cSSam Leffler disconnect = disconnect and wait for reassociate command before connecting 78139beb93cSSam Leffler scan = request new BSS scan 78239beb93cSSam Leffler scan_results = get latest scan results 783c1d255d3SCy Schubert get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = get capabilities 78439beb93cSSam Leffler terminate = terminate wpa_supplicant 78539beb93cSSam Leffler quit = exit wpa_cli 78639beb93cSSam Leffler 78739beb93cSSam Leffler 78839beb93cSSam Lefflerwpa_cli command line options 78939beb93cSSam Leffler 79039beb93cSSam Lefflerwpa_cli [-p<path to ctrl sockets>] [-i<ifname>] [-hvB] [-a<action file>] \ 79139beb93cSSam Leffler [-P<pid file>] [-g<global ctrl>] [command..] 79239beb93cSSam Leffler -h = help (show this usage text) 79339beb93cSSam Leffler -v = shown version information 79439beb93cSSam Leffler -a = run in daemon mode executing the action file based on events from 79539beb93cSSam Leffler wpa_supplicant 79639beb93cSSam Leffler -B = run a daemon in the background 79739beb93cSSam Leffler default path: /var/run/wpa_supplicant 79839beb93cSSam Leffler default interface: first interface found in socket path 79939beb93cSSam Leffler 80039beb93cSSam Leffler 80139beb93cSSam LefflerUsing wpa_cli to run external program on connect/disconnect 80239beb93cSSam Leffler----------------------------------------------------------- 80339beb93cSSam Leffler 80439beb93cSSam Lefflerwpa_cli can used to run external programs whenever wpa_supplicant 80539beb93cSSam Lefflerconnects or disconnects from a network. This can be used, e.g., to 80639beb93cSSam Lefflerupdate network configuration and/or trigget DHCP client to update IP 80739beb93cSSam Leffleraddresses, etc. 80839beb93cSSam Leffler 80939beb93cSSam LefflerOne wpa_cli process in "action" mode needs to be started for each 81039beb93cSSam Lefflerinterface. For example, the following command starts wpa_cli for the 811780fb4a2SCy Schubertdefault interface (-i can be used to select the interface in case of 81239beb93cSSam Lefflermore than one interface being used at the same time): 81339beb93cSSam Leffler 81439beb93cSSam Lefflerwpa_cli -a/sbin/wpa_action.sh -B 81539beb93cSSam Leffler 81639beb93cSSam LefflerThe action file (-a option, /sbin/wpa_action.sh in this example) will 81739beb93cSSam Lefflerbe executed whenever wpa_supplicant completes authentication (connect 81839beb93cSSam Lefflerevent) or detects disconnection). The action script will be called 81939beb93cSSam Lefflerwith two command line arguments: interface name and event (CONNECTED 82039beb93cSSam Leffleror DISCONNECTED). If the action script needs to get more information 82139beb93cSSam Lefflerabout the current network, it can use 'wpa_cli status' to query 82239beb93cSSam Lefflerwpa_supplicant for more information. 82339beb93cSSam Leffler 82439beb93cSSam LefflerFollowing example can be used as a simple template for an action 82539beb93cSSam Lefflerscript: 82639beb93cSSam Leffler 82739beb93cSSam Leffler#!/bin/sh 82839beb93cSSam Leffler 82939beb93cSSam LefflerIFNAME=$1 83039beb93cSSam LefflerCMD=$2 83139beb93cSSam Leffler 832f05cddf9SRui Pauloif [ "$CMD" = "CONNECTED" ]; then 83339beb93cSSam Leffler SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=` 83439beb93cSSam Leffler # configure network, signal DHCP client, etc. 83539beb93cSSam Lefflerfi 83639beb93cSSam Leffler 837f05cddf9SRui Pauloif [ "$CMD" = "DISCONNECTED" ]; then 83839beb93cSSam Leffler # remove network configuration, if needed 839f05cddf9SRui Paulo SSID= 84039beb93cSSam Lefflerfi 84139beb93cSSam Leffler 84239beb93cSSam Leffler 84339beb93cSSam Leffler 84439beb93cSSam LefflerIntegrating with pcmcia-cs/cardmgr scripts 84539beb93cSSam Leffler------------------------------------------ 84639beb93cSSam Leffler 84739beb93cSSam Lefflerwpa_supplicant needs to be running when using a wireless network with 84839beb93cSSam LefflerWPA. It can be started either from system startup scripts or from 84939beb93cSSam Lefflerpcmcia-cs/cardmgr scripts (when using PC Cards). WPA handshake must be 85039beb93cSSam Lefflercompleted before data frames can be exchanged, so wpa_supplicant 85139beb93cSSam Lefflershould be started before DHCP client. 85239beb93cSSam Leffler 85339beb93cSSam LefflerFor example, following small changes to pcmcia-cs scripts can be used 85439beb93cSSam Lefflerto enable WPA support: 85539beb93cSSam Leffler 85639beb93cSSam LefflerAdd MODE="Managed" and WPA="y" to the network scheme in 85739beb93cSSam Leffler/etc/pcmcia/wireless.opts. 85839beb93cSSam Leffler 85939beb93cSSam LefflerAdd the following block to the end of 'start' action handler in 86039beb93cSSam Leffler/etc/pcmcia/wireless: 86139beb93cSSam Leffler 86239beb93cSSam Leffler if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then 86339beb93cSSam Leffler /usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf \ 86439beb93cSSam Leffler -i$DEVICE 86539beb93cSSam Leffler fi 86639beb93cSSam Leffler 86739beb93cSSam LefflerAdd the following block to the end of 'stop' action handler (may need 86839beb93cSSam Lefflerto be separated from other actions) in /etc/pcmcia/wireless: 86939beb93cSSam Leffler 87039beb93cSSam Leffler if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then 87139beb93cSSam Leffler killall wpa_supplicant 87239beb93cSSam Leffler fi 87339beb93cSSam Leffler 87439beb93cSSam LefflerThis will make cardmgr start wpa_supplicant when the card is plugged 87539beb93cSSam Lefflerin. 87639beb93cSSam Leffler 87739beb93cSSam Leffler 87839beb93cSSam Leffler 87939beb93cSSam LefflerDynamic interface add and operation without configuration files 88039beb93cSSam Leffler--------------------------------------------------------------- 88139beb93cSSam Leffler 88239beb93cSSam Lefflerwpa_supplicant can be started without any configuration files or 88339beb93cSSam Lefflernetwork interfaces. When used in this way, a global (i.e., per 88439beb93cSSam Lefflerwpa_supplicant process) control interface is used to add and remove 88539beb93cSSam Lefflernetwork interfaces. Each network interface can then be configured 88639beb93cSSam Lefflerthrough a per-network interface control interface. For example, 88739beb93cSSam Lefflerfollowing commands show how to start wpa_supplicant without any 88839beb93cSSam Lefflernetwork interfaces and then add a network interface and configure a 88939beb93cSSam Lefflernetwork (SSID): 89039beb93cSSam Leffler 89139beb93cSSam Leffler# Start wpa_supplicant in the background 89239beb93cSSam Lefflerwpa_supplicant -g/var/run/wpa_supplicant-global -B 89339beb93cSSam Leffler 8945b9c547cSRui Paulo# Add a new interface (wlan0, no configuration file, driver=nl80211, and 89539beb93cSSam Leffler# enable control interface) 89639beb93cSSam Lefflerwpa_cli -g/var/run/wpa_supplicant-global interface_add wlan0 \ 8975b9c547cSRui Paulo "" nl80211 /var/run/wpa_supplicant 89839beb93cSSam Leffler 89939beb93cSSam Leffler# Configure a network using the newly added network interface: 90039beb93cSSam Lefflerwpa_cli -iwlan0 add_network 90139beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 ssid '"test"' 90239beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK 90339beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 psk '"12345678"' 90439beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 pairwise TKIP 90539beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 group TKIP 90639beb93cSSam Lefflerwpa_cli -iwlan0 set_network 0 proto WPA 90739beb93cSSam Lefflerwpa_cli -iwlan0 enable_network 0 90839beb93cSSam Leffler 90939beb93cSSam Leffler# At this point, the new network interface should start trying to associate 91039beb93cSSam Leffler# with the WPA-PSK network using SSID test. 91139beb93cSSam Leffler 91239beb93cSSam Leffler# Remove network interface 91339beb93cSSam Lefflerwpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0 91439beb93cSSam Leffler 91539beb93cSSam Leffler 91639beb93cSSam LefflerPrivilege separation 91739beb93cSSam Leffler-------------------- 91839beb93cSSam Leffler 91939beb93cSSam LefflerTo minimize the size of code that needs to be run with root privileges 92039beb93cSSam Leffler(e.g., to control wireless interface operation), wpa_supplicant 92139beb93cSSam Lefflersupports optional privilege separation. If enabled, this separates the 92239beb93cSSam Lefflerprivileged operations into a separate process (wpa_priv) while leaving 92339beb93cSSam Lefflerrest of the code (e.g., EAP authentication and WPA handshakes) into an 92439beb93cSSam Lefflerunprivileged process (wpa_supplicant) that can be run as non-root 92539beb93cSSam Leffleruser. Privilege separation restricts the effects of potential software 92639beb93cSSam Lefflererrors by containing the majority of the code in an unprivileged 92739beb93cSSam Lefflerprocess to avoid full system compromise. 92839beb93cSSam Leffler 92939beb93cSSam LefflerPrivilege separation is not enabled by default and it can be enabled 93039beb93cSSam Lefflerby adding CONFIG_PRIVSEP=y to the build configuration (.config). When 93139beb93cSSam Lefflerenabled, the privileged operations (driver wrapper and l2_packet) are 93239beb93cSSam Lefflerlinked into a separate daemon program, wpa_priv. The unprivileged 93339beb93cSSam Lefflerprogram, wpa_supplicant, will be built with a special driver/l2_packet 93439beb93cSSam Lefflerwrappers that communicate with the privileged wpa_priv process to 93539beb93cSSam Lefflerperform the needed operations. wpa_priv can control what privileged 93639beb93cSSam Lefflerare allowed. 93739beb93cSSam Leffler 93839beb93cSSam Lefflerwpa_priv needs to be run with network admin privileges (usually, root 93939beb93cSSam Leffleruser). It opens a UNIX domain socket for each interface that is 94039beb93cSSam Lefflerincluded on the command line; any other interface will be off limits 94139beb93cSSam Lefflerfor wpa_supplicant in this kind of configuration. After this, 94239beb93cSSam Lefflerwpa_supplicant can be run as a non-root user (e.g., all standard users 94339beb93cSSam Leffleron a laptop or as a special non-privileged user account created just 94439beb93cSSam Lefflerfor this purpose to limit access to user files even further). 94539beb93cSSam Leffler 94639beb93cSSam Leffler 94739beb93cSSam LefflerExample configuration: 94839beb93cSSam Leffler- create user group for users that are allowed to use wpa_supplicant 94939beb93cSSam Leffler ('wpapriv' in this example) and assign users that should be able to 95039beb93cSSam Leffler use wpa_supplicant into that group 95139beb93cSSam Leffler- create /var/run/wpa_priv directory for UNIX domain sockets and control 95239beb93cSSam Leffler user access by setting it accessible only for the wpapriv group: 95339beb93cSSam Leffler mkdir /var/run/wpa_priv 95439beb93cSSam Leffler chown root:wpapriv /var/run/wpa_priv 95539beb93cSSam Leffler chmod 0750 /var/run/wpa_priv 95639beb93cSSam Leffler- start wpa_priv as root (e.g., from system startup scripts) with the 95739beb93cSSam Leffler enabled interfaces configured on the command line: 9585b9c547cSRui Paulo wpa_priv -B -P /var/run/wpa_priv.pid nl80211:wlan0 95939beb93cSSam Leffler- run wpa_supplicant as non-root with a user that is in wpapriv group: 96039beb93cSSam Leffler wpa_supplicant -i ath0 -c wpa_supplicant.conf 96139beb93cSSam Leffler 96239beb93cSSam Lefflerwpa_priv does not use the network interface before wpa_supplicant is 96339beb93cSSam Lefflerstarted, so it is fine to include network interfaces that are not 96439beb93cSSam Leffleravailable at the time wpa_priv is started. As an alternative, wpa_priv 96539beb93cSSam Lefflercan be started when an interface is added (hotplug/udev/etc. scripts). 96639beb93cSSam Lefflerwpa_priv can control multiple interface with one process, but it is 96739beb93cSSam Leffleralso possible to run multiple wpa_priv processes at the same time, if 96839beb93cSSam Lefflerdesired. 9695b9c547cSRui Paulo 97085732ac8SCy SchubertIt should be noted that the interface used between wpa_supplicant and 97185732ac8SCy Schubertwpa_priv does not include all the capabilities of the wpa_supplicant 97285732ac8SCy Schubertdriver interface and at times, this interface lacks update especially 97385732ac8SCy Schubertfor recent addition. Consequently, use of wpa_priv does come with the 97485732ac8SCy Schubertprice of somewhat reduced available functionality. The next section 97585732ac8SCy Schubertdescribing how wpa_supplicant can be used with reduced privileges 97685732ac8SCy Schubertwithout having to handle the complexity of separate wpa_priv. While that 97785732ac8SCy Schubertapprove does not provide separation for network admin capabilities, it 97885732ac8SCy Schubertdoes allow other root privileges to be dropped without the drawbacks of 97985732ac8SCy Schubertthe wpa_priv process. 98085732ac8SCy Schubert 9815b9c547cSRui Paulo 9825b9c547cSRui PauloLinux capabilities instead of privileged process 9835b9c547cSRui Paulo------------------------------------------------ 9845b9c547cSRui Paulo 9855b9c547cSRui Paulowpa_supplicant performs operations that need special permissions, e.g., 9865b9c547cSRui Pauloto control the network connection. Traditionally this has been achieved 9875b9c547cSRui Pauloby running wpa_supplicant as a privileged process with effective user id 9885b9c547cSRui Paulo0 (root). Linux capabilities can be used to provide restricted set of 9895b9c547cSRui Paulocapabilities to match the functions needed by wpa_supplicant. The 9905b9c547cSRui Paulominimum set of capabilities needed for the operations is CAP_NET_ADMIN 9915b9c547cSRui Pauloand CAP_NET_RAW. 9925b9c547cSRui Paulo 9935b9c547cSRui Paulosetcap(8) can be used to set file capabilities. For example: 9945b9c547cSRui Paulo 9955b9c547cSRui Paulosudo setcap cap_net_raw,cap_net_admin+ep wpa_supplicant 9965b9c547cSRui Paulo 9975b9c547cSRui PauloPlease note that this would give anyone being able to run that 9985b9c547cSRui Paulowpa_supplicant binary access to the additional capabilities. This can 9995b9c547cSRui Paulofurther be limited by file owner/group and mode bits. For example: 10005b9c547cSRui Paulo 10015b9c547cSRui Paulosudo chown wpas wpa_supplicant 10025b9c547cSRui Paulosudo chmod 0100 wpa_supplicant 10035b9c547cSRui Paulo 10045b9c547cSRui PauloThis combination of setcap, chown, and chmod commands would allow wpas 10055b9c547cSRui Paulouser to execute wpa_supplicant with additional network admin/raw 10065b9c547cSRui Paulocapabilities. 10075b9c547cSRui Paulo 10085b9c547cSRui PauloCommon way style of creating a control interface socket in 10095b9c547cSRui Paulo/var/run/wpa_supplicant could not be done by this user, but this 10105b9c547cSRui Paulodirectory could be created before starting the wpa_supplicant and set to 10115b9c547cSRui Paulosuitable mode to allow wpa_supplicant to create sockets 10125b9c547cSRui Paulothere. Alternatively, other directory or abstract socket namespace could 10135b9c547cSRui Paulobe used for the control interface. 10145b9c547cSRui Paulo 10155b9c547cSRui Paulo 10165b9c547cSRui PauloExternal requests for radio control 10175b9c547cSRui Paulo----------------------------------- 10185b9c547cSRui Paulo 10195b9c547cSRui PauloExternal programs can request wpa_supplicant to not start offchannel 10205b9c547cSRui Paulooperations during other tasks that may need exclusive control of the 10215b9c547cSRui Pauloradio. The RADIO_WORK control interface command can be used for this. 10225b9c547cSRui Paulo 10235b9c547cSRui Paulo"RADIO_WORK add <name> [freq=<MHz>] [timeout=<seconds>]" command can be 10245b9c547cSRui Pauloused to reserve a slot for radio access. If freq is specified, other 10255b9c547cSRui Pauloradio work items on the same channel may be completed in 10265b9c547cSRui Pauloparallel. Otherwise, all other radio work items are blocked during 10275b9c547cSRui Pauloexecution. Timeout is set to 10 seconds by default to avoid blocking 10285b9c547cSRui Paulowpa_supplicant operations for excessive time. If a longer (or shorter) 10295b9c547cSRui Paulosafety timeout is needed, that can be specified with the optional 10305b9c547cSRui Paulotimeout parameter. This command returns an identifier for the radio work 10315b9c547cSRui Pauloitem. 10325b9c547cSRui Paulo 10335b9c547cSRui PauloOnce the radio work item has been started, "EXT-RADIO-WORK-START <id>" 10345b9c547cSRui Pauloevent message is indicated that the external processing can start. Once 10355b9c547cSRui Paulothe operation has been completed, "RADIO_WORK done <id>" is used to 10365b9c547cSRui Pauloindicate that to wpa_supplicant. This allows other radio works to be 10375b9c547cSRui Pauloperformed. If this command is forgotten (e.g., due to the external 1038780fb4a2SCy Schubertprogram terminating), wpa_supplicant will time out the radio work item 1039780fb4a2SCy Schubertand send "EXT-RADIO-WORK-TIMEOUT <id>" event to indicate that this has 10405b9c547cSRui Paulohappened. "RADIO_WORK done <id>" can also be used to cancel items that 10415b9c547cSRui Paulohave not yet been started. 10425b9c547cSRui Paulo 10435b9c547cSRui PauloFor example, in wpa_cli interactive mode: 10445b9c547cSRui Paulo 10455b9c547cSRui Paulo> radio_work add test 10465b9c547cSRui Paulo1 10475b9c547cSRui Paulo<3>EXT-RADIO-WORK-START 1 10485b9c547cSRui Paulo> radio_work show 10495b9c547cSRui Pauloext:test@wlan0:0:1:2.487797 10505b9c547cSRui Paulo> radio_work done 1 10515b9c547cSRui PauloOK 10525b9c547cSRui Paulo> radio_work show 10535b9c547cSRui Paulo 10545b9c547cSRui Paulo 10555b9c547cSRui Paulo> radio_work done 3 10565b9c547cSRui PauloOK 10575b9c547cSRui Paulo> radio_work show 10585b9c547cSRui Pauloext:test freq=2412 timeout=30@wlan0:2412:1:28.583483 10595b9c547cSRui Paulo<3>EXT-RADIO-WORK-TIMEOUT 2 10605b9c547cSRui Paulo 10615b9c547cSRui Paulo 10625b9c547cSRui Paulo> radio_work add test2 freq=2412 timeout=60 10635b9c547cSRui Paulo5 10645b9c547cSRui Paulo<3>EXT-RADIO-WORK-START 5 10655b9c547cSRui Paulo> radio_work add test3 10665b9c547cSRui Paulo6 10675b9c547cSRui Paulo> radio_work add test4 10685b9c547cSRui Paulo7 10695b9c547cSRui Paulo> radio_work show 10705b9c547cSRui Pauloext:test2 freq=2412 timeout=60@wlan0:2412:1:9.751844 10715b9c547cSRui Pauloext:test3@wlan0:0:0:5.071812 10725b9c547cSRui Pauloext:test4@wlan0:0:0:3.143870 10735b9c547cSRui Paulo> radio_work done 6 10745b9c547cSRui PauloOK 10755b9c547cSRui Paulo> radio_work show 10765b9c547cSRui Pauloext:test2 freq=2412 timeout=60@wlan0:2412:1:16.287869 10775b9c547cSRui Pauloext:test4@wlan0:0:0:9.679895 10785b9c547cSRui Paulo> radio_work done 5 10795b9c547cSRui PauloOK 10805b9c547cSRui Paulo<3>EXT-RADIO-WORK-START 7 10815b9c547cSRui Paulo<3>EXT-RADIO-WORK-TIMEOUT 7 10824b72b91aSCy Schubert 10834b72b91aSCy Schubert 10844b72b91aSCy SchubertDSCP policy procedures 10854b72b91aSCy Schubert---------------------- 10864b72b91aSCy Schubert 10874b72b91aSCy SchubertDSCP policy procedures defined in WFA QoS Management-R2 program 10884b72b91aSCy Schubertfacilitates AP devices to configure DSCP settings for specific uplink 10894b72b91aSCy Schubertdata streams. 10904b72b91aSCy Schubert 10914b72b91aSCy SchubertAn AP may transmit a DSCP Policy Request frame containing zero or more 10924b72b91aSCy SchubertQoS Management IEs to an associated STA which supports DSCP policy 10934b72b91aSCy Schubertprocedures. Each QoS Management element in a DSCP Policy Request frame 10944b72b91aSCy Schubertrepresents one DSCP policy, and shall include one DSCP Policy attribute 10954b72b91aSCy Schubertincluding a DSCP Policy ID, Request type, and a DSCP value. 10964b72b91aSCy Schubert 10974b72b91aSCy Schubertwpa_supplicant sends control interface event messages consisting details 10984b72b91aSCy Schubertof DSCP policies requested by the AP through a DSCP Policy Request frame 10994b72b91aSCy Schubertto external programs. The format of the control interface event messages 11004b72b91aSCy Schubertis as shown below: 11014b72b91aSCy Schubert 11024b72b91aSCy Schubert- Control interface event message format to indicate DSCP request start 11034b72b91aSCy Schubert 11044b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY request_start [clear_all] [more] 11054b72b91aSCy Schubert 11064b72b91aSCy Schubert clear_all - AP requested to clear all DSCP policies configured earlier 11074b72b91aSCy Schubert more - AP may request to configure more DSCP policies with new DSCP 11084b72b91aSCy Schubert request 11094b72b91aSCy Schubert 11104b72b91aSCy Schubert- Control interface event message format to add new policy 11114b72b91aSCy Schubert 11124b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY add <policy_id> <dscp_value> <ip_version=0|4|6> 11134b72b91aSCy Schubert [protocol] [source ip] [destination_ip]/[domain name] [source port] 11144b72b91aSCy Schubert [[<start_port> <end_port>]/destination port] 11154b72b91aSCy Schubert 11164b72b91aSCy Schubert ip_version = 0: Both IPv4 and IPv6 11174b72b91aSCy Schubert = 4: IPv4 11184b72b91aSCy Schubert = 6: IPv6 11194b72b91aSCy Schubert protocol: Internet Protocol Numbers as per IETF RFCs 11204b72b91aSCy Schubert = 6: TCP 11214b72b91aSCy Schubert = 17: UDP 11224b72b91aSCy Schubert = 50: ESP 11234b72b91aSCy Schubert 11244b72b91aSCy Schubert- Control interface event message format to remove a particular policy, 11254b72b91aSCy Schubert identified by the policy_id attribute. 11264b72b91aSCy Schubert 11274b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY remove <policy_id> 11284b72b91aSCy Schubert 11294b72b91aSCy Schubert- DSCP policy may get rejected due to invalid policy parameters. Ccontrol 11304b72b91aSCy Schubert interface event message format for rejected policy. 11314b72b91aSCy Schubert 11324b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY reject <policy_id> 11334b72b91aSCy Schubert 11344b72b91aSCy Schubert- Control interface event message format to indicate end of DSCP request. 11354b72b91aSCy Schubert 11364b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY request_end 11374b72b91aSCy Schubert 11384b72b91aSCy Schubert- External applications shall clear active DSCP policies upon receiving 11394b72b91aSCy Schubert "CTRL-EVENT-DISCONNECTED" or "CTRL-EVENT-DSCP-POLICY clear_all" events. 11404b72b91aSCy Schubert 11414b72b91aSCy Schubert- Control interface event message format to indicate wpa_supplicant started 11424b72b91aSCy Schubert a timer to wait until the unsolicited DSCP request from the AP. 11434b72b91aSCy Schubert 11444b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY request_wait start 11454b72b91aSCy Schubert 11464b72b91aSCy Schubert- Control interface event message format to indicate timeout to receive the 11474b72b91aSCy Schubert unsolicited DSCP request. This event is expected only when an unsolicited 11484b72b91aSCy Schubert DSCP request is not received from the AP before timeout. 11494b72b91aSCy Schubert 11504b72b91aSCy Schubert <3>CTRL-EVENT-DSCP-POLICY request_wait end 11514b72b91aSCy Schubert 11524b72b91aSCy SchubertDSCP Response: 11534b72b91aSCy SchubertA QoS Management STA that enables DSCP Policy capability shall respond 11544b72b91aSCy Schubertwith DSCP response on receipt of a successful DSCP request from its 11554b72b91aSCy Schubertassociated AP. wpa_supplicant sends DSCP policy response based on the 11564b72b91aSCy Schubertcontrol interface command received from the user is as below: 11574b72b91aSCy Schubert 11584b72b91aSCy SchubertDSCP_RESP <[reset]>/<[solicited] [policy_id=1 status=0...]> [more] 11594b72b91aSCy Schubert 11604b72b91aSCy SchubertDSCP Query: 11614b72b91aSCy SchubertDSCP Policy Query enables a STA to query its associated AP for DSCP 11624b72b91aSCy Schubertpolicies applicable to the STA. Currently, this includes support to send 11634b72b91aSCy Schuberta wildcard DSCP query or a DSCP query with a single domain name 11644b72b91aSCy Schubertattribute. The command format for the DSCP query command is as follows: 11654b72b91aSCy SchubertDSCP_QUERY <wildcard>/<domain_name=<string>> 1166