linux router
I notice that the information on how to make a linux router is slowly disappearing on the web. A linux router has throughput far greater than a cheap (less than $200) retail router. Running benchmarks with my cable provider I get almost 5 times the speed in speed test. I prefer using Slackware for a router. My router uses the current version, Slackware 12. It should work pretty much out of the box. Just do a complete install on a computer (I prefer a decent computer with 1 gb ram and 2 ghz or better processor however, you can get by with almost any discarded system that still works) with decent sized hard drive (anything 20 gb or higher will do). I usually use my box for other things like a Samba server and print server. If you plan to do that, make it a larger drive. You do need to add a second ethernet card (the first is usually on the motherboard).
Once you install linux and get a login prompt, the rest is simple. If you have a pppoe connection (dsl), the scripts are already included. Simply run pppoe-setup and answer the questions. Then you should be able to execute pppoe-start and obtain a connection. You are about finished. You need a nat routing script (shown below) and to enable ip forwarding (with Slackware, you just execute rc.ip_forward at boot (chmod 755 rc.ip_forward). Take the below script and place it in a file, make it executable and place it in rc.local (/etc/rc.d/rc.local). A cable internet connection is similar. You can use a simple script to bring the cable connection up..assuming your cable modem is connected to eth1, just execute this script: dhcpcd -d -t 30 -R eth1 (leave off the -R if you want to use the nameservers of your cable provider and overwrite /etc/resolv.conf). You should see it connect and obtain a dhcp-lease in a few seconds. Execute ifconfig to make sure you are connected or ping something like google.com. You can write a disconnect script ..it’s simply dhcpcd -k eth1. Once this is working you use the script below and rc.ip_forward to enable packet forwarding to the local network. You need to also implement some firewall rules using iptables. There are many samples of this on the net.
iptables –table nat –flush
iptables –delete-chain
iptables –table nat –delete-chain
iptables –table nat –append POSTROUTING –out-interface eth1 -j MASQUERADE
iptables –append FORWARD –in-interface eth0 -j ACCEPT