2008年12月27日星期六

Connecting to an AP with WPA-PSK

I got help from the madwifi wiki for a lot of this.
http://madwifi-project.org/wiki/UserDocs/WPA_PSK_on_Both_Ends
http://ultramookie.com/wayback/2006/09/17/centos4-and-wpa-psk/

The Station (client) Side

Get wpa_supplicant


On All workstations that want to subscribe to the WPA enabled AP, do the following:

Go here: http://hostap.epitest.fi/wpa_supplicant/ and get: Latest stable release: (as of this writing: wpa_supplicant-0.4.7.tar.gz). Unpack it to /usr/src/wpa_supplicant-0.4.7


Copy this to /usr/src/wpa_supplicant-0.4.7/.config


CONFIG_DRIVER_MADWIFI=y
CFLAGS += -I/usr/src/madwifi-ng
CONFIG_CTRL_IFACE=y

Now build wpa_supplicant on the station

cd /usr/src/wpa_supplicant-0.4.7
make clean
make
make install

Run wpa_passphrase to make your PSK

You’ll have to edit /etc/modprobe.conf and add:

alias ath0 ath_pci
options ath_pci autocreate=sta

Reboot.

When the system comes up, you’ll want to configure wpa_supplicant for your network:

/usr/sbin/wpa_passphrase YOUR_AP_SSID “YOUR_WPA_PSK_PASSPHRASE” >> /etc/wpa_supplicant/wpa_supplicant.conf

Edit /etc/wpa_supplicant/wpa_supplicant.conf and add:

key_mgmt=WPA-PSK

proto=WPA

Test that your setup is working:

iwconfig ath0 essid “YOUR_AP_SSID”

ifconfig ath0 SOME_IP_ADDRESS up

/usr/sbin/wpa_supplicant -dd -Dmadwifi -iath0 -c /etc/wpa_supplicant/wpa_supplicant.conf

If you see:

CTRL-EVENT-CONNECTED - Connection to AP_ADDRESS completed (auth)

Then you’re OK.

Now, gettting things automated. First, setup your wireless card like usual in Applications -> System Settings -> Network. Then edit /etc/sysconfig/network-scripts/ifup-wireless

Add to the end of that file:

/usr/sbin/wpa_supplicant -w -B -Dmadwifi -iath0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Test to see that it works with:

/etc/init.d/network restart

If it does, then you're all done!

Sometime I have connection problem with my linksys WRV54G router the network will be no response, I don't know why? And after I restart the router, they it will worked again.

没有评论: