Saturday, March 22, 2008

Ubuntu and WEP


I installed Ubuntu Linux on my old work laptop. I'll probably have to give this back to work at some point, but I have the option to buy it too. It's an old Dell Latitude (D600) that's a bit banged up from lots of time on the road. But it still works.

So I grabbed Ubuntu 7.10 Desktop and installed it. The LiveCD runs fine, but slow as it's all off the CD. Installing to hard disk is really straightforward, but it kept hanging at 90% when it was detecting hardware (or configuring hardware depending on when it actually hangs). Googling around a bit lead me to the answer to add "-noapic" and "-nolapic". It took me a minute to figure out where to do this, as the launcher for the installation program clearly wasn't the right place since these are basically options for starting Linux rather than an application. But the boot screen options from the LiveCD lets you add parameters then, so I stuck these on to the end of the initial startup command. The OS loaded OK again, and this time the installer completed. Reboot, everything looked good (better than "Error with OS" or something when rebooting after the stalled attempts).

The next step was to get wireless networking working. I've been working with Linux off and on for years, but never on a laptop. I'm very familiar with tools like "ifconfig" and "netstat" to get network bearings, but this doesn't help with wireless. I finally found "iwconfig" but couldn't get it to accept any settings -- just telling me it couldn't do the "SET" operation. The installer let me set up my username and password, but not the root password (I still need to figure out what that is!). Without the root password, I couldn't run "su" and test it as a permissions issue.

So I dug around the Internets a bit more and eventually hit somewhere and clicked the remnants of Linux days in my brain. The key of course is to use "sudo" which then just asked for my user's password (super user rights, without actually using root).

To cut this to the point, the key is to use "sudo" with "iwconfig" to set the key pieces of your wireless setup, as follows:

sudo iwconfig eth1 essid mysid

sudo iwconfig eth1 key a1b2c3d4e5

Just set the ID and the WEP key. And I just use 64-bit WEP, which needs just 5 hex bytes. Finally you need to set it up to use DHCP:

sudo dhclient3 eth0

Now, in theory all of this could be done in Ubuntu's Network Manager thing, but for some reason whatever I set there just wouldn't stick. I confirmed the Internet existed through Firefox, then rebooted and everything still worked. Wonderful.

I'll probably let the kids use this for a while for their Webkinz stuff and general email (how may 4 and 6 year olds can say they use Linux??). We'll see if it's actually worth buying from work, since I'd need to replace the battery to make it at all worthy.

No comments: