[MASOCH-L] Pedido de contribuição - IPRoute2Web

silvio.cesar at unigranrio.edu.br silvio.cesar at unigranrio.edu.br
Tue Oct 23 10:33:31 BRST 2007


Bom dia a todos,

Estou montando uma web console para configurar o IPRoute2 de forma a
facilitar a vida da moçada.

A idéia é o software gerar regras para balancear até 4 links(por enquanto)

Vejam a regra gerada baixo e visitem o site para dar uma olhada na
console no endereço: http://www.gulbf.com.br/files/iproute2web.php
clicando no "Abrir regra" ele carrega as regras gravadas e depois em
"Ver regras" para visualizar as regras de loadbalance.

Poderiam validar o conjunto de regras, pois ele não está balanceando
pacotes roteados FORWARD, apenas que saem do gateway(OUTPUT) são
balanceados ?

#!/bin/sh
#******************* IPROUTE2WEB *************************
#*                                                       *
#* Generated with IpRoute2Web                            *
#* Author: Silvio Cesar                                  *
#* This is a GPL licensed program                        *
#*                                                       *
#*********************************************************

echo 255 local > /etc/iproute2/rt_tables
echo 254 main >> /etc/iproute2/rt_tables
echo 253 default >> /etc/iproute2/rt_tables
echo 0 unspec >> /etc/iproute2/rt_tables
#
echo 10 adsl1 >> /etc/iproute2/rt_tables
ip route flush table adsl1
echo 11 adsl2 >> /etc/iproute2/rt_tables
ip route flush table adsl2
#
#
#Link 1
ip route add 192.168.1.0/24 dev eth1 src 192.168.1.2 table adsl1
ip route add default via 192.168.1.1 table adsl1
ip rule add from 192.168.1.2 table adsl1
ip rule add fwmark 0x1 lookup adsl1 prio 3
#
#Link 2
ip route add 192.168.2.0/24 dev eth3 src 192.168.2.2 table adsl2
ip route add default via 192.168.2.1 table adsl2
ip rule add from 192.168.2.2 table adsl2
ip rule add fwmark 0x2 lookup adsl2 prio 3
#
# Setting loadbalance
ip route add default  nexthop via 192.168.1.1 dev eth1 weight 1 nexthop
via 192.168.2.1 dev eth3 weight 1
#
# Flushing route cache
ip route flush cache

-- 
Att,

Silvio Cesar L. dos Santos
Analista de Redes Pleno
DTI - Divisão de Tecnologia da Informação
UNIGRANRIO - Universidade do Grande Rio
+55 21 2672-7720
silviocesar at unigranrio.edu.br
http://www.unigranrio.edu.br


More information about the masoch-l mailing list