Routing 2 internal nets thru separate NICs to internet - how?

Issues related to configuring your network

Routing 2 internal nets thru separate NICs to internet - how?

Postby intermod » 2009/11/09 18:55:45

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)?

Thanks!

Greg
intermod
 
Posts: 3
Joined: 2009/10/31 18:48:47

Routing 2 internal nets thru separate NICs to internet - how

Postby yyagol » 2009/11/13 07:00:26

This is a very common task for a router setting
you may find all your answers here :
http://linux-ip.net/html/adv-multi-internet.html
yyagol
 
Posts: 1015
Joined: 2006/06/10 18:27:44
Location: 32 4′N 34 47′E


Return to CentOS 5 - Networking Support

Who is online

Users browsing this forum: No registered users and 2 guests