Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



Linux++:::: Quickie: Loadbalance your two gateways
Posted at 11.Oct,2006 10:18  Comments 2 / Trackbacks 0 / Like this post!
Technorati tag(s):

If we have access to two upstream links, we can actually load balance the traffic to use both the uplink.

This is not onding, but load balancing. Haven't yet tried bonding.

Here's how to:

edit /etc/iproute2/rt_tables, enter the table name for both links:

  #test
  200     tms
  199     tml

Now run this script:

  eth0-network=10.10.0.0/24
  eth0-ip=10.10.0.1
  eth0-gw=10.10.0.254

  eth1-network=192.168.0.0/24
  eth1-ip=192.168.0.1
  eth1-gw=192.168.0.254

  /sbin/ip route add eth0-network dev eth0 src eth0-ip table tms
  /sbin/ip route add default via eth0-gw table tms

  /sbin/ip route add eth1-network dev eth1 src eth1-ip table tml
  /sbin/ip route add default via eth1-gw table tml

  /sbin/ip rule add from eth0-ip table tms
  /sbin/ip rule add from eth1-ip table tml
  /sbin/ip route replace default scope global nexthop via eth0-gw   dev eth0 weight 1 nexthop via eth1-gw dev eth1 weight 1

Get more from lartc.org


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/105/tbping 

Comments
Thank you!

It works! :)

Ivan  at 06.Mar,2007 23:15
yes!

it does work. ain't that great?

kedai  at 12.Mar,2007 09:58
Post a comment