[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RV: Troube whith multiple isp conections



Title: Message

 

 


De: Ivan Camargo Ortiz [mailto:ivan.camargo@glostech.com]
Enviado el: Viernes, 24 de Febrero de 2006 09:23 a.m.
Para: 'nest_consulting@yahoo.ca'
Asunto: RE: Troube whith multiple isp conections

 

Hello:

 

Im still having trouble while sharing the Internet to my LAN, I wanted to ask if its ok to use the ipmasq  like next is written:

 

#!/bin/bash

/sbin/iptables -F

/sbin/iptables -t nat -F

echo 1 > /proc/sys/net/ipv4/ip_forward

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

/sbin/iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

 

Im clueless of what am I missing.  

 

The balancing is working, as I testes from the Server itself, It shows that it balance my petitions

Through my 3 Interfaces.

 

Please Help.

 

Ivan Camargo

 


Asunto: RE: Troube whith multiple isp conections

 

 

I had a similar problem just last week, and it was caused by multiple default routes in my main table. I noticed that

you "ip route flush default" twice.

 

Make sure that you don't have more than 1 default route per table, main, link1, link2, link3, link4.

 

I added a few lines to your script that may help

  

Martin H.

 

Im having trouble while getting my 4 isp to work in the same LAN and balance the load soo that if one gets full to jump to the next isp.

 

 Im Using Kernel: 2.6.8

 

I have the next interfaces:

 

# ISP1

auto eth4

iface eth4 inet dhcp

 

#ISP2

auto eth0

iface eth0 inet dhcp

 

#ISP3

auto eth1

iface eth1 inet dhcp

 

#ISP4

auto eth2

iface eth2 inet dhcp

 

#Enlace 4

auto eth3

iface eth3 inet static

     address 192.168.1.1

     netmask 255.255.255.0

     network 192.168.1.0

     broadcast 192.168.1.255

 

Im using the next script:

#!/bin/sh

 

# I flush cache at the end of editing my routing, matter of preference I believe

 # ip route flush cache

#

 

ip route flush default 

#Flush your main table to ensure you start fresh 

ip route flush main 

ip route flush table link1

ip route flush table link2

ip route flush table link3

ip route flush table link4

 

ip route add 192.168.1.0/24 dev eth3 src 192.168.1.1

ip route add 172.17.41.0/24 dev eth0 src 172.17.41.190

ip route add 200.53.101.0/24 dev eth1 src 200.53.101.144

ip route add 192.168.123.0/24 dev eth2 src 192.168.123.230

ip route add 192.168.123.0/24 dev eth4 src 192.168.123.225

 

ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table link1 $ROUTE ; done

ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table link2 $ROUTE ; done

ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table link3 $ROUTE ; done

ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table link4 $ROUTE ; done

 

ip route add table link1 default via 172.17.41.1

ip route add table link2 default via 200.53.101.1 

#Notice below that routing 2 tables through the same IP will not get you an equalized 4 way.

#It will at your router side, but not necessarily on the other side, as they merge in the gateway. 

ip route add table link3 default via 192.168.123.1

ip route add table link4 default via 192.168.123.1

 

#List all routing tables, look to ensure there's only one default route per table

ip ro ls table main

ip ro ls table link1

ip ro ls table link2

ip ro ls table link3

ip ro ls table link4

 

ip rule add from 172.17.41.190 table link1

ip rule add from 200.53.101.144 table link2

ip rule add from 192.168.123.230 table link3

ip rule add from 192.168.123.225 table link4 

 

#List rules set, ensure that you don't have doubles:

ip ru ls 

 

#You might want to setup weight ratios depending if all your links are same speed or not.

#Remember that eth2 & eth4 will merge traffic at the gateway.

#Supposed you have 4 equal link speeds, then weights of 2,2,1,1 will give you

#a ratio of 1/3 of the traffic load at each of the 3 available gateways.

#

ip route add default equalize nexthop via 172.17.41.1 dev eth0 weight 1 \

   nexthop via 200.53.101.1 dev eth1 weight 1  \

   nexthop via 192.168.123.1 dev eth2 weight 1  \

   nexthop via 192.168.123.1 dev eth4 weight 1

 

#Flush cached routing, applies new routing now.

ip ro flush cache

 

#END

 

Im using the next masquarde:

 

/sbin/iptables -F

/sbin/iptables -t nat -F

echo 1 > /proc/sys/net/ipv4/ip_forward

/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE 

 

Really I don’t know what is wrong, I cant share the conections to balance de load. With 2 I have no problems, but with 4 at the same time Im having trouble to detect the problem.


Reply to: