Difference between revisions of "How to install wpa supplicant"

From ThinkWiki
Jump to: navigation, search
(beautification/readability)
m (External Sources)
 
(19 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 
=== Installing wpa_supplicant ===
 
=== Installing wpa_supplicant ===
 +
AtRPMS contains packages for [[:Category:Fedora|Fedora Core]].
 +
 
*Get the [http://hostap.epitest.fi/wpa_supplicant/ source]  
 
*Get the [http://hostap.epitest.fi/wpa_supplicant/ source]  
*Edit the {{path|.config}} file in the source directory according to your wlan driver (see driver section)
+
*Make sure your kernel includes the drivers for your wireless card. Here's a sample .config for [[madwifi]] users:
  
 
   #
 
   #
Line 79: Line 81:
  
 
=== Configuration ===
 
=== Configuration ===
 +
 +
Set {{path|wpa_supplicant.conf}} to the following:
 +
 +
You have to change the values according to the response of {{cmdroot|wpa_passphrase <yourAPssid> <yourpassphrase>}}.
  
 
==== For WPA-PSK ====
 
==== For WPA-PSK ====
*Edit {{path|wpa_supplicant.conf}}:
+
<pre> 
 
+
ctrl_interface=/var/run/wpa_supplicant
  #
+
ctrl_interface_group=0
  #wpa_supplicant.conf
+
eapol_version=1
  #
+
# ap_scan=2 was the one for me you may try 0 or 1 indstead of 2
  ctrl_interface=/var/run/wpa_supplicant
+
ap_scan=2
  ctrl_interface_group=0
+
fast_reauth=1
  eapol_version=1
+
 
  # ap_scan=2 was the one for me you may try 0 or 1 indstead of 2
+
network={
  ap_scan=2
+
         ssid="my_network"
  fast_reauth=1
 
  network={
 
         ssid=""
 
 
         proto=WPA
 
         proto=WPA
 
         key_mgmt=WPA-PSK
 
         key_mgmt=WPA-PSK
 
         pairwise=TKIP
 
         pairwise=TKIP
 
         group=TKIP
 
         group=TKIP
         psk=
+
         psk="secret_password"
  }
+
}
 +
</pre>
  
You have to change the values according to the response of {{cmdroot|wpa_passphrase <yourAPssid> <yourpassphrase>}}.
+
==== For WPA2-Personal ====
 +
<pre>
 +
ctrl_interface=/var/run/wpa_supplicant
 +
ctrl_interface_group=0
 +
ap_scan=1
 +
 
 +
network={
 +
        ssid="my_network"
 +
        proto=RSN
 +
        key_mgmt=WPA-PSK
 +
        pairwise=CCMP TKIP
 +
        group=CCMP TKIP
 +
        psk="secret_password"
 +
}
 +
</pre>
  
 
=== Starting wpa_supplicant ===
 
=== Starting wpa_supplicant ===
 +
====When using a recent [[ipw2200]] driver  ====
 +
When using a recent [[ipw2200]] driver (e.g., as found in recent mainline kernels):
 +
:{{cmdroot|wpa_supplicant -d -c/etc/wpa_supplicant.conf -ieth1 -Dwext}}
 +
If every thing works as expected, you can replace <tt>-d</tt> by <tt>-B</tt> for the deamon mode.
 +
 +
In the instructions below, replace the interface name <tt>ath0</tt> with the appropriate one (usually <tt>eth1</tt>).
 +
 +
====When using the [[madwifi]] driver ====
 
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 <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}}).
  
 
Now you are able to start wpa_supplicant by  
 
