I have configured CentOS 5.4 as a router/firewall (iptables) as such, and it is working fine:
eth0 - Public IP/Intenet, DHCP
eth1 - 192.168.0.0 internal "net1"
eth2 -10.0.0.0 internal "net2"
I want to add a fourth NIC, eth3, which will be assigned its own Public IP/Internet address (thru DHCP; my ISP provides two). The purpose it to route all net1's internet-bound traffic through eth0, and all of net2's internet traffic to eth3. This allows me to use one router/firewall machine instead of two separate ones.
I anticipate that without some specific routing instructions, the default route will be eth0 for all net1 and net2 internet traffic (eth3 will be ignored).
I thought of using just one NIC (eth0) but create an alias (eth0:0), but IPtables (and possible DHCP) can't differentiate between the two (besides, nics are inexpensive).
Is there a way to do this through routing commands, or even use iptables prerouting/forward functions (or is using iptables problematic)?