Wireless Security - WPA2 PSK using wpa_supplicant howto

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.


Steps for configuring and using WAP2/PSK on your wireless device


1. Install wpa_supplicant

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.


Install using package managers

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

Compile from source
  • Downloaded wpa_supplicant from here  here
   wget http://hostap.epitest.fi/releases/wpa_supplicant-0.5.10.tar.gz
  • Extract the archive
   tar xfz wpa_supplicant-0.5.10.tar.gz
  • Create a .config file
   cp defconfig .config
  • Build and install
  make 
  make install

2. Configure

Edit the wpa_supplicant configuration file (e.g. /etc/wpa_supplicant.conf), ant put the following

   network={
     ssid="YOUR-SSSID"
     psk=PSK
   }
  • “PSK” is the PSK generated from the password shared with the wireless access point
  • “YOUR-SSID” is the (B/E)SSID of the wireless access network.

To generate the wpa_supplicant.conf file, the wpa_passphrase tool can be used as follows.

wpa_passphrase YOUR-SSID PASSWORD

3. Run the wpa_supplicant daemon

wpa_supplicant -B -i IFACE -Dwext -c /etc/wpa_supplicant.conf

Where IFACE is the name of your wireless interface.

  • Check that you are associated
 iwconfig IFACE
  • Get an IP address
 dhclient IFACE

4.Automating

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值