Getting Wireless LAN Working in Linux using ifcfg and wpa_supplicant over WPA2_Personal with AES
This took me almost a full day to figure out so I figure I write down what I did for reference and for others benefit, seeing as I optimized my titles, tags and content. Makes it easier to find this site when using the searches I did to get to the information. I had to piece this together from multiple posts and instructions as each one didn’t work exactly right.
So, I recently got AT&T uVerse, and after configuring it accidentally with a WEP Open Shared Key, realized that not only is it not secure, but some devices have major problems connecting to it. Sometimes I would have a visitor with a laptop come over and the wi-fi just wouldn’t work.
I know Windows 7 has some issues connecting to an older less secure network, in fact, I have found myself having to manually configure networks sometimes in order to get it working if a network is using WEP, the automatic detection just fails. On my network however, even windows XP was failing, so it was time to change. I decided to go with WPA2_Personal using AES Encryption.
Everything was fine, all myd evices connected happily, even the linux box…taht is until I decided ot try to configure it using ifcfg and not Fedora’s built in whatever it is…
I knew how to bind eth0 style devices to my network, but I had never had to do it wirelessly, needless to say the need arose only because my wife decided that it was not acceptable to have a long wire running from the bedroom to the living room to use the extra PC as a server…hence the wireless solution! (At least now I don’t trip over the cord at night!)
I wont bother to bore with the details of the errors I was getting, so, after much frustration, here is how I figured out how to do it:
Firstly, find out if your device is present
ifconfig
Your output should look something like this:
lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:3199 errors:0 dropped:0 overruns:0 frame:0TX packets:3199 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:257327 (251.2 KiB) TX bytes:257327 (251.2 KiB)wlan1 Link encap:Ethernet HWaddr 00:FD:07:92:D9:54inet addr:192.168.1.87 Bcast:192.168.1.255 Mask:255.255.255.0inet6 addr: fe80::2fd:7ff:fe92:d954/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:7424 errors:0 dropped:0 overruns:0 frame:0TX packets:955 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000
cd /etc/sysconfig/network-scriptsvi ifcfg-wlan1
DEVICE=wlan1ONBOOT=yesTYPE=WirelessBOOTPROTO=dhcpESSID=”Command Center”CHANNEL=2
yum install wpa_supplicant
wpa_passphrase “Command Center” mypassword
network={ssid=”Command Center”#psk=”mypassword”psk=5cdd33b91fb63436dd4fe751fe63d63b50bd37412dec1dcabb5cc7eefd5570c5}
cd /etc/wpa_supplicantvi wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicantctrl_interface_group=0eapol_version=1ap_scan=2fast_reauth=1network={scan_ssid=0proto=WPA RSNkey_mgmt=WPA-PSKpairwise=CCMP TKIPgroup=CCMP TKIPssid=”Command Center”psk=5cdd33b91fb63436dd4fe751fe63d63b50bd37412dec1dcabb5cc7eefd5570c5}
sudo ifconfig wlan1 up
iwlist scan
sudo iwconfig essid “Command Center” channel 2
sudo wpa_supplicant -B -Dwext -iwlan1 -c/etc/wpa_supplicant/wpa_supplicant.conf
sudo dhclient wlan1
Manually Adding IP Address Range to Linux – Fedora and Redhat – Thanks @Softlayer
This took me almost a full day to figure out so I figure I write down what I did for...