My ndiswrapper and wpa_supplicant howto for wpa
It is always a good idea to have wireless security by enabling WPA or WPA2. In order to do this obtain an application called the wpa_supplicant which can be downloaded here
http://hostap.epitest.fi/wpa_supplicant
I have had problems with the latest stable version which was 0.3.9 and had to go with the latest developement version wpa_supplicant-0.4.5.tar.gz. Likewise for different versions of ndiswrapper. After extracting wpa_supplicant create a .config file with the following options to get it to work with the ndiswrapper and then make it and copy the appropriate files into their correct directory.
Code:
[root@localhost rpms]# tar -xvzf wpa_supplicant-0.4.5.tar.gz
[root@localhost rpms]# cd wpa_supplicant-0.4.5
[root@localhost wpa_supplicant]# CONFIG_DRIVER_NDISWRAPPER=y > .config
[root@localhost wpa_supplicant]# CONFIG_CTRL_IFACE=y >> .config
[root@localhost wpa_supplicant]# make
[root@localhost wpa_supplicant]# cp wpa_cli wpa_supplicant wpa_passphrase
/usr/local/bin/
Now make a configuration file with the appropriate security settings in /etc/. Mine reads as follows for a WPA TKIP configuration.
Code:
[root@localhost wpa_supplicant-0.4.5]# nano /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant # for wpa_cli support
network={
ssid="joeshmoe" #Access Point name
psk="mySecret" #My WPA password (plaintext or encrypted)
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
}
Now see if things are working. It is important that you configure the access point before you start wpa_supplicant.
Code:
[root@localhost ~]# iwconfig wlan0 essid any
[root@localhost ~]# ifconfig wlan0 up
[root@localhost ~]# wpa_supplicant -Dndiswrapper
-iwlan0 -c/etc/wpa_supplicant.conf -Bw
[root@localhost ~]# dhclient wlan0
If there are any errors, replace the wpa_supplicant option -Bw with -dd and try to debug the output to find the problem.
Now automate this process by issueing the command
Code:
[root@localhost root]# echo "/usr/local/bin/wpa_supplicant -Dndiswrapper
-iwlan0 -c/etc/wpa_supplicant.conf -Bw" >>
/etc/sysconfig/network-scripts/ifup-wireless
If something goes wrong get ethereal, run tethereal in a shell, if the AP does not reply to your DHCP Discover with an Offer, then there is probably a problem with your encryption method.
Hopefully this will help, I create notes on everything I do and this was copy and pasted from that.