Linux Router: The Implementation
Obviously, I was lucky enough to have the old computer available to me
for use in this project. I you happen to be starting from scratch, I'd
recommend scavenging at your local computer junkstore, or even better deals
can sometimes be had at http://www.retrobox.com (those guys rock!)
A 486 is probably beefy enough to do this, and you don't need anything
besides a floppy drive and a stick of RAM, so if you're paying for anything
else you're wasting your money. I'm talking $30, max, that's if you
absolutely can't find anything for FREE, check garage sales or schools
for people throwing out hardware (people think it's worthless when they
can't run Windows on it!) If you're buying from Retrobox, try and get one
with the NIC's already in it, sometimes you'll get lucky with them. Shipping
will kill you though.
Make sure the system boots normally, and detects the RAM and floppy drive.
If you intend this box to act as a router for more than one end-user, you'll
also need an ethernet hub. I bought mine (D-Link hubby 5), retail, for $38.
I probably paid too much, but I was in a hurry. Better deals may be had on
http://www.pricewatch.com, or again, check your junk stores and similar places.
Two ethernet cards will be needed for the new box. One is for dealing with
the WAN (your broadband link to the Internet) and the other is for your LAN
(your internal network at the house.) Do your homework before buying them;
try and identify chipsets that have drivers available for Linux. Reference
the HOWTO at http://www.linuxdoc.org/HOWTO/Ethernet-HOWTO.html for general
information, and a lead on what chipsets are supported. PCI cards will give
you a better shot at being supported, but make sure the computer in question
supports PCI. ISA cards may prove to be harder to find. Of course, you'll
also need a card in the end-machine on your internal network to receive the
Obtain proper ethernet cabling for your purposes. For those who wish their
box to act as a router to multiple machines, you'll need at least three
sections of (straight-through) cable, and an additional section for each
machine (beyond the first) that you wish to support on the network. To be
more specific, you'll need one section from your DSL (or cable) modem to
the router (assuming the modem in question uses ethernet!), one from the
router to the hub, and one from the hub to the end-workstation.
If your setup isn't intended for more than just a single machine (i.e., a
firewall and nothing else) than you may get away with one straight-through
section (DSL/Cable modem to router) and one "crossover" section (router to
end-workstation.) A crossover cable is needed when two NIC's are speaking
directly to each other, as in this case. Make sure you buy the right one(s).
Usually, a teeny green LED will light up on the NIC when the cabling's right.
Now, you'll need the disk image. This can get a tad bit invloved, depending
on your particular needs. My "special need" was this: my DSL connection uses
something called Point-to-Point Protocal over Ethernet (PPPoe) to establish
a connection. There's a great package called Roaring Penguin PPPoE for Linux
that does this job just fine, but I needed a very compact Linux distro that
either included this package, or allowed enough room for me to put it on
After a few days of poking around the Net, I discovered a variation of
the original Linux Router Project (LRP) called EigerStein, that someone had
kindly configured for use with RP-PPPoE. Seeing as how I've lost the original
source of the particular image I'm now using, I'll mirror it here at
http://www.shaolinuxtemple.org/eigerstein-pppoe.img in the meantime.
This image is designed for a 1680K floppy. Most websites offering the LRP/
EigerStein images (http://lrp.steinkuehler.net/DiskImages/Eiger/EigerStein.htm)
offer MS-DOS executables to automatically create these diskettes for you.
If using MS-Anything makes you sick to your stomach, do it in Linux...
bashprompt# fdformat /dev/fd0u1680
When the disk is done formatting, write the image to it...
bashprompt# dd if=eigerstein-pppoe.img of=/dev/fd0u1680
Assuming everything went okay, you now have a bootable Linux on a floppy
disk. Pop it in your router's floppy drive and power on. A minimal kernel
should boot and automatically decompress the filesystem into a RAM disk.
The default installation makes a couple wild guesses at your NIC's chipsets,
which will likely turn out to be wrong. In my case, I needed the pcnet32.o
module. I used one compiled from kernel 2.2.16-1, since this is the kernel
my disk image is using. To transfer this module to the disk, I mounted it
under my workstation's filesystem...
bashprompt# mount /dev/fd0u1680 /mnt/floppy
...and copied the module to the floppy...
bashprompt# cp 2.2.16-1/modules/net/pcnet32.o /mnt/floppy
bashprompt# umount /mnt/floppy
Now, from the *router* filesystem, mount the floppy in question and copy
the module to the RAM disk filesystem...
routerprompt# mount.boot /mnt
routerprompt# cp /mnt/pcnet32.o /lib/modules
routerprompt# rm /mnt/pcnet32.o
routerprompt# umount /mnt
And add a line to /etc/modules reflecting this particular modules. In my
case, it was as easy as...
routerprompt# echo "pcnet32" >> /etc/modules
Now, you'll need reflect these changes to the actual compressed filesystem
stored on the floppy. Enter "lrcfg" to access the EigerStein menu, and choose
option "b" to backup the RAM disk to floppy. Remember, you'll need to do
this anytime you modify the installation, so your changes will survive a
Once backed up, reboot and see if your NIC's were detected. If so, awesome.
If not, I can only direct you to linuxdoc.org for further info. Sorry.
Assuming the cards worked, check your cabling one more time. WAN goes to
eth0, and LAN goes to eth1, if you can figure out which one is which yet.
At this point, if everything has worked thus far, and you use it, configure
the DSL PPPoE setup by typing "adsl-setup". This menu will direct you
through the configuration, and write the changes to (RAM) disk. Don't forget,
once the config is done properly, back it up, or you'll lose it on reboot!!!
As a side note, the default firewall configuration in the adsl-setup options
caused my router to drop all my packets to the WAN, so I had to manually
configure a firewall later.
With the WAN setup done, LAN should be easy. EigerStein has a DHCP server
already configured for handing out IP's on the 192.168.1.* private network,
so just run a DHCP client on the workstation(s) you are connnecting. EigerStein
is also configured for IP masquerading, without additional setup from you.
<- contents ->