Kubuntu

Wireless with wpasupplicant easier then you think

Revised on: 11-16-2008 Changed wpa-driver to wext. Now also working with Kubuntu 8.10 i686 kernel 2.6.27-7-generic

Revised on: 09-01-2008 Now working with Kubuntu 8.04.1 i686 kernel 2.6.24-19-generic and Kubuntu 8.04 x86-64 kernel 2.6.24-19-generic.

Why use wpasupplicant? KNetworkManager works just fine. Yes KNetworkManager is fine but the pass phrase is stored in Kwallet and this means every time you want the network to connect you will have to put in your Kwallet password. Also if you for some reason need wireless to be up without starting the desktop environment you will need wpasupplicant because you will not be able to open up Kwallet in a terminal environment. Wpasupplicant will give you wireless all the time without having to use Kwallet.

As always the methods used here are tested by me and working on my boxes(we have 3 boxes with wireless through wpasupplicant).

There is a wpasupplicant user interface but I’ve never gotten it to work. So this how to is terminal commands only sorry “point and click” people.

First install wpasupplicant if you don’t have already.

sudo apt-get update && sudo apt-get install wpasupplicant

Now we create a pass phrase using a tool that was installed with wpa_supplicant the syntax is as follows:

wpa_passphrase ssid pass phrase

Where ssid is the name you gave the router and pass phrase is the phrase you used to secure your router.(If you don’t know or never have secured your router then this is the time to do so).

wpa_passphrase myrouter thisisalongpassphrasesonobodycanguess

the outcome of this is:

network={
        ssid="myrouter"
        #psk="thisisalongpassphrasenobodycanguess"
        psk=fd50e5fb2b66493702338dd5175241d2e8dd7dd42fc292bbb7c56b01f9e9fdc0
}

Time to create wpasupplicant’s config file:

sudo nano /etc/wpa_supplicant.conf

This will create a new file named wpa_supplicant.conf. I found out through experimentation that this file doesn’t need all the parameters as described in the man file. It only needs the following for my setup.

network={
        ssid="myrouter"
        psk=fd50e5fb2b66493702338dd5175241d2e8dd7dd42fc292bbb7c56b01f9e9fdc0
}

You’re setup, router settings, might need more parameters. But for me this is all that is needed note that I removed #psk=”thisisalongpassphrasenobodycanguess” for security reasons.

We need to add the following to /etc/network/interfaces :

auto ath0
iface ath0 inet dhcp
     wpa-driver wext
     wpa-conf /etc/wpa_supplicant.conf

You’re contents might be different maybe there is already some stuff in here maybe there is not (when you are using KNetworkManager for instance). When using 8.04 the driver might have to be changed to madwifi

Restart the network:

sudo /etc/init.d/networking restart

Or restart your box if that doesn’t work.

Now you should have wifi without using KNetworkManager.

Please post a comment and tell us if this worked for you or not in that case I will try to help you to get it fixed.

18 Comments

Comments are closed.

Powered by: Wordpress