Wednesday, June 6, 2012

Raspberry PI - Manually configuring WiFi acces on Debian

In My previous post I explained how to install the firmware for the Sagem XG-760N WiFi USB dongle on the RAspberry Pi, and was ending on how to configure your WiFi connexion manually or using wicd.

wicd and wicd-curses are great for configuring quikly and easily your WiFi connexion from the command line, but it ends up having 2 major limitations :

1 - wicd cannot control 2 interfaces at the same time; This means eth0 OR wlan0 can be UP at the any given time, but not both.

2 - It takes ages to connect to your WiFi Access Point at boot time (around 60 secondes)

Configuring WiFi access manually overrides those limitations;

Here is how to :

Prereqs :


OS Debian "squeeze" SD Card image (debian6-19-04-2012)

Installed firmware : See previous post

Step 1 - Make sure you are within range of your WiFi ccess Point  : 

The following command should list all the available access point, including yours : 

iwlist wlan0 scan

Step 2 - Make sure WPA Supplicant is installed : 

sudo apt-get install wpasupplicant

Step 3 - Stop wicd daemon now and at boot time (if you installed it already) : 

sudo update-rc.d -f wicd remove
sudo service wicd stop

Step 4 - Configure your WPA Crypto access : 

Create the following file -> /etc/wpa.conf  : 

sudo vi /etc/wpa.conf

Add the following to it : 

network={
ssid="YOUR-SSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR-WPA-PASSWORD"
}

Step 5 - Configure your interfaces to use the previous WPA configuration : 

Open the following file -> /etc/network/interfaces  : 

sudo vi /etc/network/interfaces

For DHCP on the wired (eth0) and Wifi (wlan0) connexion,  make sure the file looks like this : 
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.conf

Step 6 - Restart your network stack to take changes into account

sudo /etc/init.d/networking restart

That's it



No comments: