How to install wpa supplicant

From ThinkWiki
Revision as of 16:57, 22 September 2005 by Ozi23 (Talk | contribs) (Configuration for WPA-PSK)
Jump to: navigation, search

Installing wpa_supplicant with madwifi support

  • Get the source see link below
  • Edit .config
 #
 #.config
 #
 CONFIG_DRIVER_MADWIFI=y
 # Change include directories to match with the local setup
 CFLAGS += -I../madwif
 CONFIG_DRIVER_WEXT=y
 CONFIG_IEEE8021X_EAPOL=y
 # EAP-MD5 (automatically included if EAP-TTLS is enabled)
 CONFIG_EAP_MD5=y
 # EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled)
 CONFIG_EAP_MSCHAPV2=y
 # EAP-TLS
 CONFIG_EAP_TLS=y
 # EAL-PEAP
 CONFIG_EAP_PEAP=y
 # EAP-TTLS
 CONFIG_EAP_TTLS=y
 # EAP-GTC
 CONFIG_EAP_GTC=y 
 # EAP-OTP
 CONFIG_EAP_OTP=y
 # LEAP
 CONFIG_EAP_LEAP=y
 # PKCS#12 (PFX) support (used to read private key and certificate file from
 # a file that usually has extension .p12 or .pfx)
 CONFIG_PKCS12=y
 # Include control interface for external programs, e.g, wpa_cli
 CONFIG_CTRL_IFACE=y
  • install wpa_supplicant by make && make install

Configuration

For WPA-PSK

  • Edit wpa_supplicant.conf
 #
 #wpa_supplicant.conf
 #
 ctrl_interface=/var/run/wpa_supplicant
 ctrl_interface_group=0
 eapol_version=1
 # ap_scan=2 was the one for me you may try 0 or 1 indstead of 2
 ap_scan=2
 fast_reauth=1
 network={
       ssid=""
       proto=WPA
       key_mgmt=WPA-PSK
       pairwise=TKIP
       group=TKIP
       psk=
 }

You have to change the values according to the response of "wpa_passphrase yourAPssid yourpassphrase ".

Starting wpa_supplicant

Make sure that the modules ath_pci,ath_hal,ath_rate_sample,wlan,wlan_tkip,wlan_xauth are loaded (lsmod).

Now you are able to start wpa_supplicant by

wpa_supplicant -d -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi

If every thing works as expected, you can replace -d by -B for the deamon mode.

Bring up my network card manual by

ifconfig ath0 yourip up  

and changing the routes and add the default gateway.

Bringing up the device at boot for gentoo users:

  • Make a symbolic link ln -s net.lo net.ath0 in /etc/init.d/
  • Copy wpa_supplicant.conf to /etc/conf.d/wpa_supplicant
  • Edit /etc/conf.d/net
 #
 #net
 #
 wpa_supplicant_ath0="-Dmadwifi"
 wpa_timeout_ath0=60
 config_ath0=("yourip netmask 255.255.255.0")
 routes_ath0=("default gw yourgateway")
  • Add net.ath0 to runlevel by "rc-update add net.ath0 default"
  • Make sure all needed modules are in /etc/modules.autoloa.d/2.x

Links