LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Route with 4 NICS

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Route with 4 NICS
From: Horms <horms@xxxxxxxxxxxx>
Date: Tue, 14 Oct 2003 11:42:12 +0900
On Sat, Oct 11, 2003 at 02:45:05PM -0300, Mauricio Portilho Cavalcanti wrote:
> Hi, sorry my english.
> 
> i have 4 NIC's in my server.
> 
> eth0 - to local network with IP 10.0.0.1
> eth1 - to router 1
> eth2 - to local network with IP 192.168.0.1
> eth3 - to router 2
> 
> I have a program running in IP 10.0.0.2 that must work in both local
> networks.
> 
> I deleted GATEWAYDEV and GATEWAY in /etc/sysconfig/network and i'm trying to
> put routes in /etc/rc.local.
> 
> The 192 net gateway must to be set to eth3 and the 10 net gateway must to be
> set to eth1.
> 
> So, if  i'm in 192 net and i try to access internet i will be redirected to
> eth3 and if  i'm in 10 net, to eth1.
> 
> How can i force this? How can i configure my default gateway in server?

Sounds like you need to set some policy routes.

You should read up on this but as a rough guide, off the top of my head.

ip rule add prio 100 from 10.0.0.1 table 101
ip route add table 101 via <ip address of router 1>

ip rule add prio 100 from 192.168.0.1 table 102
ip route add table 102 via <ip address of router 2>

-- 
Horms
<Prev in Thread] Current Thread [Next in Thread>