Load Balance and Fail Over on CentOS
I am trying to setup a Load Balance and Fail over running on CentOS (CentOS release 5.7 (Final)).
Here's my setup.
eth0 - ISP 1 - 4M Leased Line 220.127.116.11 /28
eth1 - ISP 2 - 4M Leased Line 18.104.22.168 /28
eth2 - LAN : 192.168.1.x
I am following this guide Dual WAN Configuration with Linux
Here's my current routing table (route -n)
22.214.171.124/28 dev eth0 proto kernel scope link src 126.96.36.199
188.8.131.52/28 dev eth1 proto kernel scope link src 184.108.40.206
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.1
169.254.0.0/16 dev eth2 scope link
default via 220.127.116.11 dev eth1
When I tried to type below. no error but when I check route -n, still the same output.
#ip route add 18.104.22.168/28 dev eth0 src 22.214.171.124 table IGT
#ip route add default via 126.96.36.199 table IGT
#ip route add 188.8.131.52/28 dev eth1 src 184.108.40.206 table BTEL
#ip route add default via 220.127.116.11 table BTEL
#ip rule add from 18.104.22.168 table IGATE
#ip rule add from 22.214.171.124 table BTEL
When I type this, I got error
#ip route add default scope global nexthop via 126.96.36.199 dev eth0 weight 1 nexthop via 188.8.131.52 dev eth1 weight 1
it says "RTNETLINK answers: File exists"
Also, I cannot use my other line which is the 58.71.x.x segment when the other line is plugin and configure, maybe the system is using default gateway 184.108.40.206. So when the 121.10.x.x is down, I got no internet access.
1. How can I add default gateway for both ISP, 58.x.x.x and 121.x.x.x ? so when 1 link is down, another link will take over.
2. I am currently, using transparent proxy to share my internet, how can I configure the iptables to use both with load balance.
3. I am also using SQuid Proxy, but not sure how to configure to work on this setup (dual wan/ load balacer / fail over)
Hope you can help me with this setup. :)