september 17, 2006 : steve : 8 comment(s)
I got WPA-PSK working with CentOS4. I want to document this for myself, just in case I have to reinstall. Peruse these instructions if they are helpful to you. I got help from the madwifi wiki for a lot of this. This was the page I used, these instructions of mine are tailored to CentOS4.
First, add the atrpms to your yum repos. Create /etc/yum.repos.d/atrpms.repo.
Put inside that file:
[atrpms-stable]
name=RHEL 4 $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgcheck=1
enabled=1
includepkgs=madwifi* madwifi-kmdl* madwifi-hal-kmdl* libpcsclite1[atrpms-testing]
name=RHEL 4 $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgcheck=1
enabled=1
includepkgs=wpa_supplicant wpa_supplicant-gui
By using includepkgs in the repo definition, I can make sure that nothing other than the stuff I need from atrpms gets updated when I run yum updates.
Import atrpms signing key:
rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms Change the "enabled" to 1 so that you can do the next installation (then change back to 0 if you don't want to get updates to your base install):
yum install madwifi-hal-kmdl-`uname -r` madwifi-kmdl-`uname -r` wpa_supplicant wpa_supplicant-gui
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-PSKproto=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! This wasn't as easy as getting Ubuntu working with a WPA Wifi network, but I am glad that it works now! There wasn't much documentation on the internet for getting WPA working with RHEL and CentOS. I found the madwifi stuff by accident and it wasn't tailored to CentOS (or RHEL). Hopefully this is helpful!
Comments
It seems to me like maybe you spend more time installing Linux than you do actually using it.
September 17, 2006 @ 05:57 PM
I'm coming to the same conclusion also. Sigh.
September 17, 2006 @ 08:09 PM
True you do but about the journey not the destination. Isn't it?
September 20, 2006 @ 03:07 PM
Thanks man!
I had bought a WRT54G and uploaded the DDWRT firmware only to shelve it for a couple months because WPA was a pain in the a#$ and I was too lazy to do the legwork.
Now its up and running on my Centos laptop thanks to you
booeeo
September 24, 2006 @ 11:53 AM
Hi dude,
Thanks for the brilliand guide, made it easy as pie for me.
Jens
January 11, 2007 @ 01:38 PM
Thx for this topic.
merci from belgium
March 13, 2007 @ 08:43 AM
Does somebody tried this for CentOS 5.0?
I have an error...
/etc/init.d/hostapd start
Starting Hostapd:
Configuration file: /etc/hostapd.conf
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to master mode!
madwifi driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
[FAILED]
ss
October 26, 2007 @ 08:23 AM
YESSS!!! On CentOs 5, running on a DELL INSPIRON 8600 runs ok. The catch I was not aware of is the need to add "by hand" the last line in the script.
THANKS !
Guido
Guido
January 1, 2008 @ 03:30 PM