Build Your Own Router

First geek project I’m going to make time for is what I call the BYOR. Instead of buying one of the two zillian consumer firewall/router/wi-fi boxes out there, I’ll make my own. I’ve never really completely trusted many of the consumer products, and they always seem to be lacking some of the features I really want. Like flexible traffic shaping which should make my asymmetric broadband at home less sucky.

I’ve decided I want to be able to run a full fledged UNIX (BSD or Linux) on the box, which leaves me with three options:

  1. Just use a regular PC. I’ve done this before.. Boring..
  2. Get a Linksys WRT54G[S] and run an alternative Linux firmware.
  3. Use an embedded board and build up something on my own.

Option two was tempting but seemed pretty inflexible still. Since this project is all about having fun and making shit up as I go, I opted to make a BYOR from some sort of embedded product. Fortunately, this isn’t nearly as difficult as you might believe. Why? Well, because of things like this:

PC Engines WRAP 1E-1

That’s one of the PC Engines WRAP boards. Basically it’s a ready to go x86-ish PC-ish computer on a board. It includes two 10/100 Ethernet ports, two mini-PCI slots (for adding things like wireless cards) and a compact flash adapter for holding the OS. No moving parts, which means no noise and higher reliability. The processor is a 266 MHz AMD Geode SC1100 (AMD bought this line off National Semiconductor as far as I can tell), which based on things I’m reading on forums ought to be plenty fast for broadband routing. You’ll find this processor used in a bunch of products, like the net4801 from Soekris Engineering. Soekris gives you extra goodies like one more Ethernet port, a full size PCI slot, and a native IDE connector. The WRAPs sell for about US$140, and the net4801s sell for about US$240. For this project, I’ll save the $100 and go with the PC Engines product.

The cool thing about these boards is that they really don’t require much OS hackery to get up and running. If you can build a custom kernel then FreeBSD, OpenBSD, and Linux all have the right hooks in their stock kernel source trees for you to turn on and you’re in business. So I’ll just build a kernel and a stripped down userland on my PC, then tftpboot the wee BYOR and copy everything to an old 96MB CF card I have from my old digicam. And that’s why this option is so powerful. I can build up whatever sort of appliance I might need. I could get a case like this:


Internal case

to build up my at home broadband router. Or I could decide that what I really wanted to do was to build my own outdoor wi-fi router and pop the board into something like this:


Outdoor wi-fi

The guys at mini-box.com have all sorts of neat stuff like this. The barrier to entry in the embedded space just dropped to the floor. I can run a “bare” BSD or Linux and build up the components myself, or I can try running one of the many open source projects focused on dedicated firewall boxes that you manage with a web interface.

And that’s what I plan on doing. I’m going to order the WRAP this week, and then play around with a bunch of software stacks to see what works best. I’m really looking forward to trying FreeBSD/OpenBSD’s pf+ALTQ framework. That’s probably what I’ll start with. I haven’t seen any good performance testing done on this sort of a setup, so I may even try to bring it into the office and hook it up to the IXIA test set and see how the various stacks handle different types of loads. Hopefully in the not too distant future there will be a part 2 to this post once I get the hardware running!


About this entry