Comutação de rotas

1. Comutação de rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 12/05/2011 - 14:27h

Pessoal tudo bem com vocês?
estou começando com PHP e queria saber como eu posso fazer uma pagina para mudança de rotas no Linux,
por exemplo, tenho um roteador (Linux) com 4 faixas de IPS 172.19.7.0 - 172.19.11.0 - 172.19.10.0 - 172.19.9.0 - eo GW 172.19.7.1 no caso esse arquivo de PHP deve mudar todas as rotas e o GW desse roteador,
tudo via navegador, alguem pode me da um help?/

vlw



  


2. Re: Comutação de rotas

Eriton Almeida
eritonalmeida

(usa Debian)

Enviado em 12/05/2011 - 15:04h

sei como fazer, mas preciso de mais detalhes de como vc quer isso?


3. Comutação de rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 12/05/2011 - 15:13h

Opa,
eu tenho esses ips e rotas

eth0 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.7.1 Bcast:172.19.7.255 Mask:255.255.255.0
inet6 addr: fe80::21c:c0ff:fecd:7d11/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3018917041 errors:0 dropped:0 overruns:0 frame:0
TX packets:3031840066 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:499714994 (499.7 MB) TX bytes:1636739169 (1.6 GB)
Interrupt:43 Base address:0xc000

eth0:0 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:10.1.1.1 Bcast:10.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:1 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:192.168.8.226 Bcast:192.168.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:2 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.10.1 Bcast:172.19.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:3 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.11.1 Bcast:172.19.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:4 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:192.168.9.13 Bcast:192.168.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:5 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.7.141 Bcast:172.19.7.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:6 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.9.1 Bcast:172.19.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

eth0:7 Link encap:Ethernet HWaddr 00:1c:c0:cd:7d:11
inet addr:172.19.8.1 Bcast:172.19.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:43 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:61 (61.0 B) TX bytes:61 (61.0 B)

Rotas

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 192.168.9.10 255.255.255.0 UG 0 0 0 eth0
172.19.10.0 * 255.255.255.0 U 0 0 0 eth0
192.168.80.0 192.168.9.10 255.255.255.0 UG 0 0 0 eth0
192.168.2.0 192.168.9.10 255.255.255.0 UG 0 0 0 eth0
172.19.11.0 * 255.255.255.0 U 0 0 0 eth0
172.19.11.0 * 255.255.255.0 U 0 0 0 eth0
172.19.8.0 * 255.255.255.0 U 0 0 0 eth0
172.19.9.0 * 255.255.255.0 U 0 0 0 eth0
10.131.103.0 192.168.9.10 255.255.255.0 UG 0 0 0 eth0
localnet * 255.255.255.0 U 0 0 0 eth0
10.131.1.0 192.168.9.10 255.255.255.0 UG 0 0 0 eth0
192.168.10.0 172.19.10.254 255.255.255.0 UG 0 0 0 eth0
10.1.1.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 eth0
192.168.8.0 * 255.255.255.0 U 0 0 0 eth0
192.168.8.0 * 255.255.255.0 U 0 0 0 eth0
default 172.19.7.134 0.0.0.0 UG 100 0 0 eth0

No caso mudaria esse rota Default para 172.19.10.254 e os rotas do ips para 172.19.11.254, 172.19.7.254 e assim vai,
isso tudo via navegador, blz

obrigado pela ajuda!


4. Re: Comutação de rotas

Eriton Almeida
eritonalmeida

(usa Debian)

Enviado em 12/05/2011 - 15:21h

vc sabe fazer isso na linha de comando?

posta seu /etc/network/interfaces


5. Comutação de rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 12/05/2011 - 15:30h

Para deletar as rotas seria, por exemplo a rota 172.19.11.0 do gw 172.19.11.1
route del -net 172.19.11.0/24 gw 172.19.11.1 - deleta a rota default da rede 172.19.11.0 do gw 11.1

route add -net 172.19.11.0/24 gw 172.19.11.254 - adiciona a rota default da rede 172.19.11.0 p gw 172.19.11.254


6. Comutação de rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 12/05/2011 - 15:31h

arquivo interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0 eth0:0 eth0:1 eth0:2 eth0:4 eth0:5 eth0:3
iface lo inet loopback

# The primary network interface
iface eth0 inet static
address 172.19.7.1
netmask 255.255.255.0
network 172.19.7.0
broadcast 172.19.7.255
dns-nameservers 172.19.10.3
dns-search grupometropolitan.com.br
gateway 172.19.7.134
up ip route add 192.168.8.0/24 dev eth0
up ip route add 172.19.11.0/24 dev eth0
up ip route add 192.168.9.0/24 dev eth0
# dns-* options are implemented by the resolvconf package, if installed

iface eth0:0 inet static
address 10.1.1.1
netmask 255.255.255.0
broadcast 10.1.1.255
network 10.1.1.0
up ip route add 10.1.1.0/24 via 10.1.1.9

iface eth0:1 inet static
address 192.168.8.226
netmask 255.255.255.0
broadcast 192.168.8.255
network 192.168.8.0

iface eth0:2 inet static
address 172.19.10.1
netmask 255.255.255.0
broadcast 172.19.10.255
network 172.19.10.0


iface eth0:4 inet static
address 192.168.9.13
netmask 255.255.255.0
broadcast 192.168.9.255
network 192.168.9.0
up ip route add 192.168.3.0/24 via 192.168.9.10
up ip route add 192.168.2.0/24 via 192.168.9.10
up ip route add 192.168.80.0/24 via 192.168.9.10
up ip route add 10.131.103.0/24 via 192.168.9.10
up ip route add 10.131.1.0/24 via 192.168.9.10
up ip route add 192.168.10.0/24 via 172.19.10.254

iface eth0:5 inet static
address 172.19.7.141
netmask 255.255.255.0
broadcast 172.19.7.255
network 172.19.7.0


iface eth0:3 inet static
address 172.19.11.1
netmask 255.255.255.0
broadcast 172.19.11.255
network 172.19.11.0

iface eth0:6 inet static
address 172.19.9.1
netmask 255.255.255.0
broadcast 172.19.9.255
network 172.19.9.0

iface eth0:7 inet static
address 172.19.8.1
netmask 255.255.255.0
broadcast 172.19.8.255



7. Re: Comutação de rotas

Eriton Almeida
eritonalmeida

(usa Debian)

Enviado em 12/05/2011 - 16:02h

to começando entender. vc quer tipo um fomulário para escolher as interfaces e as rotas?


8. Comutação de rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 12/05/2011 - 16:17h

Isso mesmo,
mas no caso como eu queria fazer uma contingencia,
quando um link tiver down eu fugi por outros roteadores com outras rotas
eu queria mudar tudo de uma vez só,
mas se no caso for uma rota de cada vez por mim tudo bem ok

vlw!


9. Re: Comutação de rotas

Eriton Almeida
eritonalmeida

(usa Debian)

Enviado em 13/05/2011 - 11:48h

seria bom vc criar o formulário do jeito que vc precisa, depois eu te ajudo com o código para fazer as alterações.


10. Rotas

Perfil removido
removido

(usa Nenhuma)

Enviado em 26/10/2011 - 16:32h

Pessoal,

não teria nada na net que faça isso de forma mais tranquila?

vlw



  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts