More and more wireless access networks are adopting 802.11i, the latest IEEE wireless network security standard. This howto explains how to configure and run a 802.11i supplicant (wpa_supplicant) with pre-shared key (PSK) authentication on your wireless network device.
wpa_supplicant is an EAP/WPA/WPA2 supplicant available for Linux, Windows and Unix systems. Windows binaries are available from the website. The following are two methods for installing wpa_supplicant under linux and FreeBSD.
Under debian compatible linux distributions, wpa_supplicant can be installed by typing
sudo apt-get install wpasupplicant
Under FreeBSD
cd /usr/ports/security/wpa_supplicant/ make install
or
pkg_add -vrf wpa_supplicant
wget http://hostap.epitest.fi/releases/wpa_supplicant-0.5.10.tar.gz
tar xfz wpa_supplicant-0.5.10.tar.gz
cp defconfig .config
make make install
Edit the wpa_supplicant configuration file (e.g. /etc/wpa_supplicant.conf), ant put the following
network={
ssid="YOUR-SSSID"
psk=PSK
}
To generate the wpa_supplicant.conf file, the wpa_passphrase tool can be used as follows.
wpa_passphrase YOUR-SSID PASSWORD
wpa_supplicant -B -i IFACE -Dwext -c /etc/wpa_supplicant.conf
Where IFACE is the name of your wireless interface.
iwconfig IFACE
dhclient IFACE
In order to avoid typing all these commands each time you reboot or want to connect to your wireless network, you can (under linux) use the /etc/network/interfaces file to automatically handle network association and IP address acquisition. For this purpose, put the following in /etc/network/interfaces
auto IFACE
iface IFACE inet dhcp
pre-up wpa_supplicant -Bw -Dwext -i IFACE -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant