using route tool to forward traffic between two nics
Hey guys. I am trying to set up a Linux box that can act as a router (and firewall later). I have a Debian 5 installation and it has two nics in it. I am trying to use the linux route command to set up a route between the two interfaces. I am finding it difficult to do.
Let me explain how I am trying to set up my network:
I have the ethernet cable from my modem connecting to eth0 of my Debian box, then I have eth1 connecting to a switch, which I connect all my computers and other devices to.
I want to have two different ip address schemes for the devices.
So here is my interfaces file:
right now, route -n displays this:
#eth0 connects to modem
iface eth0 inet static
#eth1 connects to switch
iface eth1 inet static
So I am wondering, to get my ethernet traffic from eth0 to eth1 and vice versa, do I need to make it so the Gateway for Destination 192.168.1.0 is 10.1.1.1, and for Destination 10.0.0.0, Gateway 192.168.1.0?
Destination Gateway Genmask Flags UseIface
192.168.1.0 0.0.0.0 255.255.255.0 U eth1
10.0.0.0 0.0.0.0 255.0.0.0 U eth0
I have looked at the linux manpage for route and I am still confused. I have also looked at the Debian networking page, but it is still unclear to me how to do this.
Can someone help me understand how I am to use the route command to get this working? Or am I not even supposed to use the route command?
Thanks for any input