My router saga (with bonus features!)
Ben Scott
dragonhawk at gmail.com
Thu Oct 22 19:18:49 EDT 2009
My router saga
Subtitled: Why isn't anything ever easy?
Bonus features: Review of Asus firmware, how to *really* disable HAL
automount polling, missing device nodes and manual remedy
Just a little story I thought I'd share. Perhaps educational,
perhaps entertaining... perhaps just long. :-)
So, after polling people here, and also doing some reading, I
decided to buy an Asus WL-500G v2 Premium. (And the award for most
awkward product name goes to...) Unfortunately, I discovered that
model doesn't actually seem to be in stock anywhere on the planet. I
don't know if it's discontinued, or just in high demand, or what, but
that was out. Looking around, I found the Asus WL-520GU seemed to be
almost as good. Less RAM and flash, but the same as my old LinkSys
WRT54Gv2, so no loss, right? And cheap. A few days later (*refresh*
-- "Aww, still in Memphis" -- *refresh* "Aww, still in Memphis"), I
have product in hand.
I had intended to run it with the stock firmware for a week or
three, just to see how Asus's offering performs. But I discovered the
OEM firmware was astoundingly bad. *Astoundingly* bad.
For starters, the web management UI stinks. The Engrish is so bad
one can barely decipher it. Documentation as to what some options
actually *do* is completely non-existent. It makes heavy use of
JavaScript without need, and is slow to respond to user action. Now,
these issues are all sadly common in this product segment, so I wasn't
surprised, and I might have lived with it.
But that was only the beginning. The firmware it came with didn't
seem to be able to hold a connection to Comcast for more than 30
seconds or so. Then it would decide it didn't have an IP address.
Unfortunately, in an effort to be "helpful", when the OEM firmware
thinks you have no Internet connection, it automatically begins
intercepting all DNS and HTTP traffic, and redirecting to its internal
trouble notification page. There, a cartoon caricature named "Dr.
Surf" would tell me, "You have set the wrong dynamic or static IP
address for your WL-520GU".
What the fsck does that even mean? How did it decide something was
wrong? Did it get denied a DHCP lease? Fail to get an ARP response?
Fail to ping a test host? Receive a flood of ICMP messages? Nobody
knows. Any ability to actually trouble-shoot the situation is
destroyed, since the device won't let you talk to the outside world
when things are down.
I even tried the universal high-speed Internet reset procedure:
Unplug the power from router and modem, go do something else for 30
minutes, then come back and power things up in stages. Same result.
Now, I was planning all along to replace the OEM firmware, but I
didn't expect to *have* to do so. Woe to the unsuspecting non-techie
user who buys this thing.
I actually had to hook my partly-dead WRT54Gv2 back up, just to get
online long enough to download replacement firmware. (I could have
cabled my PC directly to the modem, too, but I would have had to
reconfigure my PC net setup. Router was easier.) And, of course, I
then had to power cycle my cable modem (one customer Ethernet MAC
address per cable modem on Comcast!) and wait for it to resync before
that would work.
So. Online again, with old router. I guess I'll hop on over to
OpenWRT-- Hmmm, wait, no, first, let's check Asus's website, just to
see what they have to say. Saw I already had the latest production
firmware. There was a beta release, which I also tried (more wire
swapping), but with the same result.
Next I tried typing that strange error message into Google. Here's
when I knew things were really bad: After the third word -- after only
"you have set" -- **Google auto-completed the entire rest of the
message** (!!). Out of every search on the Internet for those words,
Asus's error message is the most common. Wow. Just wow.
So, I go looking at third-party firmware again. I hadn't done as
much homework for this model (my bad). So I now realized OpenWRT's
support for this model was... somewhat rough. Or so it appears --
that project's documentation has decayed significant since I last used
it. :-( I wasn't sure if it would work at all, and I would have had
to download and build everything (including the build toolchain)
myself. But I did know I had choices here.
So I moved on to DD-WRT, which advertised pre-compiled files to download.
The firmware file that was supposed to be compatible with Asus's
firmware load tool in the web UI didn't work. That didn't entirely
surprise me, though -- the instructions warned it was somewhat
unreliable. So I fell back to trusty old TFTP. It's real easy to put
this model into TFTP -- just hold down RESET while powering on, and it
automatically goes into Firmware Recovery Mode.
Then I discovered I didn't have a TFTP client on my current Ubuntu
install. So "apt-get install tftp". Oh. Right. No Internet.
Switch wires, power cycle cable modem, wait for sync. Install.
Switch wires, power cycle cable modem, wait for sync. Discover this
TFTP command isn't the one I'm used to. WTF? Oh, apparently there
are two TFTP alternatives here. Switch wires, power cycle cable
modem, wait for sync. "apt-get install tftp-hpa". Switch wires,
power cycle cable modem, wait for sync. TFTP firmware to router.
Power cycle router. Struggle with lack of response. Try TFTP'ing
again; this time, wait about a minute before the power cycle. And...
LEDs look promising. Try http://192.168.1.1/ and... DD-WRT comes up!
But... the WAN IP address is shown as all zeros, and if I try to
change anything, when I click the "Save" button, I get an empty
"apply.cgi" page and the settings don't stick. I try clearing cache
and cookies, force-reloading the page, power cycling everything
multiple times. WTF?
Switch wires, power cycle cable modem, wait for sync. Google.
Discover that for reasons unknown, *closing the browser* sometimes
makes a difference. I hadn't done this because I had about 30 pages
of into open with all sorts of info related to this project --
because, of course, you have no Internet when you're ripping apart
your network infrastructure. (It is scary how much I have come to
depend on the web for everything.) So. Switch wires, power cycle
cable modem, wait for sync. Restart browser. And... it works! I can
change stuff! Yay!
So I'm playing around in the DD-WRT web UI, tweaking things,
learning. At some point, Firefox saw an HTML form in the DD-WRT
management UI that it apparently decided was just like one from my
WRT54G, and pre-filled the username and password fields with
something. Unfortunately, those fields on that page were to *change*
the password, not to login. I saw it happen, but too late -- I had
already clicked "Save". Now I can't get back into DD-WRT's web UI. I
try every combination of every username/password I can think of, but
still, no go. Google up password reset instructions. At least the
Internet connection was working now.
Go into Firefox, delete all old saved passwords for my router LAN IP address.
I don't actually want to do much with this router. It's just my
home router. The main reason I like third-party firmware is that it
usually works better. (In the case of Asus, that's obviously not
hard, but LinkSys's stuff is at least minimally adequate. But you
can't tweak things, and their DNS Update client is perpetually broken.
But I digress.)
One thing I did want is to have a packet sniffer (tcpdump) on it,
for trouble-shooting network issues. There's nothing like having a
view of the traffic at the switch for figuring out what's broken.
This is when I discover that although this model has the same flash
size as my old WRT54G, the third-party firmware projects have gotten
bigger, and tcpdump won't fit on the space left. Sigh.
Fortunately, this model has a USB port. (One of the reasons I
picked it.) I had a new USB flash drive I wanted to migrate the
contents of an old USB flash drive to, and then I could recycle that
old 32MB stick into expansion storage for my router. So I get to
doing that, on my PC running Ubuntu 8.10.
Thinking about copying files between USB flash drives reminds me: I
haven't run a backup to my backup media (also a USB flash drive) in a
while. I should do that, while I'm at it. I grab my backup stick and
plug that in.
The HAL automounter stuff promptly gets in my way, by putting the
stick on a mount point other than what I want. (Have I mentioned how
much I love that stuff?) HAL automount has caused me grief before.
This was the proverbial straw that broke the camel's back. So I go
looking for ways to disable HAL mounting/polling for good. There's a
command "hal-disable-polling", but you have to give it device names
one at a time. Fsck that. Google found this guy's solution:
http://shiny.thorne.id.au/2009/05/disable-hal-daemon-polling.html
I put /etc/hal/fdi/information/disable-polling.fdi in place, restart
the HAL daemon, and presto! -- all those poll daemons are still there.
:-/ Okay, go Googling. (This is how I discovered the
reboot-instead-of-restarting HAL thing mentioned in another thread
recently.) I found someone saying that file should actually be in
/etc/hal/fdi/policy/disable-polling.fdi, and when it worked before,
that was a bug. So they "fixed" the bug and stopped it from working.
Okay, I copy it to *both* the directories, so if the weather changes
again it will still work. Restart the HAL daemon, and presto! -- all
those poll daemons are still there. :-/ But different -- this time,
in the process list, they all say:
hal-addon-storage: no polling on <device> because it is explicitly disabled
Blink.
Blink, blink.
Yes, that's right, when disabled, the proper behavior is apparently
not "don't run", but instead, "run, but furiously do nothing, while
telling everyone you're doing nothing. Seven times.".
sudo dpkg-divert --add --rename /usr/lib/hal/hald-addon-storage
--divert /usr/lib/hal/hald-addon-storage.EAT_FLAMING_DEATH
Problem solved!
Where was I?
Oh, yes. Backup.
Backup explodes trying to backup </home/bscott/.gvfs/>. Permission
denied. Which is interesting, since I'm running the backup a root. I
go poking. User "root" can't look at that directory. Neither can
user "bscott". Google says it's part of some GNOME virtual filesystem
thing and...
sudo apt-get remove gvfs
# answer "yes" to removing half of GNOME
Problem solved!
Where was I?
Oh, yes. Backup. And hey, now that all this helpful stuff is shut
off, it works fine. Next up: Migrating USB drives.
Now, at this point, I have several other storage gizmos hooked up to
my PC. Two hard disks, a multi-format flash-card reader, the backup
target, PDA, digital camera, coffee maker, etc. Now I was plugging in
two more additional flash drives. This pushed the drive designations
all the way down to "sgi". For some reason, Ubuntu didn't seen to
think I should have more than 7 disk devices with partitions on them.
dmesg showed the kernel finding "sgh: sgh1", and "sgi: sgi1", but
/dev/ only had "sgh" and "sgi", no partitioned devices.
Maybe because I turned that HAL stuff off? Turn it all back on.
Nope, same result. Okay, well, no problem, this is an easy fix, a
well-known tool to make the device nodes has been on Unix for decades:
sudo -i
cd /dev
./MAKEDEV sgh
That explodes because udev gets in the way. How to fix that?
Google isn't helping me, although at this point it's like 1 AM and
I've been working on this for five hours and I'm ready to slit my
wrists just to end the pain (remember: "down, not across"), so my
queries may not have been very deft.
I end up having to dig the block device numbers out of
/sys/block/sgh/sgh1/dev, then manually execute the "mknod" command to
get my devices. How is all this automatic device crap better than the
old way? Sure, the old way was cryptic and meant you usually had
thousands of device node filesystem entries you never used, but at
least it freaking worked and stayed working.
Once I got the old USB flash drive mounted as /mmc/ on the new
router, though, I was able to install tcpdump. There was some thing
where ipkg kept saying it couldn't install the package the normal way,
but manually wget'ing the package files and then adding some force
switches got that to work. I'd post details, but my subconscious
appears to have erased them from my brain, presumably to preserve
what's left of my sanity.
In conclusion:
* Don't buy an Asus router unless you plan on loading third-party
firmware immediately.
* DD-WRT is nice.
* Make sure you have everything you need downloaded *before* you start
messing with your router
* Clear everything that has to do with your browser when changing your
SOHO router.
* Make backups before getting involved in new projects.
* Nostalgia ain't what it used to be.
Clear skies!
-- Ben
More information about the gnhlug-discuss
mailing list