Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| network_load_balancing [2024/05/28 16:13] – creado - editor externo 127.0.0.1 | network_load_balancing [2026/05/28 15:12] (actual) – [Referencias] kasandra | ||
|---|---|---|---|
| Línea 28: | Línea 28: | ||
| FIN | FIN | ||
| + | |||
| + | Las tablas toca definirlas | ||
| + | / | ||
| + | text | ||
| + | |||
| + | 10 etb | ||
| + | 20 tigo | ||
| + | |||
| ============================================================= | ============================================================= | ||
| < | < | ||
| - | #!/bin/sh# by skina##IP address of external interfaces. This is not the gateway address.IP1=192.168.69.10IP2=`ifconfig ppp0 | head -n 2 | tail -n 1 | cut -d: -f 2| awk ' | ||
| - | </ | ||
| - | |||
| - | ============================================================== | + | #!/bin/sh |
| + | # by skina | ||
| + | # | ||
| - | 15-Marzo-2006 J.E.Gomez v1.0 Primera version | + | DEV1=eth0 |
| + | DEV2=ppp0 | ||
| + | #IP address of external interfaces. This is not the gateway address. | ||
| + | IP1=192.168.69.10 | ||
| + | IP2=`ifconfig $DEV2 | head -n 2 | tail -n 1 | cut -d: -f 2| awk ' | ||
| - | ---- | + | #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 | ||
| - | __**Advertencia**__ | + | NET1=" |
| + | NET2=" | ||
| - | 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, | ||
| + | # 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 | ||
| + | |||
| + | ################### | ||
| + | |||
| + | 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 | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ============================================================== | ||
| + | |||
| + | ¿ | ||
| ---- | ---- | ||