July 1, 2007
Linux server as a router?
I have two network cards on my linux server. one I use to connect to the internet, and the other is for nothing. Is it possible that I could use the other NIC to assing an IP address to my router to be able to connect other pcs to the internet. Preety much, the server acting like a router, except it has only one port.
- Of course this is possible. The most popular way of accomplishing this is using IP forwarding/ NAT (network address translations). Check out the how-to linked below.
- http://tldp.org/howto/ip-masquerade-howt…
- There are two common ways to do this.
1) Use a program, like Freesco, to convert an old computer into a router. The computer will not even need a hard drive or CD. I have personal seen it run from an old Pentium 90mhz with 16mb of RAM. This is and open source and free to everyone. It is a good way to understand how commercial routers work.2) The second and most reliable way is a Web Proxy Server. I recommend Squid Web Proxy. It is also a freeware open source project.
This to can be a lot of fun.
- Yes. That's what I do at home. I have a linux PC with one NIC connected to my cable modem, and the other nic is assigned 192.168.1.1 and acts as the gateway/router for my home network.
It makes for a great firewall/router/gateway.























