How to install wpa supplicant

From ThinkWiki
Revision as of 00:48, 28 September 2005 by Wyrfel (Talk | contribs) (Bringing up the device at boottime (for {{Gentoo}} users))
Jump to: navigation, search

Installing wpa_supplicant

  • Get the source
  • Edit the .config file in the source directory according to your wlan driver (see driver section)
 #
 #.config
 #
 # Uncomment following two lines and fix the paths if you have installed openssl
 # in non-default location
 #CFLAGS += -I/usr/local/openssl/include
 #LIBS += -L/usr/local/openssl/lib
 # Driver interface for Host AP driver
 #CONFIG_DRIVER_HOSTAP=y
 # Driver interface for Agere driver
 #CONFIG_DRIVER_HERMES=y
 # Change include directories to match with the local setup
 #CFLAGS += -I../../hcf -I../../include -I../../include/hcf
 #CFLAGS += -I../../include/wireless
 # Driver interface for Prism54 driver
 # (Note: Prism54 is not yet supported, i.e., this will not work as-is and is
 # for developers only)
 #CONFIG_DRIVER_PRISM54=y
 # Driver interface for ndiswrapper
 #CONFIG_DRIVER_NDISWRAPPER=y
 # Driver interface for Atmel driver
 #CONFIG_DRIVER_ATMEL=y
 # Driver interface for Broadcom driver
 #CONFIG_DRIVER_BROADCOM=y
 # Example path for wlioctl.h; change to match your configuration
 #CFLAGS += -I/opt/WRT54GS/release/src/include
 # Driver interface for Intel ipw2100/2200 driver
 #CONFIG_DRIVER_IPW=y
 CONFIG_DRIVER_MADWIFI=y
 # Change include directories to match with the local setup
 CFLAGS += -I../madwif
 CONFIG_DRIVER_WEXT=y
 # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
 #CONFIG_DRIVER_BSD=y
 #CFLAGS += -I/usr/local/include
 #LIBS += -L/usr/local/lib
 # Driver interface for Windows NDIS
 #CONFIG_DRIVER_NDIS=y
 #CFLAGS += -I/usr/include/w32api/ddk
 #LIBS += -L/usr/local/lib
 # For native build using mingw
 #CONFIG_NATIVE_WINDOWS=y
 # Additional directories for cross-compilation on Linux host for mingw target
 #CFLAGS += -I/opt/mingw/mingw32/include/ddk
 #LIBS += -L/opt/mingw/mingw32/lib
 #CC=mingw32-gcc
 # Driver interface for development testing
 #CONFIG_DRIVER_TEST=y
 # Driver interface for wired Ethernet drivers
 #CONFIG_DRIVER_WIRED=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 and wlan_xauth are loaded (using # 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.

Bringing up the network card manually

  • Bring up the network interface with # ifconfig ath0 <yourip> up.
  • Change the routes and add the default gateway.

Bringing up the device at boottime (for Gentoo users)

  • Make a symbolic link
# cd /etc/init.d/
# ln -s net.lo net.ath0
  • 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 the default runlevel by executing
# rc-update add net.ath0 default
  • Make sure all needed modules are in /etc/modules.autoloa.d/2.x

External Sources