GNU/Linux has a very powerful IP stack built into the operating system. Linux itself has the capability of routing your lan to the internet with NAT or Network Address Translation, i.e. IP Masquerading. *www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO.html
You can even use a micro-distribution of gnu/linux. There are versions of gnu/Linux out there that run off of a single floppy disk. Using one of these distributions, you can convert an old, unused computer (even a 486!) into a capable broadband router. Since the software fits on a floppy, you don’t even need a hard drive in the system! Most of the micro-distributions of Linux routers have minimum requirements of a 386 with 16Mb of memory.
see : *www.coyotelinux.com/
or use special distro like Devil-Linux 1.0: Firewall/Router Distro , it is an An ideal Linux distribution for an easy-to-configure firewall or router -- especially if it needs to run on old hardware.