Wireless + Ubuntu 7.10 = love

As almost everyone around here, I was waiting for the new Ubuntu mostly because it promised improved wireless support. 7.04 haven’t even recognized my wireless card, after install, and also I had sound problems, though anything else seemed to work great.The 7.10 solved these right out of the box, but I still wasn’t able to connect via WPA-TKIP and WPA2-AES to my wireless Netgear router.

So, after a few days of digging and reading, I managed to make my wireless connection working. It’s not the most elegant solution, but for me it works, and that’s all what matters.
In this guide, I assume that your wireless card is recognized by Ubuntu, and it’s functional. In 7.10 you have the wpa_supplicant installed by default, so you won’t have to worry about it.
Here is with what I came up, and making my wireless working, exactly as it works under Windows.

  1. I removed the silly network-manager by typing “sudo apt-get remove network-manager” in a terminal.
  2. Now go to System->Administration->Networking, and make sure to fill the fields with the correct info, and enable the wireless connection.
  3. To make sure that everything is right, check your /etc/network/interfaces file. Open up the file by typing “gksudo gedit /etc/network/interfaces”.

For WPA-TKIP:

iface wlan0 inet static
address 192.168.0.25
netmask 255.255.255.0
gateway <your router’s ip>
wpa-ap-scan 1
wpa-pairwise TKIP
wpa-group TKIP
wpa-psk <your long wpa key>
wpa-driver wext
wpa-key-mgmt WPA-PSK
wpa-proto WPA
wpa-ssid <your essid>

auto wlan0

For WPA2-AES:

iface wlan0 inet static
address 192.168.0.25
netmask 255.255.255.0
gateway <your router’s ip>
wpa-ap-scan 1
wpa-pairwise CCMP
wpa-group CCMP
wpa-psk <your long wpa key>
wpa-driver wext
wpa-key-mgmt WPA-PSK
wpa-proto WPA2
wpa-ssid <your essid>

auto wlan0

Make sure that these, are in the file, if not then add the lines, and save the file, then you can close the gedit window.
4. In a terminal type in the followings, exactly in this order:
“sudo killall wpa_supplicant” [enter]
“sudo /etc/init.d/networking stop” [enter]
“sudo /etc/init.d/networking start” [enter]

5. Now we should take a look at our connection status in the “Network Monitor” applet.
6. Finally we can do a “ping google.com” right from the terminal.

So, by now we should have a working wireless connection, but if you will restart your PC, you will have to type in the commands from “section 4.”.
That’s really, really annoying, so here is the solution to get wireless at startup automatically.

Type in a terminal “sudo gedit /etc/init.d/wifi” and paste the followings in the file (basically our 3 commands):

#!/bin/bash

#kill all wpa_supplicant instances
killall wpa_supplicant

#stop the network interfaces
/etc/init.d/networking stop

#start the network interfaces
/etc/init.d/networking start

Close the gedit window, and type “sudo chmod +x /etc/init.d/wifi” to make the script “executable”. When done, we must add it to be executed at every system
start-up as the last “thing”. :))

To do that type the following in a terminal window:

“sudo update-rc.d wifi defaults 99”

Later if you will like to disable this you have two choices:

1. “sudo update-rc.d -f wifi remove” OR
2. “sudo chmod -x /etc/init.d/wifi”

Too test out this, just restart your computer and you should have internet access right after boot-up, just like on a Wind0ze machine. Totally rad huh?

[Updates Sun Mar 30, 2008]

This “post” proven to be really popular, so here are a few updates, to make even more users happy πŸ™‚

If you are getting your IP from your router automatically then you can replace this:

iface wlan0 inet static
address 192.168.0.25
netmask 255.255.255.0

with this

iface wlan0 inet dhcp

If you ping and you get no “reponse”, then it worth to check out your /etc/resolv.conf and make sure that it contains the following lines:

nameserver <your router’s ip>

You can edit / create this file by “sudo gedit /etc/resolv.conf”.

If it still doesn’t work, you may try changing “wlan0” to “wifi0″,”ath0” …

If you get disconnected you can always fire up a terminal and run “sudo /etc/init.d/wifi” to get your connection back, without any hassle …

Because the silly “network-manager” was removed you can add an “Network Monitor” to one of your Gnome Panels …

Also I’m thinking on coding a nice little GUI tool to do all this stuff, so stay tuned!

[Updates Sat Apr 26, 2008]

This works perfectly in the final release of Ubuntu 8.04 (Hardy Heron), just like Dave confirmed that it works with the beta.

[Updates Sat May 10, 2008]

The development of little GUI tool is on hold, eventually I will continue the development if there will be enough requests, but I seriously doubt it πŸ™‚

Please feel free to post any comments/suggestions/experiences, etc. related to this. :))

Advertisements

About icebreaker

Senior Software Engineer, Open Source Evangelist.

