Linux Router Guide

Linux Router Guide

I built a CD-ROM based internet router out of an old computer some time ago. Since then it has performed its task flawlessly over at least 6 months at the time of writing. I have always felt I should share the way I did it. One could say, it is a way of giving something back to the open source community that made all this possible...

How to build a diskless internet gateway

When we had only one computer in the house, things were easy. OK, only one person at the time could surf the web, but the connection was simple: one PC, one modem, one telephone jack. Later, when we were using two PCs the requirement for sharing the internet connection came up. To that end, wifies's computer was attached to the phone line, and a HTTP proxy software was installed under Windows.

This worked fine for a long period of time. Later the HTTP proxy was replaced by an NAT package to allow for sharing other protocols than HTTP. The only problem was, wifie was not aware of all this. She would boot another operating system to play a game, while I was still online, or shut down her machine while I was downloading the last few megabytes of a large file.

So the idea came up to build a dedicated router. Around the same time I got my old PPro 200 back after upgrading my parents' computer. And finally, I decided to re-acquaint myself with my old love, Linux. Back in the 90s I was fairly active in establishing Linux on the M68K architecture. Later I lost touch and used Windows for most of my everyday tasks. But now I wanted to learn about relational database systems, web servers and web programming, as well as teach myself more about running an SAP system. I felt, all these goals could be more readily achieved using Linux, in particular with a lot less cost. So in order to get used to Linux again, before setting up a system to do all the other things, I set myself the goal of building a linux router that runs without hard disk to make it as silent as possible.

At first I looked at ready-made solutions. There are, in fact, a large number of linux based internet routers available for download. I don't know them all nor can I give an exhaustive list. However, most of them offer services like web servers and caching proxy servers that require a harddisk for storage of temporary data.

Eventually I found one distribution that runs entirely from floppy disk: fli4l. It installs a kind of development environment under Windows or Linux. From there you can install the packages you want and you can make the customizing settings required for your setup. You then call a little program which creates a bootable floppy disk with a boot loader, a linux kernel, a ram disk with the selected packages, and a shell script that defines lots of environment variables. These environment variables contain your customizing choice, eg. the number of network interface cards, the chosen IP addresses, whether you want to run a DHCP server, etc. [NB: be grateful I told you all that because you'd have a hard time extracting the information from the docu.]

Whilst being surprisingly flexible, the fact remains that you can only operate within the boundaries given. Furthermore, in order to save space, the Linux installation is pretty minimal, and the packages offered are optimized for space. To give an example, the DNS server provided is ENS instead of the unix standard BIND that comes with most Linux distros. This was a problem for me in so far as my ISP required a DNS requests from an unprivileged port, whereas ENS seemed to use 53 as default. Maybe it was my lack of knowledge, but I couldn't find a way to change this behaviour.

So I really wanted to get my hands dirty and do a similar thing with a more standard distro. Obviously you can't fit one of those onto a floppy disk, so the idea came up to do the same thing with a CD-ROM instead. In theory you could even consider a hard disk with a sufficiently short idle time out. However, hard disks are made for continuous operation, and a fairly frequent spin down/spin up is not particularly healthy for them. CD-ROMs on the other hand are designed that way, and they are read by a laser device without physical contact. Moreover, if a CD becomes unusable, you can simply burn a new CD-R.

Deployment is made easy as well: as long as the kernel is generic enough you could take such a CD-ROM from one computer to another, and fire up another instance of a linux installation.

Another advantage is security: a CD-ROM based system cannot get compromised. Even if the RAM based components got changed at runtime, simply press reset and all traces of the attack are gone.

So let's go straight in medias res. It probably makes sense to break a complex topic like this into a few parts that are logically independent:

To top it off, here is a description of the hardware setup:

Hope you found this article interesting. Feel free to send me an email if you have any questions or comments.

Martin

 


< Back   Home >