WPA on Ubuntu Dapper 6.06 LTS

WIFI support and documentation of using WPA on Ubuntu (or anywhere else for that matter) is RIDICULOUSLY BAD, if not non-existent. The vast majority of the docs you will find show how to setup WEP, which is horribly broken and insecure, not to mention ancient in this day and age. Obviously, we all must use WPA or better, yet linux seems to only now be catching up with this.

wpasupplicant has been around for ages, and works fine, but is complex and certainly not newbie friendly.

This is a pretty simple way to do it, the 'right' way, and one that works properly.
  1. Get your WIFI card driver installed. I had to use DriverLoader to load the windows drivers for the rather substandard built in Broadcom card in my laptop.
  2. Edit /etc/network/interfaces and find the section relating to your Wifi card. Mine was given eth1 by driverloader.
    • cp /etc/network/interfaces /etc/network/interfaces.old
    • nano /etc/network/interfaces
      • add (under iface eth1 inet dhcp):
        • wpa-ssid yourssid
        • wpa-key-mgmt WPA-PSK
        • wpa-passphrase yourpassphrase
        • #wpa-driver yourdriver #(this is optional, mine works fine without it)
  3. /etc/init.d/networking restart

Now wasn't that easier than using wpasupplicant? It should start automatically on boot, and everyone should be happy. Why Ubuntu couldn't integrate this into the GUI is beyond me, and I won't take the time to find out :) It works, I am happy.

EDIT 08/26/2006

My new instructions: to skip all this file editing and mucking around.

  1. Install ubuntu
  2. use a network cable if possible (if not, do what I said above to get online and follow the rest of the steps.Afterwards, restore your /etc/network/interfaces to default - 'cp /etc/network/interfaces.old /etc/network/interfaces')
  3. Add repositories for universe and multiverse
  4. sudo apt-get install network-manager-gnome
  5. Click the little icon that appears in your taskbar
  6. Choose your network
  7. Enter WPA key
  8. Surf
See also https://help.ubuntu.com/community/WifiDocs/WPAHowTo

Comments

WPA weird problem

I am running xubuntu 8.04 and whenever i login, if i go to the place where you enter the wpa key, i see 64 characters there instead of my 10 digit wpa key. the internet doesn't work, and i have to re-enter my 10-digit key, switch to wpa2, switch back to wpa(1) and then it works... until i log off again. Any ideas on what is going on and how to fix it? E-mail me at because i will probably never revisit this page again.

WPA

I'm not sure what I'm doing wrong, I've installed Gnome network manager. It shows me Network Connection Properties (eth0 and eth1). I have eth0 configured as a wired connection, so I select eth1. I have 3 connections in the dialog box, Wireless Connection, Ethernet Connection and Modem Connection. When I click on Wireless Connection, it activates the Properties button. When I then click on the Properties button it has a check box next to Enable this connection and says 'Network Name (ESSID). I enter my network SSID here. Next it says Key type - Hexadecimal and the options are Plain ASCII or Hexadecimal. Since I don't know my key in hex, I chose ASCII. Next it says WEP Key. (I'm running WPA2-PSK) I enter my key here. Below this it says Connection Settings:
Configuration - DHCP (All of which I leave alone)
IP address
Subnet mask
Gateway address

Then I click OK.

It tries to activate the connection and it times out.

Any help would be appreciated.

Thanks.

Wrong Network Manager

That is the gnome networking properties dialog you are playing with I think... The network-manager applet shows up near your clock as 2 balls with an orbital path by them. It should replace the gnome networking applet that usually sits there.

You simply click the applet, it should atuomatically show you close by hotspots, and you choose it, enter key, and go!

Main Problem

On numerous setups, including the cards you are using i have found that the simplist quickest way to get a connection, even when there is one specified in /etc/network/interfaces.... once ubuntu is loaded i have to ifdown eth1, ifup eth1, and as i do this i bring up another terminal and do iwlist scan. this then scans for the networks and i pick my connection and address instantaneously.
I have found that if i just kill the dhclient3 process do iwlist scan then run dhclient3 eth1 the effect is the same. an instant connection. Most of the GUI's available are CRUD, including network manager. Most of them fail to get a connection at all, and the ones that do, never as quick as the method above, and none of them seem to want to connect on boot....
Can i fix this so that a iwlist scan is run as root on boot as it tries to bring up eth1? it might fix the problem . . . .

iwlist on boot

You can try it, although I am not sure why this would have any effect, other than making the network wait (as the sleep 2 command was doing in network/interfaces).

To do it on every boot, you could just add you iwlist command to your /etc/rc.local which should get it executed at the end of your bootup sequence.

RE: WPA on 6.06 - which wifi card are you using?

I only ask because according to this link:

http://live.gnome.org/NetworkManagerHardware

there are very few cards that fully support WPA through NM (IPW2100 looks the best).
I have a Ralink RT2500 chipset card and the above page seems to suggest that WPA won't work with Network Manager.
If you agree, is there any way I can get WPA working, or will I have to settle for wired or WEP access?
thanks

Rlink Card and NM compatibility

I would have to defer to that list, as always, if drivers are not supplied by the vendor, you are at the mercy of waiting for a developer with the same card to get it working. This will be impossible on some types of hardware, or at least very difficult.

I would say you are out of luck.

Personally, I like the Atheros based cards. I have a DWL-G630, and I just got 2 Netgear WG511T cards that also work fine. I also use a BCM43xx with driverloader as mentioned.

wpa-conf

If you use wpa-* as stated above on /etc/network/interfaces, you can only setup one wireless connection.

For the roaming fellow, if you already have a /etc/wpa_supplicant.conf setup with several networks and priorities, just use

iface eth1 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

and all settings are loaded into wpa_supplicant without hassle.

Daniel

here my error report

hi it dosen't work for me :((
here the report when restarting the network:
Listening on LPF/eth1/00:02:2d:87:15:42
Sending on LPF/eth1/00:02:2d:87:15:42
Sending on Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 11

So this indicates that you

So this indicates that you are not connected to the router, or that DHCP is not working. You should try using the network-manager-gnome instructions if you are not, and if you are using the first instructions, you should try using the commands:

ifdown eth1

ifup eth1

This should re-initialize WPA and try to fetch the IP address again.

You could also try to set a static IP in order to eliminate the possibility of DHCP problems. The problem is there are many places things could go wrong; wrong passphrase, badly set up AP, many different configuration possibilities.

Try and simplify things, make sure you can get an IP normally, try temporarily using WEP or no encryption to be sure you can connect normally.

Does not Work

I followed these instructions and only have the option to choose three different WEP keys.

I think you should try the

I think you should try the other way then... I assume you tried with gnome-network-manager?

I can assure you all, it does work perfectly, please don't get discouraged :)

Feel free to post info about your errors or problems here, I will try to help.

thanks...cuz it didn't work

thanks...cuz it didn't work the next time :

Lily

not working

It does work, however, it seems wpasupplicant takes too long to get connected when booting up, so the dhcp request fails. What you need to do is add a stanza in /etc/network/interfaces in same place as wpa stanzas saying:

pre-up sleep 2

You can also just not have it run at startup then use the

ifup eth1
and
ifdown eth1

To bring it up and down.

It just works

Sweet, thanks

Dave

Oooo

I got wpa_supplicant and wpa_gui working but hadn't figured out how to automatically get this started.

Thanks!
Lily

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options


Check out Gangster Politics Montreal.