Friday, December 30, 2011

DD-WRT is Dead! Long Live OpenWrt!

The Christmas break is upon me and I am trying to get a few things done rather than just sit around and eat cookies.
Chose to Eat Cookies
One of these things was to change the firmware on my trusty Linksys WRT-54G, perhaps one of the greatest routers of all time.
The Muhammad Ali of Routers
It's greatness was largely accidental and stemmed from a license violation.  Linksys used Linux as the brains behind this router.  However, they did not realize at first that the GNU Public License that Linux is released under requires all changes to the source code be made public.  Their hand was forced, and the source code was released in July of 2003.  The open source community tore into this code like a pack of wolves and custom versions with additional features sprang forth.  Before long, this $60 router had the features of a $600 router.  It became the router of choice for geeks and hackers everywhere, and Linksys sold approximately eleventy billion of them.  Read this if you want more of a history lesson.

Linksys came out with many different versions of this router as time rolled on.  I have one of the best: a Version 3 with a staggering 16 Meg of flash and 4 Meg of RAM.  Later versions halved the amounts of flash and RAM, forcing subsequent versions of custom firmware to cut back on features to make room.

I don't remember when I did it, but my first cut at custom firmware was DD-WRT.  I picked this because it had more features than I would ever use, was well supported, and had a nice GUI to control everything.  Sadly, DD-WRT doesn't seem to remember where it came from anymore, and you can't build the whole shebang from source.  Want to modify the GUI?  Be prepared to jump through some nasty hoops to do so.  Development of DD-WRT has also slowed to a trickle: the last release for my router was in 2009, and that was to fix a software vulnerability.

Screw this.  Time to switch, and switch I did.  Yesterday I put OpenWrt and the Gargoyle "router management utility" on it and the process was relatively painless.  Note that I said relatively painless.  There were a few bumps in the road that tripped me up briefly.  This is what got me going.
  • I went to this page on the Gargoyle website and chose the Firmware Image for the Broadcom architecture for the latest stable branch of the code.  This image has the OpenWrt firmware rolled in already.  Nice.
  • The brcm47xx-squashfs file was what I needed, but should I download the .trx or the .bin version?  According to the install guide...
If you are installing from another third-party firmware such as DD-WRT or Tomato, you should also use the .trx file.
Sounded to me like I need to download the .trx version.  Turns out this was wrong.  More on that in a second.
  • The Installation Guide on the OpenWrt Wiki told me that all I should have to do was "Open the WebUI of the original firmware with your web browser and install the OpenWrt firmware image file using the "Firmware Upgrade" option of the original firmware."  Easy peasy.  I backed up my DD-WRT settings from the GUI and then tried to load the .trx file.  DD-WRT greeted me with
Incorrect Image File 

Not good.  That is when I started Googling around and started reading about all the people that had troubles upgrading to OpenWrt from DD-WRT.  The problems people were having were broken charts in Gargoyle and wireless that just plain didn't work afterwards.  This got me a little nervous because this is the only router I have, and botching this upgrade would make me very grumpy.  But no guts, no glory.  I proceeded onward.
  • This post suggested resetting to factory defaults within DD-WRT before doing the upgrade.  This made sense to me: clearing the NVRAM in the router before going to a new firmware version would let OpenWrt start with a clean slate.  Resetting to defaults caused the router to reboot into DD-WRT, after which I had to re-login with the default password of "password".  I'd have never guessed.
  • The next step was to rename the .trx file to .bin and again use the DD-WRT "Firmware Upgrade" option, against the advice of the installation guide.  DD-WRT happily accepted this file.  Several nerve-racking minutes passed while the router re-flashed and rebooted itself.  I pointed my browser to and...
  • But I wasn't through yet.  Wireless wasn't working.  I dug around the GUI a bit and saw that it was disabled by default.  I enabled that, set the SSID and security stuff, and saved my changes.  This caused the router to reboot and... still no wireless.  This is what I had read about and I was starting to get a little nervous again.  I unplugged the router's power supply for 30 seconds, plugged it back in, and it worked!  Yay me!
Looking back, I realized I was fortunate doing this upgrade over a wired connection.  The default of wireless being disabled and the temporary problem I had with getting wireless going would have caused addition grief if I hadn't been wired in.

A question you might be asking yourself is why I am still playing around with such an underpowered, ancient router that only supports the B & G standards.  Well, when all you have 2 Mbits/sec of downstream bandwidth and 128 kbits/sec of upstream bandwidth, Wireless G is all you need.  But more than that, this thing is completely and utterly reliable.  It quitely does its thing, hidden away in the basement.  The custom firmware also gives it far more capabilities than I need, and it is still incredibly well supported.  What is not to like?

Well, it doesn't have anything in the way of extra ports and it could use more memory.  But there are a ton of easy hardware mods for this router that I might take a shot at that would give me exactly this.  One thing that I really want to try is this 1-wire mod that will let me connect simple devices like temperature sensors to this thing.  A reader of my blog has even written a script that lets a WRT54G with a serial port hacked on upload data from a Davis Weather Station Console directly to Weather Underground.  How cool is that?

This baby still has a lot of life in it yet.


  1. right on man i was using ddwrt for a year or so but went back to openwrt as i think ddwrt got bloated and now has problems.

    and it was just sloppy problems, like my wan dhcp client was broken. are you kidding me ddwrt? how does that happen? so glad im done with you!

  2. I have like 20 OpenWrt running in VPN's to each other as well as the Data Center. They are rock solid and are better than a linux PC at every site. I even use the VLN stuff to create one bridged network to use ATT Uverse TV in locations where I don't have it available but have the BW.

  3. dd wrt has been good to your colum and saw the word brick....nuff said

  4. Your instructions worked for me as well (WRT54G v3). DD-WRT defaults to OpenWRT. Thanks for the help!

  5. I have a buffalor router running ddwrt in wireless bridge mode for over 4 years. No problems whatsoever. Openwrt on the other hand was a pain in the a$$ to flash and setup. Great article btw.

  6. >Looking back, I realized I was fortunate doing this upgrade over a wired connection. The default of wireless being disabled and the temporary problem I had with getting wireless going would have caused addition grief if I hadn't been wired in.

    I wouldn't recommend doing a firmware update over wireless, what if you lost some packets while transferring the firmware image? You could brick the router if you decided to upgrade it over wifi and almost every guide you see would advise against it.

  7. "Sounded to me like I need to download the .trx version. Turns out this was wrong. [...] The next step was to rename the .trx file to .bin and again use the DD-WRT "Firmware Upgrade" option, against the advice of the installation guide. DD-WRT happily accepted this file."

    Sounds to me like the .trx file was exactly the one you needed (even if you needed to rename it afterward).

  8. Hey guys.. can anyone help me on how to change GUI of Openwrt or DD-WRT firmware.. ??? i Would be highly thankful..!!!

  9. Great job and very nice content... i read this blog, this blog is very helpful for me...
    I am very thankful to share this post.. I hope you have more information about this post.. So, Please share me.. Thanks..
    Visit my site:- Linksys Router Support

  10. To gain massive amounts of traffic to your site an rank on the first page of niche blog comments, you need backlinks. This articles explains how to create quality backlinks for long term traffic!

  11. As a small business owner, you may have realized the importance of SEO services in order to tap into the millions of online users who are looking for your products or services. Whether you have a business website or an e-commerce one, niche backlinksservices are a must for giving your website the visibility it needs to bring your business to the attention of potential online customers.

  12. Wow this definitely takes me back, where are your contact details hmm? Rodent Control Abu Dhabi