From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Romaniuc Date: Mon, 08 Jan 2007 15:58:20 +0000 Subject: [LARTC] Load Balancing Problems Message-Id: <45A26A1C.1030302@inteligensa.com.br> List-Id: References: <459E3793.6040805@inteligensa.com.br> In-Reply-To: <459E3793.6040805@inteligensa.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org I am having with loadbalancing. I can get it working never.... I have this scenario: INTRANET -------- (IP0, INTERFACE0) ROUTER (IP1,INTERFACE1) ----=20 NET1 --- (IPGW1) EXTRANET 1 | |----(IP2,INTERFACE2) ----=20 NET2 --- (IPGW2) EXTRANET 2 =20 I have a Debian box with debian kernel, and I have a my kernel too, ith=20 patches from Julian's route patch page. Here is my scritp... copied from lartc =3D=3D 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 =3D=3D=3D with this script, I am getting always rooted using the second gateway=20 from "MAGIC LINE", with am i doing a download (bittorrent for example)=20 and redefine the routes (changing the first by the second) I can get a=20 full download speedy (link1 + link2 bitrate) and both interface works=20 normally. If I stop my torrent, flush the table, and start the download=20 again, only the second link will work again, so load balancing never=20 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; --=20 Alan Romaniuc Phone : +55 11 5105-4955 Mobile : +55 11 8270-2520 alan.romaniuc@inteligensa.com.br =20 INTELIGENSA DO BRASIL Rua Quintana, 887, 5o. andar - Brooklin 04569-011 - S=E3o Paulo - SP - BRASIL www.inteligensa.com.br =20 _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc