
俺参考这里
http://www.codealias.info/technotes/wir ... inux_setup ,配置成功
俺用的是kubuntu 10.0.4,默认已自带wpa_supplicant 命令,所以跳过了安装步骤
为防止以后访问出错,先copy下来
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
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
* Get an IP address
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