Flashing Linux on a Home Router: Adventures with DD-WRT and an Asus WL-520gU
Part 1: Introduction

DDwrt.logoRecently, my router died. It was made by D-Link and it was cheap. It also barely worked. The built-in software had bugs and certain combinations of settings were impossible to set even though the options were perfectly reasonable. There were also periods where the device needed rebooting constantly. There have been many times I've considered replacing the router, but the question is always, 'with what alternative'? 

I've also dealt with many other brands over the years. For me, Netgear and Linksys were just as bad (though I didn't have one of the blessed WRT54G routers). And I have had a high degree of hardware failures with those too. Linksys also made me very angry some years ago with a rebate claim and also being given the run-around on warranty repair claims. 

Apple tends to have decent hardware and good software, but they are expensive and limited in the kinds of things they will do for you.

Ruckus Wireless I have mixed feelings about. Their hardware is awesome. They are the only wireless device I know that will cut through multiple walls, metal file cabinets, and emitting microwave ovens. But their software I'm not satisfied with. Their options are also kind of limited. For example, there is no UPnP option for port management. Another example is you can't even disable router administration through the wireless access for security. I got one of their beta firmwares after learning about them from a Bonjour presentation at Apple's WWDC from Stuart Cheshire. Their Zeroconf implementation didn't fully work right but I was hopeful they would eventually fix it. Unfortunately, they didn't and later versions at best only had a Zeroconf browser to find other Zeroconf services on the network. But it lacked advertisement for itself which I consider the most important thing since you need to know how to find the device first. (I have plenty of desktops that can fill the role of Zeroconf browser.) To be fair to Ruckus, their software is good enough that I never seem to have to reboot the device and the WI-FI transfer rates are the closest I've ever seen to theoretical max. So my feeling about Ruckus is that I will buy their stuff as basically a dumb wireless access point, and will still need some kind of separate device to play router and/or firewall.

So I have been keeping an eye on the flash-your-routers-with-3rd-party-Linux projects over the past several years. There seem to be 3 major ones: OpenWRT, DD-WRT, and Tomato. I am not completely sure on the history, but I am under the impression that all these projects derive from the Linksys WRT54G home router which used Linux in its first revisions. Due to the GPL, the source code had to be released and these 3rd party Linux distributions were born.

Over the past several years, I have seriously contemplated getting one depending on how much trouble my current router was giving me. However, it always seemed complicated, and finding the exact revision of Linksys WRT54G hardware needed turned out to be more than I was willing to pay at the time for something I risked bricking the moment I got it. That combined with my high device failure rate deterred me from spending money on one.

First Look on an Airlink AR430W

But this time was different. One of my friends had just so happened to have recently flashed an Airlink AR430W router from Fry's. It's main selling point is that it is extremely cheap. Apparently, you could buy these things on sale for $10 and people were motivated enough to try to flash Linux on it. So with considerable effort, he flashed DD-WRT on it and was willing to let me test it for reliability.

So this allowed me to get first hand experience with DD-WRT to see if it was something I wanted to really do.

Well, my experience was actually mixed. There were a lot of interesting features available. Many of them I would never use, but a few of them I found interesting. But the most interesting to me was being able to convert extra ROM space into disk space so you could install new software. This allows you to install things that the firmware packagers didn't consider or include.

But unfortunately, the DD-WRT firmware took up the Airlink's full 4MB ROM. Normally, DD-WRT has different variations like mini and mega so you can fit these these things to your unit's ROM size (at the trade-off of which packages come included). But most of the support seems to be for Broadcom based CPUs which uses MIPSEL architecture. This Airlink uses an Atheros chipset which is totally different and nobody has spent the time to create alternative smaller packages for it. And since the Airlink lacked a USB port, I couldn't attach storage to it.

I also had some problems with DD-WRT itself. First, for some reason, my different browsers had different problems setting options. In Safari, every time I hit Apply, I would get 'can't find page' errors. In Firefox, I got a similar problem changing the DDNS settings. In Opera, I had a different set of problems where hitting Apply failed to actually Apply. I found myself switching back and forth between Opera and Firefox. I don't know if the problem was DD-WRT or because it was because the Airlink support was questionable.

But ultimately, I ended up setting a (reasonable) configuration that effectively bricked the router. I couldn't figure it out but my friend thinks he can recover it. 

Jumping Down the Rabbit Hole with an Asus WL-520gU

Still, I was leaning towards the 3rd-party firmware. I was under the impression that the epic failure was mostly the fact that they don't confidently support that Airlink router. Getting a more popular Broadcom based router would probably yield a better experience.

Well, I saw that Asus was promoting a rebate offer on some of their routers this month. And I kept reading very good things about people successfully flashing DD-WRT and Tomato on the Asus WL-520gU, which was also fairly inexpensive. For around the same price I could buy a used Linksys WRT54GS which has twice the RAM and twice the ROM, but it is used and it would partly depend on how patient I am to find one. But because of my negative experiences with Linksys in the past, I have been hesitant to go this path. The big advantage the Asus WL-520gU has is it comes with a USB port, so I could attach a flash drive or external hard disk if I needed more space for capabilities. In theory, I could also attach things like USB printers.


I've never had an Asus router. I've bought a lot of motherboards from them and had a couple of Nvidia based video cards from them and all have mostly been good experiences, at least with respect to the hardware. (The software...not so much.) So I opted for a new Asus. And in hindsight, I'm glad I did because the USB port turned out to be critically important for me for additional needed storage.

So the next few articles will document my adventures and process with DD-WRT. My agenda will be to:

1) Install DD-WRT

2) Install Zeroconf (via Avahi)

3) Install a better UPnP and NAT-PMP (via MiniUPnP)

I'll rant more about the lack of Zeroconf in that section, but will say that it is pathetic for any IP-based network device to not ship with it in this day and age.

And in hindsight, I will say that I probably should have went with Tomato instead based on my needs. I'll talk more about that in the NAT-PMP section.

I will also say that I think I bought the wrong Asus model. While the WL-520gU has been terrific, I didn't realize there was the Asus WL-500gP v2 which has twice the RAM (32MB), twice the ROM (8MB), and twice the USB ports (2), for only about $10 more after rebate. It has the exact same CPU so compatibility wouldn't be a problem. I think DD-WRT makes some really strange trade-offs for size (which I will mention in later sections) and it has been a struggle to to work within the 4MB ROM limit.

Alternatively, there is the Asus RT-N16 which, while not the same exact chipset, is still a Broadcom chipset and seems to be supported by DD-WRT. If I cared about wireless N, I would probably get this one. It has 128MB of RAM, 32MB of ROM, 2 USB ports, and gigabit LAN ports. (I already have a gigabit switch.)

My write up is fairly long, even by the standards of this website. So the article has been split up into smaller pieces and I will post over the course of the next week or two. Keep watching!

Go to Part 2: Picking a Firmware & Initial Flashing

Table of Contents

Part 1: Introduction

Part 2: Picking a Firmware & Initial Flashing

Part 3: Enabling JFFS & Adding USB Storage

Part 4: Zeroconf should be available on all network devices, including routers

Part 5: Installing Optware & Avahi (Zeroconf)

Part 6: UPnP and NAT-PMP

Part 7: Installing MiniUPnP

Part 9: Conclusion

Addendum: Switching from DD-WRT to Tomato

(DD-WRT logo from Wikimedia Commons under the Creative Commons Attribution-Share Alike 3.0 license.)

Copyright © PlayControl Software, LLC / Eric Wing