[ilugc] Sharing and managing two ISP

  • From: binand@xxxxxxxxx (Binand Sethumadhavan)
  • Date: Mon May 16 14:07:06 2005

On 15/05/05, Murlidaran .R <murlidaran@xxxxxxxxx> wrote:

In eth0 'A' I have the IP 10.0.0.1 and a virtual IP 192.169.0.1. Now
the plan is to make the 10.x.x.x n/w use ISP1 in eth1 'B' and
192.168.0.x n/w to use ISP2 in eth2 'C'. I tried SNAT and iproute2,
but was not able to use them properly. Can any one give me an the
commands? Does SNAT need any configuration to be done in sysctl or
/proc?

Here goes...

ip rule add from 10.0.0.0/24 table lan1 prio 100
ip rule add from 192.168.0.0/24 table lan2 prio 100

ip route add 10.0.0.0/24 dev eth0 table lan1
ip route add 192.168.0.0/24 dev eth0 table lan1
ip route add default via <def.gw.ip.isp1> table lan1

ip route add 10.0.0.0/24 dev eth0 table lan2
ip route add 192.168.0.0/24 dev eth0 table lan2
ip route add default via <def.gw.ip.isp2> table lan2

The two routing tables (lan1 & lan2) are identical, except for the
default gateway. The two rules tell the system which routing table to
use, depending on the source network of the traffic.

I expect you can figure out the SNAT part.

Binand

Other related posts: