Enter your email address:

Delivered by FeedBurner

Balanced Routes


StumbleUpon Toolbar

Hi,

If you want to make your linux machine balance the load of your internet access, you can use ip route.

Let's use this script

-----------cut here--------------

#!/bin/bash

#IPs of the def gateways

IP1=192.168.1.1

IP2=192.168.2.1

REDLOCAL=10.1.1.0/24

IPLOCAL=10.1.1.1

# NICs

IF1=eth0

IF2=eth1

ip rule add from $IP1 lookup T1

ip route add $REDLOCAL via $IPLOCAL table T1

ip route add 0/0 via $IP1 table T1

ip route add from $IP2 lookup T2

ip route add $REDLOCAL via $IPLOCAL table T2

ip route add 0/0 via $IP1 table T1

ip route default equalize nexthop via $IP1 dev $IF1 nexthop via $IP2 dev $IF2

--------------cut here ---------------------

that should do the job, off course make the changes on the variables according to your needs.

regards.

Trackback URL for this post:

http://www.go2linux.org/trackback/12
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting