From: Alan Romaniuc <alan.romaniuc@inteligensa.com.br>
To: lartc@vger.kernel.org
Subject: [LARTC] Load Balancing Problems
Date: Mon, 08 Jan 2007 15:58:20 +0000 [thread overview]
Message-ID: <45A26A1C.1030302@inteligensa.com.br> (raw)
In-Reply-To: <459E3793.6040805@inteligensa.com.br>
I am having with loadbalancing. I can get it working never....
I have this scenario:
INTRANET -------- (IP0, INTERFACE0) ROUTER (IP1,INTERFACE1) ----
NET1 --- (IPGW1) EXTRANET 1
|
|----(IP2,INTERFACE2) ----
NET2 --- (IPGW2) EXTRANET 2
I have a Debian box with debian kernel, and I have a my kernel too, ith
patches from Julian's route patch page.
Here is my scritp... copied from lartc
==
ip route add $NET1 dev $INTERFACE1 src $IP1 table $TABLE1
ip route add default via $IPGW1 table $TABLE1
ip route add $NET2 dev $INTERFACE2 src $IP2 table $TABLE2
ip route add default via $IPGW2 table $TABLE2
ip route add $NET1 dev $INTERFACE1 src $IP1
ip route add $NET2 dev $INTERFACE2 src $IP2
#ip route add default via $IPGW1
ip rule add from $IP1 table $TABLE1
ip rule add from $IP2 table $TABLE2
# MAGIC LINE !!!!!!!!!!!!!!!!!!!!!!!
ip route add default scope global \
nexthop via $IPGW1 dev $INTERFACE1 weight $WE1 \
nexthop via $IPGW2 dev $INTERFACE2 weight $WE2
ip route add $NET0 dev $INTERFACE0 table $TABLE1
ip route add $NET2 dev $INTERFACE2 table $TABLE1
ip route add 127.0.0.0/8 dev lo table $TABLE1
ip route add $NET0 dev $INTERFACE0 table $TABLE2
ip route add $NET1 dev $INTERFACE1 table $TABLE2
ip route add 127.0.0.0/8 dev lo table $TABLE2
#Extra rule for cable router
if [ "$ROUTER1" ]; then
ip route add $ROUTER1 dev $INTERFACE1 src $IP1
fi
===
with this script, I am getting always rooted using the second gateway
from "MAGIC LINE", with am i doing a download (bittorrent for example)
and redefine the routes (changing the first by the second) I can get a
full download speedy (link1 + link2 bitrate) and both interface works
normally. If I stop my torrent, flush the table, and start the download
again, only the second link will work again, so load balancing never
works...
here is some more debug information:
>>ip rule
0: from all lookup 255
32764: from 189.1.1.130 lookup uplink_e
32765: from 201.1.1.88 lookup uplink_v
32766: from all lookup main
32767: from all lookup default
>>ip route
192.168.100.1 dev eth_virtua scope link src 201.6.156.88
189.1.1.128/26 dev eth_embratel proto kernel scope link src 189.1.1.130
10.0.0.0/24 dev eth_wifi proto kernel scope link src 10.0.0.1
192.168.1.0/24 dev eth_intra1 proto kernel scope link src 192.168.1.1
201.1.1.0/24 dev eth_virtua proto kernel scope link src 201.1.1.88
default
nexthop via 201.1.1.1 dev eth_virtua weight 1
nexthop via 189.1.1.129 dev eth_embratel weight 1
>>Iptables (All ACCEPT)
$IPTABLES -t nat -A POSTROUTING -o $INTERFACE1 -j SNAT --to-source $IP1
$IPTABLES -t nat -A POSTROUTING -o $INTERFACE2 -j SNAT --to-source $IP2
>>rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
203 uplink_e
202 uplink_v
PS: Ip numbers are not real .... :/
Thanks in advance for any help;
--
Alan Romaniuc
Phone : +55 11 5105-4955
Mobile : +55 11 8270-2520
alan.romaniuc@inteligensa.com.br
INTELIGENSA DO BRASIL
Rua Quintana, 887, 5o. andar - Brooklin
04569-011 - São Paulo - SP - BRASIL
www.inteligensa.com.br
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
next prev parent reply other threads:[~2007-01-08 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-05 11:33 [LARTC] Load Balancing Problems Alan Romaniuc
2007-01-08 15:58 ` Alan Romaniuc [this message]
2007-01-09 13:36 ` Luciano Ruete
2007-01-09 22:42 ` Alan Romaniuc
2007-01-10 13:29 ` Kuolung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A26A1C.1030302@inteligensa.com.br \
--to=alan.romaniuc@inteligensa.com.br \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.