Now you are able to start wpa_supplicant by  
:{{cmdroot|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 <tt>-d</tt> by <tt>-B</tt> 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 manually====  
 
====Bringing up the network card manually====  
 
*Bring up the network interface with {{cmdroot|ifconfig ath0 <yourip> up}}.
 
*Bring up the network interface with {{cmdroot|ifconfig ath0 <yourip> up}}.
 +
{{NOTE|1=At the moment there is a problem within the madwifi driver or wpa_supplicant passing dhcp. That´s why I use a fixed IP.
 +
There are two patches one for wpa_supllicant (http://hostap.epitest.fi/bugz/show_bug.cgi?id=63) and one for madwifi                                           
 +
(http://article.gmane.org/gmane.linux.drivers.madwifi.devel/1275). Each one is supposed to work.}}
 
*Change the routes and add the default gateway.
 
*Change the routes and add the default gateway.
  
Line 124: Line 153:
 
   #net
 
   #net
 
   #
 
   #
   wpa_supplicant_ath0="-Dmadwifi"
+
  modules=( "wpa_supplicant" )
 +
   wpa_supplicant_ath0="-Dmadwifi"modules=( "wpa_supplicant" )
 
   wpa_timeout_ath0=60
 
   wpa_timeout_ath0=60
   config_ath0=("yourip netmask 255.255.255.0")
+
   config_ath0=("<yourip> netmask 255.255.255.0")
   routes_ath0=("default gw yourgateway")
+
   routes_ath0=("default gw <yourgateway>")
  
*Add net.ath0 to runlevel by  
+
*Add net.ath0 to the default runlevel by executing
 
:{{cmdroot|rc-update add net.ath0 default}}
 
:{{cmdroot|rc-update add net.ath0 default}}
*Make sure all needed modules are in {{path|/etc/modules.autoloa.d/2.x}}
+
*Make sure all needed modules are in {{path|/etc/modules.autoload/2.x}}
  
 
=== External Sources ===
 
=== 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://www.examplenow.com/wpa_supplicant wpa_supplicant examples] wpa_supplicant examples
 
*[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
 +
*[http://www.codealias.info/technotes/wpa2_eap-tls_authentication_linux_client_setup setting up EAP-TLS in wpa_supplicant ]
 +
*[http://www.codealias.info/technotes/wireless_security_wpa/wap2_with_eap-peap_using_wpa_supplicant_and_client_ssl_certificates_linux_setup setting up EAP-PEAP in wpa_supplicant]
 +
*[http://www.codealias.info/technotes/wireless_security_wpa/wap2_with_eap-ttls_using_wpa_supplicant_and_client_ssl_certificates_linux_setup setting up EAP-TTLS in wpa_supplicant]

Latest revision as of 21:32, 7 March 2009

Installing wpa_supplicant

AtRPMS contains packages for Fedora Core.

  • Get the source
  • Make sure your kernel includes the drivers for your wireless card. Here's a sample .config for madwifi users:
 #
 #.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

Set wpa_supplicant.conf to the following:

You have to change the values according to the response of # wpa_passphrase <yourAPssid> <yourpassphrase>.

For WPA-PSK

  
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="my_network"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk="secret_password"
}

For WPA2-Personal

  
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
        ssid="my_network"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="secret_password"
}

Starting wpa_supplicant

When using a recent ipw2200 driver

When using a recent ipw2200 driver (e.g., as found in recent mainline kernels):

# wpa_supplicant -d -c/etc/wpa_supplicant.conf -ieth1 -Dwext

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

In the instructions below, replace the interface name ath0 with the appropriate one (usually eth1).

When using the madwifi driver

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.
NOTE!
At the moment there is a problem within the madwifi driver or wpa_supplicant passing dhcp. That´s why I use a fixed IP.

There are two patches one for wpa_supllicant (http://hostap.epitest.fi/bugz/show_bug.cgi?id=63) and one for madwifi

(http://article.gmane.org/gmane.linux.drivers.madwifi.devel/1275). Each one is supposed to work.
  • 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
 #
 modules=( "wpa_supplicant" )
 wpa_supplicant_ath0="-Dmadwifi"modules=( "wpa_supplicant" )
 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.autoload/2.x

External Sources