[GTER] Failover de link ADSL

silvio.cesar at unigranrio.edu.br silvio.cesar at unigranrio.edu.br
Tue Mar 24 11:36:49 -03 2009


Bom dia,

Criei um script chamado balanceamento.sh que serve para manipular o
balanceamento de carga para N links.

Dêem uma olhada pois vai facilitar a vida um bocado.

http://gulbf.com.br/?q=node/145

Att,

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


Marcus Andree escreveu:
> Tenho minhas duvidas quanto ao dhclient, mas o dhcpcd eu sei que faz isso.
> 
> Nao ha necessidade de "micro-daemon". Tirei as linhas abaixo de um man page
> do dhcpcd disponivel na internet.
> 
> Basta criar um script que tenha a inteligencia para ler o arquivo
> <HostInfoFilePath>
> e aceite as opcoes <up|down|new>, passadas via linha de comando.
> 
> Opcionalmente, pode-se utilizar a chave "-d" para ativar linhas
> (printf ou echo) de
> depuracao.
> 
> 
> -c <ExecFilePath>
>     dhcpcd will try to execute <ExecFilePath> script instead of
> default <ConfigDir>/dhcpcd.exe script every time it configures or
> brings down the interface. See the description of dhcpcd.exe script in
> FILES section below.
> 
> /etc/dhcpc
>     Default <ConfigDir> directory used for storing files created by
> dhcpcd. See option -L <ConfigDir> above.
> <ConfigDir>/dhcpcd-<interface>.info
>     file in which dhcpcd saves the host information. The word
> <interface> is actually replaced with the network interface name like
> eth0 to which dhcpcd is attached.
> <ConfigDir>/dhcpcd.exe
>     file, which dhcpcd will try to execute whenever it configures or
> brings down the interface. The path to this executable script can be
> changed with -c <ExecFilePath> option. Dhcpcd passes 3 parameters to
> dhcpcd.exe script:
>     dhcpcd.exe <HostInfoFilePath> <up|down|new> [-d]
>     The first parameter <HostInfoFilePath> is path to
> dhcpcd-<interface>.info file. The word <interface> is actually
> replaced with interface name dhcpcd is attached to, e.g. "eth0". The
> second parameter values <up|down|new> mean the interface has been
> brought up with the same IP address as before ("up"), or with the new
> IP address ("new"), or the interface has been brought down ("down").
> Parameter -d is passed in a case dhcpcd has been started with -d debug
> flag.
> 
> 2009/3/23 Leonardo Amaral <leleobhz at leleobhz.org>:
>> Estou convicto de que, já que o dhcpd/dhclient podem receber scripts de fora
>> quando mudam de estado. Posso escrever um micro-daemon pra detectar quando a
>> rede caiu e quando cair dou ifup e ifdown nas interfaces e nisso o dhclient
>> puxa automaticamente as novas rotas e adiciona como next-hop. O que gostaria
>> de perguntar é se tem alguma documentação sobre a forma de funcionamento
>> desses scripts do DHClient/dhcpd.
>>
>> Marcus Andree escreveu:
>>> Leonardo,
>>>
>>> Em vez de utilizar o dhclient, use o dhcpcd. Ele pode ser configurado
>>> para executar um shell script quando starta/stopa/configura/reconfigura o
>>> IP da
>>> placa de rede.
>>>
>>>
>>> 2009/3/20 Leonardo Amaral <leleobhz at leleobhz.org>:
>>>
>>>> Certo. Outro problema: O IP dos 2 são dinamicos (nem dinamicamente
>>>> fixados
>>>> eles são). Ou seja, provavelmente no timeout do lease do DHCP eu vou
>>>> levar
>>>> outro IP diferente. Como eu posso tratar isso?
>>>>
>>>> Bruno at openline.com.br escreveu:
>>>>
>>>>> --- Leonardo Amaral <leleobhz at leleobhz.org> escreveu:
>>>>>
>>>>>
>>>>>> O problema é adivinhar a rota que a empresa deu. Cada vez vem uma
>>>>>> diferente....
>>>>>>
>>>>>>
>>>>> #!/bin/bash
>>>>> set ` netstat -rn|egrep ^0.0.0.0|grep ethX `
>>>>> echo Rota default = $2
>>>>>
>>>>> []s, !3runo
>>>>>
>>>>>
>>>>>
>>>>>> Alexandro Corrêa - SulSoft escreveu:
>>>>>>
>>>>>>
>>>>>>> Sobre essa questão de rotas criadas pelo DHCLIENT, depois de adquirir
>>>>>>> o IP eu costumo rodar um script que remove todas as rotas e cria
>>>>>>> novamente conforme minhas necessidades.
>>>>>>> Tem funcionado bem até o momento...
>>>>>>>
>>>>>>> Atenciosamente,
>>>>>>>
>>>>>>>   Alexandro Corrêa
>>>>>>>
>>>> --
>>>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>>>
>>>>
>>> --
>>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>>
>>
>> --
>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>
> --
> gter list    https://eng.registro.br/mailman/listinfo/gter



More information about the gter mailing list