📄 readme
字号:
wpa_supplicant is designed to be a "daemon" program that runs in thebackground and acts as the backend component controlling the wirelessconnection. wpa_supplicant supports separate frontend programs and anexample text-based frontend, wpa_cli, is included with wpa_supplicant.Following steps are used when associating with an AP using WPA:- wpa_supplicant requests the kernel driver to scan neighboring BSSes- wpa_supplicant selects a BSS based on its configuration- wpa_supplicant requests the kernel driver to associate with the chosen BSS- If WPA-EAP: integrated IEEE 802.1X Supplicant completes EAP authentication with the authentication server (proxied by the Authenticator in the AP)- If WPA-EAP: master key is received from the IEEE 802.1X Supplicant- If WPA-PSK: wpa_supplicant uses PSK as the master session key- wpa_supplicant completes WPA 4-Way Handshake and Group Key Handshake with the Authenticator (AP)- wpa_supplicant configures encryption keys for unicast and broadcast- normal data packets can be transmitted and receivedBuilding and installing-----------------------In order to be able to build wpa_supplicant, you will first need toselect which parts of it will be included. This is done by creating abuild time configuration file, .config, in the wpa_supplicant rootdirectory. Configuration options are text lines using followingformat: CONFIG_<option>=y. Lines starting with # are consideredcomments and are ignored. See defconfig file for an example configurationand a list of available options and additional notes.The build time configuration can be used to select only the neededfeatures and limit the binary size and requirements for externallibraries. The main configuration parts are the selection of whichdriver interfaces (e.g., hostap, madwifi, ..) and which authenticationmethods (e.g., EAP-TLS, EAP-PEAP, ..) are included.Following build time configuration options are used to control IEEE802.1X/EAPOL and EAP state machines and all EAP methods. IncludingTLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSLlibrary for TLS implementation. Alternatively, GnuTLS or the internalTLSv1 implementation can be used for TLS functionaly.CONFIG_IEEE8021X_EAPOL=yCONFIG_EAP_MD5=yCONFIG_EAP_MSCHAPV2=yCONFIG_EAP_TLS=yCONFIG_EAP_PEAP=yCONFIG_EAP_TTLS=yCONFIG_EAP_GTC=yCONFIG_EAP_OTP=yCONFIG_EAP_SIM=yCONFIG_EAP_AKA=yCONFIG_EAP_PSK=yCONFIG_EAP_SAKE=yCONFIG_EAP_GPSK=yCONFIG_EAP_PAX=yCONFIG_EAP_LEAP=yFollowing option can be used to include GSM SIM/USIM interface for GSM/UMTSauthentication algorithm (for EAP-SIM/EAP-AKA). This requires pcsc-lite(http://www.linuxnet.com/) for smart card access.CONFIG_PCSC=yFollowing options can be added to .config to select which driverinterfaces are included. Hermes driver interface needs to be downloadedfrom Agere (see above). CONFIG_WIRELESS_EXTENSION will be usedautomatically if any of the selected drivers need it.CONFIG_WIRELESS_EXTENSION=yCONFIG_DRIVER_HOSTAP=yCONFIG_DRIVER_HERMES=yCONFIG_DRIVER_MADWIFI=yCONFIG_DRIVER_ATMEL=yCONFIG_DRIVER_WEXT=yCONFIG_DRIVER_NDISWRAPPER=yCONFIG_DRIVER_BROADCOM=yCONFIG_DRIVER_IPW=yCONFIG_DRIVER_BSD=yCONFIG_DRIVER_NDIS=yFollowing example includes all features and driver interfaces that areincluded in the wpa_supplicant package:CONFIG_DRIVER_HOSTAP=yCONFIG_DRIVER_HERMES=yCONFIG_DRIVER_MADWIFI=yCONFIG_DRIVER_ATMEL=yCONFIG_DRIVER_WEXT=yCONFIG_DRIVER_NDISWRAPPER=yCONFIG_DRIVER_BROADCOM=yCONFIG_DRIVER_IPW=yCONFIG_DRIVER_BSD=yCONFIG_DRIVER_NDIS=yCONFIG_WIRELESS_EXTENSION=yCONFIG_IEEE8021X_EAPOL=yCONFIG_EAP_MD5=yCONFIG_EAP_MSCHAPV2=yCONFIG_EAP_TLS=yCONFIG_EAP_PEAP=yCONFIG_EAP_TTLS=yCONFIG_EAP_GTC=yCONFIG_EAP_OTP=yCONFIG_EAP_SIM=yCONFIG_EAP_AKA=yCONFIG_EAP_PSK=yCONFIG_EAP_SAKE=yCONFIG_EAP_GPSK=yCONFIG_EAP_PAX=yCONFIG_EAP_LEAP=yCONFIG_PCSC=yEAP-PEAP and EAP-TTLS will automatically include configured EAPmethods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection.After you have created a configuration file, you can buildwpa_supplicant and wpa_cli with 'make' command. You may then installthe binaries to a suitable system directory, e.g., /usr/local/bin.Example commands:# build wpa_supplicant and wpa_climake# install binaries (this may need root privileges)cp wpa_cli wpa_supplicant /usr/local/binYou will need to make a configuration file, e.g.,/etc/wpa_supplicant.conf, with network configuration for the networksyou are going to use. Configuration file section below includesexplanation fo the configuration file format and includes variousexamples. Once the configuration is ready, you can test whether theconfiguration work by first running wpa_supplicant with followingcommand to start it on foreground with debugging enabled:wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -dAssuming everything goes fine, you can start using following commandto start wpa_supplicant on background without debugging:wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -BPlease note that if you included more than one driver interface in thebuild time configuration (.config), you may need to specify whichinterface to use by including -D<driver name> option on the commandline. See following section for more details on command line optionsfor wpa_supplicant.Command line options--------------------usage: wpa_supplicant [-BddfhKLqqtuvwW] [-P<pid file>] [-g<global ctrl>] \ -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \ [-b<br_ifname> [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \ [-p<driver_param>] [-b<br_ifname>] ...]options: -b = optional bridge interface name -B = run daemon in the background -c = Configuration file -C = ctrl_interface parameter (only used if -c is not) -i = interface name -d = increase debugging verbosity (-dd even more) -D = driver name -f = Log output to default log location (normally /tmp) -g = global ctrl_interface -K = include keys (passwords, etc.) in debug output -t = include timestamp in debug messages -h = show this help text -L = show license (GPL and BSD) -p = driver parameters -P = PID file -q = decrease debugging verbosity (-qq even less) -v = show version -w = wait for interface to be added, if needed -W = wait for a control interface monitor before starting -N = start describing new interfacedrivers: hostap = Host AP driver (Intersil Prism2/2.5/3) [default] (this can also be used with Linuxant DriverLoader) hermes = Agere Systems Inc. driver (Hermes-I/Hermes-II) madwifi = MADWIFI 802.11 support (Atheros, etc.) atmel = ATMEL AT76C5XXx (USB, PCMCIA) wext = Linux wireless extensions (generic) ndiswrapper = Linux ndiswrapper broadcom = Broadcom wl.o driver ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer) wired = wpa_supplicant wired Ethernet driver bsd = BSD 802.11 support (Atheros, etc.) ndis = Windows NDIS driverIn most common cases, wpa_supplicant is started withwpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0This makes the process fork into background and wait for the wlan0interface if it is not available at startup time.The easiest way to debug problems, and to get debug log for bugreports, is to start wpa_supplicant on foreground with debuggingenabled:wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -dwpa_supplicant can control multiple interfaces (radios) either byrunning one process for each interface separately or by running justone process and list of options at command line. Each interface isseparated with -N argument. As an example, following command wouldstart wpa_supplicant for two interfaces:wpa_supplicant \ -c wpa1.conf -i wlan0 -D hostap -N \ -c wpa2.conf -i ath0 -D madwifiIf the interface is added in a Linux bridge (e.g., br0), the bridgeinterface needs to be configured to wpa_supplicant in addition to themain interface:wpa_supplicant -cw.conf -Dmadwifi -iath0 -bbr0Configuration file------------------wpa_supplicant is configured using a text file that lists all acceptednetworks and security policies, including pre-shared keys. Seeexample configuration file, wpa_supplicant.conf, for detailedinformation about the configuration format and supported fields.Changes to configuration file can be reloaded be sending SIGHUP signalto wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly,reloading can be triggered with 'wpa_cli reconfigure' command.Configuration file can include one or more network blocks, e.g., onefor each used SSID. wpa_supplicant will automatically select the bestbetwork based on the order of network blocks in the configurationfile, network security level (WPA/WPA2 is preferred), and signalstrength.Example configuration files for some common configurations:1) WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work network# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' groupctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheel## home network; allow all valid ciphersnetwork={ ssid="home" scan_ssid=1 key_mgmt=WPA-PSK psk="very secret passphrase"}## work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphersnetwork={ ssid="work" scan_ssid=1 key_mgmt=WPA-EAP pairwise=CCMP TKIP group=CCMP TKIP eap=TLS identity="user@example.com" ca_cert="/etc/cert/ca.pem" client_cert="/etc/cert/user.pem" private_key="/etc/cert/user.prv" private_key_passwd="password"}2) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series)ctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheelnetwork={ ssid="example" scan_ssid=1 key_mgmt=WPA-EAP eap=PEAP identity="user@example.com" password="foobar" ca_cert="/etc/cert/ca.pem" phase1="peaplabel=0" phase2="auth=MSCHAPV2"}3) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the unencrypted use. Real identity is sent only within an encrypted TLS tunnel.ctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheelnetwork={ ssid="example" scan_ssid=1 key_mgmt=WPA-EAP eap=TTLS identity="user@example.com" anonymous_identity="anonymous@example.com" password="foobar" ca_cert="/etc/cert/ca.pem" phase2="auth=MD5"}4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and broadcast); use EAP-TLS for authenticationctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheel
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -