Linux wireless networking = text adventure

November 24th, 2007

Before the days of fancy graphics, World of Warcraft and 1GB video cards, there were text adventures. Lest you think “text adventure” an oxymoron, let me remind you how it works. It’s a bit like Windows Notepad, except the computer types back at you. A typical session might go like this:

You are in a forest, surrounded by trees. Exits lead E, N, S.
>E

You go east. You are in a clearing. An Elf is here. The elf is carrying: a small axe.
>Talk to Elf

You attempt to address the Elf but he seems more interested in the map he is carefully studying.
>Hit Elf.

Can’t do that.
>Attack Elf

Unknown verb - “Attack”.
>Smash Elf

The verb “Smash” cannot be used with “Elf”.
>Exit

Bye…thanks for playing “Crappy Text Adventure”.

Fascinating stuff, eh? Who needs Halo 3 when you have glorious, monochrome ASCII and your imagination?

The reason I bring this is up is that every time I try to get wireless networking to function in Linux, I feel like it’s 20 years ago, and I’m playing Zork or some such game. I’ve tried Fedora, Mepis, Ubuntu, Knoppix, Slackware and CentOs. On not one single Linux system have I been able to get Linux networking to behave easily and consistently.

This time I thought I had it — I installed everyone’s darling Linux distro, Ubuntu (”Gutsy Gibbon”), hoping that its mainstream-ness would help with the wireless networking woes. For a few sessions it worked just fine. Then it suddenly started acting weird. I’d boot up, and the blue wireless light wouldn’t come on. Or, it would see my wireless network, but simply not connect. I’ve tried the native Broadcom driver (which allegedly is rubbish…and you need to download the firmware separately to get it to work) and the infamous ‘ndiswrapper’, a driver that wraps the Windows native drivers to get around the manufacturers’ failure to produce Linux drivers. Here’s a typical session trying to get the damn thing working - remind you of anything?

root@tachyon-linux:~# ps alx | grep wpa
5 0 6360 1 15 0 3852 1276 - Ss ? 0:00 /sbin/wpa_supplicant -Bw -Dwext -ieth1 -c/etc/wpa_supplicant.conf
4 0 6396 1 15 0 3848 1452 - S ? 0:00 /sbin/wpa_supplicant -g /var/run/wpa_supplicant-global4
0 0 6409 5950 18 0 2976 764 pipe_w S+ pts/0 0:00 grep wpa

Ah, good…the supplicant is running….wait! There’s two of them…that’s not so good. But let’s continue.

root@tachyon-linux:/# ifconfig
eth0 Link encap:Ethernet HWaddr 00:C0:9F:AC:5B:78
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:20 Base address:0xa400

eth1 Link encap:Ethernet HWaddr 00:14:A5:22:26:E4
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:553 (553.0 b) TX bytes:3979 (3.8 KB)
Interrupt:17 Memory:b0206000-b0208000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Hmm…it should be wlan0, but it’s eth1. That’s not good either. And the little network spinny thing in the tray…isn’t spinning. Let’s try to force it to grab an IP address:

root@tachyon-linux:/# dhclient eth1
Internet Systems Consortium DHCP Client V3.0.5
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth1/00:14:a5:22:26:e4
Sending on LPF/eth1/00:14:a5:22:26:e4
Sending on Socket/fallback
DHCPREQUEST on eth1 to 255.255.255.255 port 67
DHCPREQUEST on eth1 to 255.255.255.255 port 67
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6
No DHCPOFFERS received.
Trying recorded lease 192.168.0.3
SIOCSIFMTU: Invalid argument
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

At first I read SIOCSIFMTU as “STFU” and thought Linux was insulting me, but then I realized it’s just some weird “C” preprocessor macro that has leaked through to the user “interface”. Of course, Linux sees my network just fine, but just refuses to connect, as the following shows:

root@tachyon-linux:/var/run# iwlist scan

eth1 Scan completed :
Cell 01 - Address: …
ESSID:”myessid”
Protocol:IEEE 802.11b
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality:90/100 Signal level:-38 dBm Noise level:-96 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:atim=0
IE: WPA Version 1
Group Cipher : WEP-40
Pairwise Ciphers (1) : WEP-40
Authentication Suites (1) : PSK

I should point out that all this can be done through one of the various UI network “applets”, but they tend to be even more obscure and buggier than the command line equivalents.

Eventually, through some ill-remembered serious of manipulations, I managed to get connected. I still don’t know exactly how I managed it, or even if it will connect next time I boot. Ain’t Linux wonderful?

“Managing expectations”

November 22nd, 2007

Follow up to “The Wonders of Offshore Tech Support”

March 9th, 2007

The most beautiful thing in all of mathematics

February 28th, 2007

So…I had my identity stolen…

February 27th, 2007

The wonders of offshore tech support

February 26th, 2007

Sometimes, dumb is good.

February 22nd, 2007

How to create a Media Foundation Transform (MFT) DSP audio plugin for Windows Media Player

February 21st, 2007

I’ll take some crushed animal hooves with those peanuts, please.

February 10th, 2007

Oh Vista…why? WHY?

February 2nd, 2007