-
Com a modificações que fiz veja como ficou:
[root@srvteste scripts]# ip route show table link1
default via 192.168.0.1 dev eth0
[root@srvteste scripts]#
[root@srvteste scripts]# ip route show table link2
default via 192.168.1.1 dev eth1
[root@srvteste scripts]#
A rotas da tabela main é necessario exclui-las? (caso positivo como faço isso)
[root@srvteste scripts]# ip route show table main
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
]192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.31
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.31
169.254.0.0/16 dev eth1 scope link
[root@srvteste scripts]# ]
Apos tirar as rotas default da tabela main consigo pingar os dois gateway. mas não consigo pingar p fora, me retorna como se não existisse rota veja ai:
[root@srvteste scripts]# ping www.terra.com.br
ping: unknown host www.terra.com.br
[root@srvteste scripts]#
Agradeço desde ja.
WASLEY
-
Não precisa excluir as rotas da tabela main.
Quanto ao erro, isso é erro de DNS.. Tenta pingar pelo IP: 64.233.163.104 (esse é do google)
-
Ola Magnu
Eu creio que esse erro não seja do DNS, quando habilito uma rota default na tabela main consigo pingar o site terra e o endereço ip do google. veja os teste abaixo:
[root@srvteste scripts]# ip route add default dev eth0 via 192.168.0.1
[root@srvteste scripts]# ip route show table main
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.31
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.31
169.254.0.0/16 dev eth2 scope link
default via 192.168.0.1 dev eth0
[root@srvteste scripts]# ping www.terra.com.br
PING www.terra.com.br (200.154.56.80) 56(84) bytes of data.
64 bytes from www.terra.com.br (200.154.56.80): icmp_seq=1 ttl=247 time=37.4 ms
[root@srvteste scripts]# ping 64.233.163.104
PING 64.233.163.104 (64.233.163.104) 56(84) bytes of data.
64 bytes from 64.233.163.104: icmp_seq=1 ttl=55 time=29.0 ms
E quando não tenho rota default na tabela main, nem pelo endereço ip consigo pingar.
sem rota default
[root@srvteste scripts]# ip route show table main
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.31
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.31
169.254.0.0/16 dev eth2 scope link
[root@srvteste scripts]#
[root@srvteste scripts]# ping 64.233.163.104
connect: Network is unreachable
[root@srvteste scripts]#
[root@srvteste scripts]# ping www.terra.com.br
ping: unknown host www.terra.com.br
[root@srvteste scripts]#
-
Ele não estava pingando pq ele não resolveu o nome terra, olha a mensagem: "unknown host"
Ele não resolveu pq ele não tinha o gateway. Você tem que manter esse gateway, eu me enganei, como o ping é gerado localmente ele não passa pela regra de MARK do iptables.
-
Ok Magun,
Deixa eu ver se entendi, então as rotas tem de ficar assim:
Tabela Main
[root@srvteste scripts]# ip route show table main
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.31
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.31
169.254.0.0/16 dev eth2 scope link
default via 192.168.0.1 dev eth0
default via 192.168.1.1 dev eth1 metric 100
[root@srvteste scripts]#
Tabela Link1
[root@srvteste scripts]# ip route show table link1
default via 192.168.0.1 dev eth0
[root@srvteste scripts]#
Tabela link2
[root@srvteste scripts]# ip route show table link2
default via 192.168.1.1 dev eth1
[root@srvteste scripts]#