17 responses to “Wireless + Ubuntu 7.10 = love

  1. mauricek

    Hey Icebraker!

    I really enjoyed your STEP BY STEP instruction that worked for me as best as I can imagine.
    This little “problem” that wasn’t solved by the new Ubuntu release, has perfectly prevented a little frustration with the poor configuration via GUI.

    In my opinion, distribution releasers should be aware of the fact that the idea behind linux is not to provide a bad copy of windows.

    So, the way you wrote this solution gives us a chance to understand the way how this beautiful OS is working and helps the user to adapt this solution method for future problems or to give new users the possibility to make new users happy giving them positive experiences when it comes to a problem.

    THANK YOU VERY MUCH HELPING ME TO SAVE HOURS OF HOURS!#

    Maurice

  2. Great article and thank you for posting. This resolved the issue I was having!

  3. dziadgba

    everything worked great for me!
    many thanks

  4. Ian

    Well thanks it worked. I was deermined to get Ubuntu and wifi working but your step by step guide was the key.

  5. Alex Ro

    You Are The Man! I Will Try That Right Away! Thank U!

  6. Justin

    This is THE BEST AND ONLY document I could find on the entire internet that explains very easily how to get this working in Ubuntu. Shame on the developers for not making it this easy. I’m a decent sys admin, but this should be as easy as 1 2 3 for those who are thinking of switching from Windows to Linux! Shame on the Ubuntu developers for having someone have to even write this up! Don’t you want Linux to overtake Windows?

  7. Allie W.

    You know what? icebreaker+Allie W. = love! I have spent over 15 hours straight on this horrible wireless problem, working till 6AM yesterday and it was only until I came upon your ingenious trick that my internet starts up after reboot. I just got Gutsy a couple of days ago and I know nothing about Linux. So you can see why I feel the love for people like you who post workable, followable solutions on the web. Thanks so much!

  8. Dave

    Your fix works in 8.04 beta.
    Thanks.

  9. Thanks for the heads up Dave, personally I’m waiting for the final release of 8.04 … and yeah I expected it to work in future versions πŸ™‚

  10. Oathsbreaker

    I was trying to get the WPA work on Ubuntu 7.10, i did your guide step by step but nothing works for me, then i decide to check mi wireless configuration of my 2Wire (i was thinking about change the security to WEP) and i find out that i was using 802.11b, so i changed to 802.11g and now i can connect my PC to internet using the NetworkManager!!!!! with WPA security!!! O.o

    i hope this info help someone else who read this post

    cya

  11. That’s nice to know, but the configuration of your own routers is beyond the scope of this guide πŸ™‚ Anyway the 2Wire routers are the crappiest and with tons of problems …

  12. Oathsbreaker

    Yea, i know that, but my point is that i have my WPA connection working fine and i do nothing more that use the NetworkManager (using a 802.11g wireless :P).

    #/etc/network/interfaces :
    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet dhcp
    #/etc/resolv.conf:
    # generated by NetworkManager, do not edit!

    nameserver

    i just want to share it, and try to help.

    and tell me, did you do the little GUI tool? πŸ˜€

    PD: 2wire sux! πŸ˜›

  13. Almost all the newer routers are configured to use 802.11g by default as far as I know, but of course there is 802.11b for compatibility reasons …

    Come on, admit it that the Network Manager is crap! Personally I hate those “generated by YX, do not edit” this is so last year πŸ™‚

    The “little GUI tool” is under construction, really close to finish it πŸ˜€

  14. Richard

    Hi,

    Unfortunately this doesnt work for me. I have Ubuntu 8.04 x64 installed and I bought a RALink RT2870 chipset usb stick.

    I followed the instructions carefully but I do not seem to get the WPA2 encryption right.

    My /etc/network file states
    auto lo
    iface lo inet loopback

    iface ra0 inet static
    address 192.168.0.10
    netmask 255.255.255.0
    gateway 192.168.0.1
    wpa-ap-scan 2
    wpa-pairwise CCMP
    wpa-group CCMP
    wpa-psk
    wpa-driver wext
    wpa-key-mgmt WPA-PSK
    wpa-proto WPA2
    wpa-ssid aarnink_N

    auto ra0

    Then I issue the command ifdown ra0 and then ifup ra0
    This is the result if I take a look with iwconfig ra0

    root@mainframe:/etc# iwconfig ra0
    ra0 RT2870 Wireless ESSID:”aarnink_N” Nickname:”RT2870STA”
    Mode:Managed Frequency=2.412 GHz Access Point: 00:60:B3:A6:F9:5A
    Bit Rate=300 Mb/s
    RTS thr:off Fragment thr:off
    Encryption key:off
    Link Quality=70/100 Signal level:-56 dBm Noise level:-87 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    Can someone help me?

  15. WOW!

    THIS WORKS!

    I went to every website from the official Ubuntu wiki to random forums trying to get my system to connect to my sitecom router with wpa2 aes ===> none of it helped…

    I was very close to throwing my laptop out my window until I landed on this site! THANKS!

  16. Your method of telling everything in this paragraph is really fastidious,
    all can effortlessly be aware of it, Thanks a lot.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: