¡Esta es una revisión vieja del documento!


Network Load Balancing

Descripción

Prerequistos

Procedimiento

A. Instalación básica

B. Configuración

1. Una accion

2. Segunda accion

Problemas

1. Si el instale_mrtg.sh no le funciona

-

Referencias

- http://blog.taragana.com/index.php/archive/how-to-load-balancing-failover-with-dual-multi-wan-adsl-cable-connections-on-linux/ –

-

FIN


#!/bin/sh
# by skina
#
#IP address of external interfaces. This is not the gateway address.
IP1=192.168.69.10
IP2=`ifconfig ppp0  | head -n 2 | tail -n 1 | cut -d: -f 2| awk '{print $1}'`

#Gateway IP addresses. This is the first (hop) gateway, could be your router IP
#address if it has been configured as the gateway
GW1=192.168.69.1
GW2=10.64.64.64

NET1="192.168.69.0/24"
NET2="10.64.64.64/32"

DEV1=eth0
DEV2=ppp0

# Relative weights of routes. Keep this to a low integer value. I am using 4
# for TATA connection because it is 4 times faster
W1=2
W2=1


# Broadband providers name; use your own names here.
NAME1=etb
NAME2=tigo

################### --------- ahora si hagale

route del -net default

echo "ip route add $NET1 dev $DEV1 src $IP1 table $NAME1"
ip route add $NET1 dev $DEV1 src $IP1 table $NAME1

echo "ip route add default via $GW1 table $NAME1"
ip route add default via $GW1 table $NAME1

echo "ip route add $NET2 dev $DEV2 src $IP2 table $NAME2"
ip route add $NET2 dev $DEV2 src $IP2 table $NAME2

echo "ip route add default via $GW2 table $NAME2"
ip route add default via $GW2 table $NAME2

echo "ip rule add from $IP1 table $NAME1"
ip rule add from $IP1 table $NAME1

echo "ip rule add from $IP2 table $NAME2"
ip rule add from $IP2 table $NAME2

echo "ip route add default scope global nexthop via $GW1 dev $DEV1 weight $W2 nexthop via $GW2 dev $DEV2 weight $W2"
ip route add default scope global nexthop via $GW1 dev $DEV1 weight $W1 nexthop via $GW2 dev $DEV2 weight $W2
 

 

15-Marzo-2006 J.E.Gomez v1.0 Primera version


Advertencia

Este documento es privado y es de u so exclusivo de sus autores y de SKINA TECH. Cualquier uso sin una autorización escrita es contra la ley de derechos de autor y de propiedad intelectual, y será motivo de una acción legal.


Volver arriba