Load balancing between two gateways

From Notes_Wiki
Revision as of 12:54, 9 November 2012 by Saurabh (talk | contribs) (Created page with "=Load balancing between two gateways= For load balancing between two gateways use: <pre> ip route del default ip route add default scope global nexthop via <gateway_1> ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Load balancing between two gateways

For load balancing between two gateways use:

ip route del default
ip route add default scope global nexthop via <gateway_1> dev <interface of gateway 1> weight 1 \
     nexthop via <gateway_2> dev <interface of gateway 2> weight 1

Here weights can be changed to make one route more preferable to other.

We can use 'ip route show' command to verify that routes got added properly.

For more information refer http://lartc.org/howto/lartc.rpdb.multiple-links.html#AEN298