Using WRT54GL with OpenWRT 14.07 in 2014

The Linksys WRT54GL was a very successul product for its time, not the least because sources were available and people could make their own firmwares for it. There are today firmwares like Tomato, DD-WRT and OpenWRT that runs on WRT54GL. My interest is with OpenWRT (as it gives me a full Linux system, not just a firmware, a web gui and parameters to set). The last OpenWRT version that was good and fully supported on the WRT54GL was 10.03.1. But that firmware is four years old, and not so fresh in 2014. I like to keep my Linux systems updated.

I tried to build (from scratch/sources, using buildroot) a very minimal version of Barrier Breaker (OpenWRT 14.07) Release Candidate 1 for WRT54GL. I removed everything that I could possibly live without, and ended up with an image that used less than 3MB of flash. Still, it was impossible to get WiFi running for more than a few minutes, and the router got very slow. Most likely the 16MB of RAM is just not enough (that is the generally accepted explanation).

Update: Someone seems to have been successful running BB with WLAN.

However, without WiFi, the WRT54GL runs Barrier Breaker just fine. That rules out using it as a WiFi router, but it leaves other options open. It is still a functional switch, that is also a Linux-machine with dropbear (ssh) and it can run software (opkg-packages) like nginx, openvpn, stunnel, uhttpd (cgi capable web server), iptables, and many more.

Image Builder
I have used the Image Builder (also called Image Generator) from BB RC2 to generate my own OpenWRT firmware for my WRT54GL. The process can seem scary at first, but it is quite simple. You can choose exactly the packages you want and build an image with just those packages, making the most of your hardware.
Update 2014-10-09: BB 14.07 final works fine, just as RC2.

After downloading and extracting the Image Builder (on my x64 Ubuntu machine), I ran the following command:

make image PROFILE=Broadcom-None
           PACKAGES="-dnsmasq -ppp -ppp-mod-pppoe -libip6tc -kmod-ipv6
           -odhcp6c -ip6tables -odhcpd uhttpd netcat openvpn-easy-rsa
           openvpn-openssl openssl-util stunnel libwrap"

Note, there should be no line breaks when you run this command.

  • Available profiles are found in target/linux/brcm47xx, and gives a starting point for selecting packages
  • Packages can be added using the PACKAGE option to make (ex stunnel)
  • Packages can be removed by using – in front of their name (ex odhcp6c)

I read the massive output which indicated that some packages (netcat, stunnel) failed to install. Also, if there are missing dependencies (libwrap) you will see it in the output.

Not all packages that are available are also included in the Image Builder download, but just download the packages you want and put them in the package folder in the image builder.

Rerun make image until you see no dependency errors, failed packages or other problems.

When make image has finished, have a look in your bin/brcm47xx folder, and you will find your new firmware. The firmware I generated above was less than 3.5Mb, leaving several 100kb for configuration and more packages. Flashing the router the normal way and logging in to the system I find that memory usage is about 10Mb and available disk is about 500kb (the openssl-util alone is 477kb on the filesystem and its opkg is 182kb).

As a benchmark I decided to use the easy-rsa package and build certificates. Particularly the build-dh takes very long time: on this machine 30min. However, on my new TP-Link WDR4900 it took 60 minutes, so obviously this was a silly unpredictable benchmark.

With some fantasy, curiosity and enthusiasm, you can turn your old WRT54GL into a useful component of your home or work network. It can provide some, or a few, useful services. Often it is wise to separate different functions to different hardware, because it makes your network more stable. And not the least, this is a good way to experiment with OpenWRT, without risk of breaking your production WiFi and broadband router.

  1. Kevin Shenk

    I’m very interested in your work here.

    I know I should probably dive in and start to experiment for myself, but just curious, did you try multiple broadcom wireless drivers to see if any alternatives work better than the default?

    Have you tried zram to increase the memory capacity?

    If every possible package was removed, including firewall, dhcp, etc, do you think WRT54GL could be used as an access point with Barrier Breaker?


  2. I tried the two broadcom wireless drivers that are both available as build options (Broadcom-b43 and Broadcom-wl). I did not try zram (as I don’t know about it), assuming it is memory compression technology my only spontaneous doubt is that the wireless driver may live in kernel space, and that may be harder for zram to do anything about. But I am just guessing now.

    I believe it could be worth a try without firewall and dhcpd. There are not so many more processes running 😉 Perhaps you can also get rid of dropbear (the SSH server) and just live with the telnet server (which disables itself as soon as you set a password I think, but it probably does not listen on WAN anyways).

    I imagine there can even be memory-saving hacks to do in the kernel itself. I guess there is a max-number-of-process limit in Linux, which is probably a #define somewhere, and you can probably reduce it to 64, and it will probably save some RAM. There are perhaps more TTYs, or maximum number of files open or things like that you can play with. But then would it be Barrier Breaker anymore 😉

    You are very welcome to post results or more questions here. The people at OpenWRT forum seem to be a little bored of this old hardware. Have fun!

  3. I was trying to get a stable image for OpenWRT but i got the same problem, when i try to activate wireless CPU incresases a lot.

    I thought use Broadcom-wl will reduce CPU usage but i have not try it yet. If you can contact with me via email maybe we can talk about this.


  4. davidcano,

    I did try both wireless drivers, and I did build it all from scratch (using buildroot, not the Image builder). Neither driver gave me anything close to useful stability/performance. And, since I have found a way to make good use of my WRT54GL, without WIFI, I am not going to put more effort into this.

    Also see my reply above to Kevin. I think there can possibly be ways to hack things to reduce memory footprint… but that would be quite advanced things. It is not worth it for me, and the OpenWRT devs obviously decided it is not worth it either (or they tried and it did not work).

    I can drop you an email, but I am afraid I don’t have so much more to add.

  5. Someone seems to have been able to BB on WRT54GL using zram, as suggested by Kevin above. Perhaps it is one of you?

  6. Buying a router for OpenWRT | TechFindings - pingback on 2015/01/10 at 12:23

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackbacks and Pingbacks: