Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Load Balance and Fail Over on CentOS

    Hello Everyone,

    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 /28
    eth1 - ISP 2 - 4M Leased Line /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) dev eth0 proto kernel scope link src dev eth1 proto kernel scope link src dev eth2 proto kernel scope link src dev eth2 scope link
    default via dev eth1

    When I tried to type below. no error but when I check route -n, still the same output.
    #ip route add dev eth0 src table IGT
    #ip route add default via table IGT
    #ip route add dev eth1 src table BTEL
    #ip route add default via table BTEL
    #ip rule add from table IGATE
    #ip rule add from table BTEL

    When I type this, I got error
    #ip route add default scope global nexthop via dev eth0 weight 1 nexthop via 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 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.


  2. #2

    I've successfully implement this, by following Routing for multiple uplinks/providers

    CentOS Linux 5.7
    Squid version 2.6

    eth0 = WAN
    eth1 = WAN
    eth2 = LAN

    When I use it without squid proxy, it works perfectly, I tried to take down one ISP and another using ifdown anf ifup command, and fail over is working.
    iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A INPUT -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
    iptables --append FORWARD --in-interface eth2 -j ACCEPT
    Now when I use SQUID Proxy, only eth0 is working., so when eth0 is down, I had to adjust the iptables to comment the line with ip 58.71.xx.xx and eth0.

    service iptables save. and it works.

    Which means, when using squid proxy, when eth0 is down eth1 will not take over unless I re-configure the iptables.

    On my squid.conf.
    http_port 3128 traparent

    DNAT port 80 request comming from LAN systems to squid 3128 ($SQUID_PORT)
    iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 80 -j DNAT --to 58.71.xx.xx:3128
    iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 80 -j DNAT --to 202.78.xx.xx:3128
    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
    iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
    Is there anything we can do to fix this on squid? I also want Load Balance and Fail over work on squid proxy.

    Sincerely, WizzKid

  3. #3
    Im having the SAME issue, have you fixed the problems to work with SQUID? im using Squind and MSN-Proxy.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts