I have a Virtual private cloud running on 10.0.0.x. In this network two machines share a virtual ip to provide HA and connection to the internet via aaa.bbb.ccc.164. There configs are:
Proxy1:
eth0:0 inet addr:aaa.bbb.ccc.164 Bcast:aaa.bbb.ccc.255 Mask:255.255.255.0
eth1 inet addr:10.0.0.10 Bcast:10.0.0.255 Mask:255.255.255.0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 aaa.bbb.ccc.1 0.0.0.0 UG 100 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
aaa.bbb.ccc.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Proxy2:
eth0 Link encap:Ethernet HWaddr da:00:07:b0:97:c7
inet addr:aaa.bbb.ccc.26 Bcast:aaa.bbb.ccc.255 Mask:255.255.255.0
eth1 Link encap:Ethernet HWaddr aa:01:41:b0:97:c7
inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0
In this example Proxy1 holds the Virtual IP.
So behind these proxies, a couple of servers exists. At this moment default gateway is static configured to Proxy2, but when is one is unavailable, the internet can't be reached.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.50 0.0.0.0 UG 100 0 0 eth1
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
So, I want them to route to the outside world via the virtual ip address. What will be the best way to accomplish this?