Flashing firmwares is dangerous and installing third-party firmwares like OpenWRT is unsupported by your router manufacturer. There is a possibility of “bricking” or killing your router, so if you aren't in a position to cope with this – don't even consider trying any of this.
When I tell people that I have a Linux machine acting as the router in my household, I get some strange looks and get told that they'd sooner have a “real router”. What they don't realise is that except for some incredibly expensive hardware firewalls, most routers run Linux anyway – just hidden behind the cloud of a fancy web interface.
While researching for my piece on Winamp Remote/Orb, I came across a project called OpenWRT. This is essentially an open source Linux distribution for embedded devices, designed to fit into a small memory foot print. It was originally developed specifically for the Linksys WRT54G router, but very quickly other devices were discovered to be compatible – most of them use the same Broadcom processor, but some other processors are also compatible.
The idea behind OpenWRT is to open up functionality that wasn't originally available, but also to provide a Linux frame work, for customising your device to do far more than it was originally designed for.
We managed to get hold of a LinkSys WRT54G only to discover it was the fifth generation, and no longer compatible with the OpenWRT project. Something to be wary of if you are following some of the older guides around the Internet.
Searching around the office cupboards, I came across the Buffalo Airstation WBR2-G54, which happened to be on the supported hardware list. It has a 200MHz Broadcom processor, 4MB of flash memory, and 16MB of RAM.
For what I wanted to do, I also used the Buffalo Terastation. My target was to get a BitTorrent client going and a web based access system for the Terastation.
Installing OpenWRT is usually a case of just selecting the OpenWRT image in the same way you would upgrade using an official firmware. However, in this case, I had to use TFTP in order to do so. This method is worth reading about, as it can be used for de-bricking a router. When turning your router on, there is a five second interval in which you can intervene and upload the new firmware.
At first, I used the straight forward OpenWRT build, which comes with a limited web interface.
With no setting up at all, I had a fully functioning router, on OpenWRT. I could SSH into the router, and adjust anything I wanted to and tweak things to my needs.