두 서버(서버 A와 서버 B) 사이에 정적 경로를 생성하려고 합니다. 서버 A의 Docker 컨테이너로 핑을 보낼 수 있도록 서버 B에서 서버 A로의 정적 경로를 생성했습니다.
서버 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
서버 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
내가 뭘 한거지?
서버 B에 고정 IP 경로를 만들었습니다.
sudo ip route add 172.17.0.0/24 via 172.31.124.249 dev eth0
이 명령 이후의 라우팅 테이블은 다음과 같습니다.
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
서버 BI에서 서버 A의 Docker 컨테이너를 ping하려고 하면 어떤 응답도 받지 못합니다.
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
왜 이런 일이 발생하는지에 대한 아이디어가 있습니까?