Não consigo pingar para um IP do container docker local no servidor A do servidor B criando uma rota estática

0

Estou tentando criar uma rota estática entre dois servidores, servidor A e servidor B, Eu criei a rota estática do servidor B para o servidor A para que eu pudesse fazer ping para um contêiner docker no servidor A.

Detalhes do servidor A:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP qlen 1000
    link/ether 06:4e:7a:ff:c5:b8 brd ff:ff:ff:ff:ff:ff
    inet 172.31.124.249/20 brd 172.31.127.255 scope global dynamic eth0
       valid_lft 2327sec preferred_lft 2327sec
    inet6 fe80::44e:7aff:feff:c5b8/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:7b:af:4d:e5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever

Detalhes do Servidor B:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP qlen 1000
    link/ether 06:35:26:6c:2d:02 brd ff:ff:ff:ff:ff:ff
    inet 172.31.126.46/20 brd 172.31.127.255 scope global dynamic eth0
       valid_lft 2729sec preferred_lft 2729sec
    inet6 fe80::435:26ff:fe6c:2d02/64 scope link 
       valid_lft forever preferred_lft forever

O que eu fiz?

Eu criei essa rota ip estática no servidor B com:

sudo ip route add 172.17.0.0/24 via 172.31.124.249 dev eth0

Depois desse comando, a tabela de roteamento é a seguinte:

ip route show
default via 172.31.112.1 dev eth0 
172.17.0.0/24 via 172.31.124.249 dev eth0 
172.31.112.0/20 dev eth0  proto kernel  scope link  src 172.31.126.46

Quando tento pingar o contêiner docker no servidor A do servidor B, não obtenho nenhuma resposta:

 ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.
^C
--- 172.17.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms

Alguma idéia de por que isso está acontecendo?

    
por VaTo 08.06.2017 / 02:31

0 respostas