Mine the Harvest

Linux on a home router

by on Sep.22, 2007, under IT Adventures

Taking my Cisco classes has been great, and I’ve certainly been learning a lot more about networking, routers, routing protocols, TCP/IP, network design, WANs, VLANs and such. But a few weeks ago I came across this killer site for OpenWRT which allows you to install Linux onto Linksys and other routers which have enough memory and use supported chip sets. I love Linux and knew immediately knew I would have to do this.

My first attempt on my own Belkin bricked it -it didn’t have enough memory (knew it but couldn’t resist trying). Getting the correct original firmware back on it was a nightmare – THANKS BELKIN for putting about a dozen incorrect firmwares out there and utterly hiding the correct one for this version. Appreciate it.

But then a friend of mine had a Linksys WRT54G ver. 2.0 that he just replaced as it was giving him some trouble and he graciously donated it to science. Perfect!

Now that I had supported hardware, I simply had to play with this. It sat several weeks as I was busy with class, but then last weekend I finally got to try it out.

At first I installed the latest OpenWRT development version Kamikaze. This is ridiculously easy as I literally just used the Linksys firmware update and loaded up the OpenWRT image directly. I couldn’t believe it was that simple. It took all of about 3 minutes and included the web interface. Scoff.

Then I decided to use the earlier, stable version White Russian as it had more features enabled for this model. Well, this was a bit trickier as the web interface update bombed and the router was dead. No problem, my Belikin experience stood me in familiar waters.

Here is the fun way to do the flashing. You just tftp the image onto the router! OMG! I had no idea you could do that with a crappy home router! Sure, with a real router – of course. But a tiny little home router, I just would never have even considered that. You simply download the firmware, start a ping to the router and as soon as it boots it will start to initialize – at that point you blast the image to it using a tftp client and reboot the router. Here is a shot of that procedure:

tftping.jpg

(All images can be opened full size.)

Of course it makes perfect sense – that’s all the web update does anyway – but still, who would have though you could just use a regular tftp client, etc. I assumed there was a proprietary protocol or authentication process. Nope.

After that you can ssh into the router – same as though it were any regular Linux box. Note also it runs an httpd server, has other services with /etc/init.d scripts, ect. So friggin cool. . .

ssh2router.jpg

There is also a fully integrated web interface. And check out the options it gives you: full firewall rule creation, list of iptables, CPU / resource graphs, etc. You can even set up multiple VLANs, remote syslog, VPN, and MUCH more. Just slightly more sophisticated that the firmware home routers ship with.

cpugraph.jpg firewall.jpg iptables.jpg

I especially liked this one: scan your neighbor SSIDs and retrieve the MAC address which makes links of them – click the link and it looks up the manufacturer for you:

neighbors.jpg

And oh, there is also even a package management system so you can add and remove the modules you need to customize the router and its capabilities. It uses software repositories and resolves dependencies, etc. Wow.

packages.jpg

Well, another uber geek project proving Linux is the most versatile operating system in the world – running on embedded devices, home systems and enterprise class servers. I just friggin love the idea of ssh’ing into the router and managing it through the shell, setting up iptable rules, modular customization, etc. Too cool.

If you have a supported router your might want to check it out! There are complete install instructions, a wiki and forums there. If you have a supported router and can just use the Linksys upgrade firmware page, it is insanely easy. And if you brick it, use the tftp recovery procedures here.

No comments for this entry yet...

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...