Re: load balance [OT?]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin wrote:
Hello netfilter list!

#ISP 1
ip route add $ISP1_NET dev $ISP1_IF src $ISP1_IP table 1
ip route add default via $ISP1_GW dev $ISP1_IF

#ISP 2 ip route add $ISP2_NET dev $ISP2_IF src $ISP2_IP table 2
ip route add default via $ISP2_GW dev $ISP2_IF

#Rules for ISPs
ip rule add $ISP1_IP table 1
ip rule add $ISP2_IP table 2

#Internal LAN and cross reference to the other ISP
ip route add $LAN_NET dev $LAN_IF table 1
ip route add $ISP2_NET dev $ISP2_IF table 1

ip route add $LAN_NET dev $LAN_IF table 2
ip route add $ISP1_NET dev $ISP1_IF table 2

#Add isp net in main
ip route add $ISP1_NET dev $ISP1_IF src $ISP1_IP
ip route add $ISP2_NET dev $ISP2_IF src $ISP2_IP

#This should do the trick of balancing

ip route add default scope global equalize nexthop via $ISP1_GW dev
ISP1_IF weight 1 nexthop via $ISP2_GW dev $ISP2_IF weight 2


What actually happens is that traffic is going out only by the first GW
declared in the first nexthop, and it doesn't care weight nor balance.
The only chance of making it to go throw the second GW declared is
shutting down or collapse that interface, so then it goes for the second
one.

You have requested different weights:

ip route add default scope global equalize nexthop via $ISP1_GW dev
ISP1_IF weight 1 nexthop via $ISP2_GW dev $ISP2_IF weight 2

If you want each to be equal then at least give them equal weights.


--
Mark Perry
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux