Difference between revisions of "How to install wpa supplicant"

From ThinkWiki
Jump to: navigation, search
(Bringing up the device at boot for gentoo users)
(beautification/readability)
Line 1: Line 1:
 
=== Installing wpa_supplicant ===
 
=== Installing wpa_supplicant ===
*Get the source see link below
+
*Get the [http://hostap.epitest.fi/wpa_supplicant/ source]
*Edit .config according to your wlan driver (see driver section)
+
*Edit the {{path|.config}} file in the source directory according to your wlan driver (see driver section)
 
 
  
 
   #
 
   #
Line 77: Line 76:
 
   CONFIG_CTRL_IFACE=y
 
   CONFIG_CTRL_IFACE=y
  
* install wpa_supplicant by make && make install
+
* install wpa_supplicant by {{cmdroot|make && make install}}
  
 
=== Configuration ===
 
=== Configuration ===
  
===== For WPA-PSK =====
+
==== For WPA-PSK ====
*Edit wpa_supplicant.conf
+
*Edit {{path|wpa_supplicant.conf}}:
 
    
 
    
 
   #
 
   #
Line 102: Line 101:
 
   }
 
   }
  
You have to change the values according to the response of "wpa_passphrase yourAPssid yourpassphrase ".
+
You have to change the values according to the response of {{cmdroot|wpa_passphrase <yourAPssid> <yourpassphrase>}}.
  
 
=== Starting wpa_supplicant ===
 
=== Starting wpa_supplicant ===
 
+
Make sure that the modules <tt>ath_pci</tt>, <tt>ath_hal</tt>, <tt>ath_rate_sample</tt>, <tt>wlan</tt>, <tt>wlan_tkip</tt> and <tt>wlan_xauth</tt> are loaded (using {{cmdroot|lsmod}}).
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  
 
Now you are able to start wpa_supplicant by  
wpa_supplicant -d -c/etc/wpa_supplicant.conf -iath0 -Dmadwifi
+
:{{cmdroot|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.
+
If every thing works as expected, you can replace <tt>-d</tt> by <tt>-B</tt> for the deamon mode.
 
                  
 
                  
=====Bringing up the network card manual=====  
+
====Bringing up the network card manually====  
ifconfig ath0 yourip up
+
*Bring up the network interface with {{cmdroot|ifconfig ath0 <yourip> up}}.
and changing the routes and add the default gateway.
+
*Change the routes and add the default gateway.
  
=====Bringing up the device at boottime for gentoo users=====
+
====Bringing up the device at boottime (for {{Gentoo}} users)====
 
+
*Make a symbolic link
*Make a symbolic link ln -s net.lo net.ath0 in /etc/init.d/
+
:{{cmdroot|cd /etc/init.d/}}
*Copy wpa_supplicant.conf to /etc/conf.d/wpa_supplicant
+
:{{cmdroot|ln -s net.lo net.ath0}}
*Edit /etc/conf.d/net
+
*Copy {{path|wpa_supplicant.conf}} to {{path|/etc/conf.d/wpa_supplicant}}.
 +
*Edit {{path|/etc/conf.d/net}}
 
    
 
    
 
   #
 
   #
Line 131: Line 130:
  
 
*Add net.ath0 to runlevel by  
 
*Add net.ath0 to runlevel by  
  rc-update add net.ath0 default
+
:{{cmdroot|rc-update add net.ath0 default}}
*Make sure all needed modules are in /etc/modules.autoloa.d/2.x
+
*Make sure all needed modules are in {{path|/etc/modules.autoloa.d/2.x}}
 
 
=== Links ===
 
  
 +
=== External Sources ===
 
*[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] source
 
*[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] source
*[http://www.linux-wireless.org/ linux-wireless] wireless howtos
+
*[http://www.linux-wireless.org/ linux-wireless] Wireless HOWTOs
 
*[http://rinta-aho.org/docs/wlan/wlan.html EAP-TLS] setting up WLAN network with EAP-TLS
 
*[http://rinta-aho.org/docs/wlan/wlan.html EAP-TLS] setting up WLAN network with EAP-TLS

Revision as of 00:44, 28 September 2005

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 runlevel by
# rc-update add net.ath0 default
  • Make sure all needed modules are in /etc/modules.autoloa.d/2.x

External Sources