Gateway [RESOLVIDO]

1. Gateway [RESOLVIDO]

Wilson SantoS
wilsonwjr

(usa Ubuntu)

Enviado em 17/01/2012 - 11:05h

Pessoal,

Bom dia!

Como faço para definir um gateway ?

Estou com o seguinte problema.... qdo ligo a maquina minha tabela de roteamento está assim:

Destination Gateway Genmask Flags Metric Ref Use Iface
200.220.xxx.x * 255.255.255.0 U 0 0 0 eth1
172.xx.xx.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 200.220.xxx.xxx 0.0.0.0 UG 0 0 0 eth1

porém preciso que fique assim:

Destination Gateway Genmask Flags Metric Ref Use Iface
200.220.xxx.x * 255.255.255.0 U 0 0 0 eth1
172.xx.xx.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 172.xx.xx.1 0.0.0.0 UG 0 0 0 eth0 (some qdo reinicio)
default 200.220.xxx.xxx 0.0.0.0 UG 0 0 0 eth1


o problema é que toda vez que reinicio perco a linha abaixo:
default 172.xx.xx.1 0.0.0.0 UG 0 0 0 eth0

Obrigado



  


2. MELHOR RESPOSTA

Reginaldo de Matias
saitam

(usa Slackware)

Enviado em 17/01/2012 - 13:35h

newrota.sh
#!/bin/bash
route add -net <ip> netmask 255.255.255.0 gw <ip-gw>

chmod +x newrota.sh
Debian e derivados colocar em /etc/init.d/newrota.sh

PS: Não esquecer de colocar o ip no lugar das tags <> Ok





3. Re: Gateway [RESOLVIDO]

Renato Carneiro Pacheco
renato_pacheco

(usa Debian)

Enviado em 17/01/2012 - 12:00h

É só colocar o comando d rota dentro d /etc/rc.local q ele será executado quando reiniciar o servidor.


4. Re: Gateway [RESOLVIDO]

Wilson SantoS
wilsonwjr

(usa Ubuntu)

Enviado em 17/01/2012 - 13:27h

cara sou iniciante ... pode me dizer com mais detalhes ..

vlw


5. Re: Gateway [RESOLVIDO]

Wilson SantoS
wilsonwjr

(usa Ubuntu)

Enviado em 17/01/2012 - 14:36h

Cara tem que fazer mais alguma coisa para funcionar.... ja ta na pasta /init.d

segue o conteudo do arquivo rotaw.sh

#!/bin/bash
route add -net 172.xx.x.x netmask 255.255.255.0 gw 172.xx.xx.x eth0




permissão do arquivo:

-rwxr-xr-x 1 root root 82 Jan 17 14:30 rotaw.sh




valeu


6. Re: Gateway [RESOLVIDO]

Wilson SantoS
wilsonwjr

(usa Ubuntu)

Enviado em 17/01/2012 - 17:32h

Valeu brother !!

ja esta funcionando



  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts