The following steps aims to set up wireless with WPA configuration for Linksys WUSB54G on Ubuntu using command line. They have worked for me and I’m just taking notes and sharing what I did. Hopefully you’ll find it helpful if you need to go through the same process. My Ubuntu version is 9.04 but this should work in newer versions too.

Prerequisites

You’ll need to have wpasupplicant If you don’t already have wpasupplicant:

[code lang=“bash”]sudo apt-get install wpasupplicant[/code]

Obtaining your WPA psk in /etc/wpa_supplicant.conf

You can use wpa_passphrase to generate a configuration file for your /etc/wpa_supplicant.conf. In the following example, my wireless SSID is ‘MySSID’ and my passphrase is ‘text passphrase’.

[code lang=“bash”]kahwee@cafyn:~# sudo wpa_passphrase MySSID

reading passphrase from stdin

text passphrase

network={

ssid=“MySSID”

#psk=“text passphrase”

psk=0d9b2f6e1ae6b7175a4c3d0527c16ba5db41d063bc9232aafdce3b5539aaddea

}[/code]

It generate a short configuration for me where I copy and save into /etc/wpa_supplicant.conf.

[code lang=“bash”]sudo nano /etc/wpa_supplicant.conf[/code]

That’s my only setting there:

[code lang=“bash”]network={

ssid=“MySSID”

scan_ssid=1 #1 for unbroadcasted SSID

#psk=“text passphrase”

psk=0d9b2f6e1ae6b7175a4c3d0527c16ba5db41d063bc9232aafdce3b5539aaddea

}[/code]

As my wireless router doesn’t broadcast its SSID, scan_ssid=1 is needed. If yours does broadcast, you can comment that line out.

Setting

In order to let the computer auto configure the network settings, you can place the following settings in your /etc/network/interfaces file where you can set what driver to use. In my case it is ‘wext’ which is compatible with Linksys WUSB54G (USB adapter model). Yours may be different, you can consult Ubuntu’s documentation for that. Edit it:

[code lang=“bash”]sudo nano /etc/network/interfaces[/code]

My /etc/network/interfaces file and I’m using static IP:

[code lang=“bash”]# The loopback network interface

auto lo

iface lo inet loopback

Wireless configuration

auto wlan0

iface wlan0 inet static

address 192.168.7.134

netmask 255.255.255.0

network 192.168.7.1

broadcast 192.168.2.255

gateway 192.168.7.1

wpa-driver wext

wpa-conf /etc/wpa_supplicant.conf[/code]

If you’re using DHCP, it’s just:

[code lang=“bash”]# The loopback network interface

auto lo

iface lo inet loopback

Wireless configuration

auto wlan0

iface wlan0 inet dhcp

wpa-driver wext

wpa-conf /etc/wpa_supplicant.conf[/code]

Now save and restart your system and you should get it to connect to your wireless network on system start up. Hope you get it working.

comments powered by Disqus