Tux + Linux Items

Help promote Linux and FOSS at the
Sample T-Shirt from the ERACC Cafe Press Store
ERACC Cafe Press Store

GNU/Linux: Replacing a Dead Router with a Linux System

Earlier today I decided to upgrade the firmware on my SOHO’s Linksys WRT54G v5 router. I usually do such things on the weekends in case something breaks. It is a good thing I waited until the weekend this time. My Linksys WRT45G is now “bricked”. For some unknown reason the firmware update never finished although I waited for over an hour for it to complete. Of course no internet access was happening during this time and I could not get to any web sites to try to discover what I could do to fix the router.

Enter an old Dell Dimension XPS R400 PC that has been gathering dust in the closet. It has an 80GB Western Digital IDE drive, a Startech 10/100 NIC and 192MB of RAM in it. I received this old PC from a client that bought a new, custom built system from my company in October 2007. He no longer needed the Dell and was just going to trash it. Instead I convinced him to let me wipe the drive, install Mandriva 2008 on it and try to sell it on eBay. It did not sell when I listed it. The client did not want it back, so I just stuck it in the IT junk closet with several other old systems and flaky monitors. I decided to make this old Dell PC into my “new” router. Since it already has Mandriva 2008 on it I figured I could use that to get routing going and then upgrade the Mandriva later.

I also have an even older custom built PC that has been running a very old Mandriva for years as a file share and a Hylafax send / receive server. It has been giving drive errors so I knew it was going to need to be repaired soon. Once I decided to use the Dell I figured I would scavenge this old PC for its 3Com 10/100 NIC and its hard drive so I could easily copy the Hylafax settings to the “new” router PC. I began shutting things down and taking apart PC systems. After a bit of dust cleaning, parts rearranging and cable connecting I had the Dell ready to boot up with the 3Com NIC installed as a second NIC and the hard drive from the old Hylafax server in place. A small 5-port Linksys switch is taking the place of the built-in switch on the Linksys WRT54G.

I booted up the Dell and tried to login as root at a CLI “login:” prompt. However, I had forgotten the password. Luckily it has LILO boot loader on it and I know I can reboot with “linux single” on the boot line to get to a root prompt and reset the password for root. This was done and a few minutes later I was in the command line version of Mandriva Control Center (MCC) setting up the network. Then I go to set up “Internet connection sharing” and it keeps failing with an error stating it cannot find a network adapter when I choose the NIC that is connected to the internet in preparation for choosing the NIC that is connected to the LAN.

After scratching my head and thinking about this a bit I have an epiphany. The second NIC is on the internet and is probably configured in the firewall settings as the local network. Sure enough when I check the settings in /etc/shorewall/interfaces (Shorewall is a set of scripts included in Mandriva to manage the Linux iptables firewall for one.) the second NIC, eth1, is set as loc. Meaning it is set to be the local interface for the LAN instead of the WAN interface, called net, for the internet. Changing these around is a matter of a few seconds in ‘vim’. I then restart Shorewall with ‘service shorewall restart’ to reconfigure the iptables settings in memory. Then I can finish configuring “Internet connection sharing”. Once that is done I test sharing from my SOHO desktop PC and find I am back online. Total time from completely down to back online with a Linux system based router – about 3 hours.

Now that I am back online with a “new” Linux / iptables based router my next task will be to set up my port forwards and maybe some QoS (Quality of Service) settings for the company VoIP phone. I know how to do the port forwards but I have no clue how to set up QoS for a service. Time to do some web searching for that QoS stuff.

Edit Sat Jan 23 18:47:20 CST 2010: Fix some typographical errors.

This article has had this many unique views:

hit counter code
hit counter code

Notice: All comments here are approved by a moderator before they will show up. Depending on the time of day this can take several hours. Please be patient and only post comments once. Thank you.

Share

10 comments to GNU/Linux: Replacing a Dead Router with a Linux System

  • Anthony

    You can actually fix a bricked linksys router by taking the shell apart and doing an internal reset. This forces the box to let you upload a new image via TFTP if I remember correctly; so your linksys WRT54g isn’t bricked. Send it to me if you really don’t want it ;)

  • Anthony (comment #1), thanks for the comment.

    There are several ways to recover from a “bad flash” of a Linksys router. I have used them in the past. Some documentation for these are here:

    http://www.dd-wrt.com/wiki/index.php/Recover_from_a_Bad_Flash

    The thing is, I did not have a copy of that page saved here and I could not get on the ‘net to go see it. In any case, I can now recover the router and will keep it as a backup. ;)

  • Social comments and analytics for this post…

    This post was mentioned on Reddit by cookie_monstrosity: I’ve always had good luck with IPCop. I have routed an entire Gigabit backbone connection with a PII 266 and 96MB RAM….

  • Richard Smith

    I have an old Emachine T1090 that I have been using as a router using monowall. No hard-drive needed, monowall boots from a cd image and gets configuration variables from a floppy. It has a web gui and runs FreeBSD. Best buck I ever spent!

  • RTB

    Hi,

    Have a look at devil-linux. It’s basically and .iso image and a single file for config (compress modification to /etc)

    Works really well, fast easy to upgrade.

    I use this with firewall builder to build the firewall policy

    http://www.devil-linux.org
    http://www.fwbuilder.org/

  • Michael

    Never tried Vyatta? I run an entire ISP business on it with a not so recent P4 Whitebox PC. It can run from CD, have a copy at hand in this cases is a life saver!

  • Richard Smith (comment #4), thanks for the comment.

    I do have one system here running FreeBSD as a database server and file share for the business part of our LAN. So, I did consider m0n0wall on a disk-less system but decided against it when I realized I needed to replace the old FAX server / file share PC. As in most micro-businesses I have to use one device for multiple tasks. So this “new” router is also the “new” Hylafax send / receive server and a “new” file share server for the personal / home part of our LAN. Neither of which are m0n0wall’s intended purpose. As I recall m0n0wall is just a firewall, although an excellent one.

  • Kamilion

    Taken a look at ubuntu-based eBox yet?

    http://www.ebox-platform.com/

    Runs great on older PC hardware, best web interface I’ve found for something that isn’t tomato or dd-wrt. Also — there’s an upcoming asterisk package that’s ‘getting better’. Shouldn’t be too long until hylafax and iaxmodem shows up.
    Since it’s just ubuntu, you can still set any package up yourself. Plus there’s a nice iptables and port forward interface.

  • Coupon codes (SPAM)

    Improper URL to internet scam removed by administration. Do not do that.

    It’s an offtopic but i had to ask as i see you know what your doing… the best server distribution is centOS or Ubuntu?

    Dear teiubesciulia@yahoo.com a.k.a. “Coupon codes”, since you really do not care about the answer due to posting a URL to an internet SCAM I think you should figure out the answer for yourself. Have a nice weekend. Gene

  • [...] off of a client. That laptop is now also running Mandriva Linux. The old Dell PC beside my desk is now a Linux firewall / router for my SOHO LAN. If I need to access a document on my SOHO PC from some other location I have the [...]

Leave a Reply

  

  

  

By posting you agree you have read and will abide by our comment policy.
If you have not read the comment policy, please do so, then post a comment.

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>