Guide: Config WPA2 on Raspberry Pi

Posted by crimsonpisang on   0 comments   0 trackback

A while ago I've recieved my wireless N usb adapter which I've got for about 3 bucks on ebay. Most of the guide I found on the web only shows how to configure WPA which does not work on my WPA2 home network. After some crafty searches, I finally got mine to work.

rpi

Here's a quick guide to get wifi on your raspberrypi up and running.

#1 Make sure the adapter is recognized by the rPi. Use this command to check.

~$ lsusb


#2 Check the interface the adapter is assigned to

~$ iwconfig
lo no wireless extensions.
wlan0 no wireless extensions.
eth0 no wireless extensions.


3# Edit the network/interfaces file.

~$ sudo nano /etc/network/interfaces
================================================
auto lo

iface lo inet loopback
iface eth0 inet dhcp

#auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
================================================


4# Edit wpa_supplicant file

~$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
================================================
network={
ssid="YOUR SSID HERE"
psk="YOUR PASSWORD HERE"
scan_ssid=1
proto=WPA2
key_mgmt=WPA-PSK
group=CCMP TKIP
pairwise=CCMP TKIP
priority=5
}
================================================



5# Now we're gonna config so the rPi will auto bring up the wireless interface.

sudo nano /etc/rc.local
================================================
echo "Starting WiFi..."
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sleep .5s
dhclient wlan0
echo "WiFi should be started"
exit 0
================================================


6# Allow rPi to ping gateway every min.
This part is optional. Use this if your rPi put the wifi to sleep when there's no activity.

crontab -e
====================================
*/1 * * * * ping -c 1 192.168.0.1
====================================


7# While still connected via HDMI or SSH via lan, reboot the rPi.
After fully rebooted. the activity LED on the wifi adapter should be blinking. Test for connectivity by ~$ ping google.com
If it works then your done.

Post comment

Only the blog author may view the comment.

Trackback

trackbackURL:http://hwjunkie.blog138.fc2.com/tb.php/10-f6bba745