두 대의 Ubuntu 시스템이 있는데 서로 통신할 수 없습니다.
그들은 서로 옆에 있고 동일한 스위치에 연결되어 있습니다. 그들은 모두 고정 IP 주소와 동일한 게이트웨이를 가지고 있습니다. 내 노트북(완전히 다른 네트워크에 있음)에서 성공적으로 ping을 수행하고 ssh 및 mosh를 통해 연결할 수 있습니다. 둘 다 google.com과 같은 외부 주소로 ping을 수행할 수 있고, 둘 다에서 서로 다른 네트워크의 리소스로 SSH를 통해 연결할 수 있습니다.
서로 ping하거나 SSH를 통해 서로 연결할 수 없습니다. 외부에서 연결할 수는 있지만 서로 대화할 수 없는 문제가 무엇인지 모르겠습니다.
내가 알아낸 유일한 도움이 될 수 있는 점은 오류가 대칭이 아니라는 것입니다.
HOST1$ ping HOST2
PING HOST2 (47.51.66.227): 56 data bytes
^C
--- 47.51.66.227 ping statistics ---
18 packets transmitted, 0 packets received, 100% packet loss
그리고
HOST2$ ping HOST1
PING HOST1 (47.51.66.226) 56(84) bytes of data.
From 47.51.66.226 icmp_seq=1 Destination Host Unreachable
SSH의 경우:
HOST1$ ssh HOST2
ssh: connect to host 47.51.66.227 port 22: Network is unreachable
그리고
HOST2$ ssh HOST1
ssh: connect to host 47.51.66.226 port 22: No route to host
이들 머신의 역사를 고려하면 HOST2 어딘가에 이상한 구성 파일이 있을 가능성이 가장 높지만 제가 확인한 모든 것이 꽤 표준적인 것처럼 보이기 때문에 어디서 찾을 수 있는지 잘 모르겠습니다. 유용한 특정 정보를 보거나 게시하는 것이 좋을 것입니다.
문제를 해결하는 방법이나 문제를 더 잘 진단하는 방법에 대한 아이디어를 주시면 대단히 감사하겠습니다!
Hauke Laging이 요청한 정보를 포함하도록 편집되었습니다.
Host 1$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 34:73:5a:fb:23:d6 brd ff:ff:ff:ff:ff:ff
altname enp4s0f0
altname ens1f0
inet 47.51.66.226/30 brd 47.51.66.227 scope global noprefixroute eno1
valid_lft forever preferred_lft forever
inet6 2600:6c84:a900:2b2:2543:4ae5:dbb9:a80/64 scope global temporary dynamic
valid_lft 503165sec preferred_lft 1931sec
inet6 2600:6c84:a900:2b2:2f52:1e5a:3f1d:d294/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 503165sec preferred_lft 503165sec
inet6 fe80::1388:32c3:447:42aa/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 34:73:5a:fb:23:d7 brd ff:ff:ff:ff:ff:ff
altname enp4s0f1
altname ens1f1
4: wls5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 14:ab:c5:36:cc:fc brd ff:ff:ff:ff:ff:ff
altname wlp95s0
inet 10.42.0.1/24 brd 10.42.0.255 scope global noprefixroute wls5
valid_lft forever preferred_lft forever
inet6 fe80::da3a:9417:a11e:7f55/64 scope link noprefixroute
valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:6c:fc:16:1b brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
6: br-38ee0842186e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:13:73:72:29 brd ff:ff:ff:ff:ff:ff
inet 172.28.0.1/16 brd 172.28.255.255 scope global br-38ee0842186e
valid_lft forever preferred_lft forever
inet6 fe80::42:13ff:fe73:7229/64 scope link
valid_lft forever preferred_lft forever
7: br-64faac681e43: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:c5:9f:0c:e7 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 brd 172.18.255.255 scope global br-64faac681e43
valid_lft forever preferred_lft forever
inet6 fe80::42:c5ff:fe9f:ce7/64 scope link
valid_lft forever preferred_lft forever
9: vethebf8f2e@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-64faac681e43 state UP group default
link/ether 2a:74:2a:49:43:17 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::2874:2aff:fe49:4317/64 scope link
valid_lft forever preferred_lft forever
11: veth434243b@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-38ee0842186e state UP group default
link/ether d6:80:53:c8:97:ab brd ff:ff:ff:ff:ff:ff link-netnsid 5
inet6 fe80::d480:53ff:fec8:97ab/64 scope link
valid_lft forever preferred_lft forever
13: veth5605dd7@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-64faac681e43 state UP group default
link/ether 1e:32:e1:fa:b7:14 brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::1c32:e1ff:fefa:b714/64 scope link
valid_lft forever preferred_lft forever
15: vethef9eeac@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-38ee0842186e state UP group default
link/ether 7a:a7:d2:2c:9b:a7 brd ff:ff:ff:ff:ff:ff link-netnsid 4
inet6 fe80::78a7:d2ff:fe2c:9ba7/64 scope link
valid_lft forever preferred_lft forever
17: veth2a8d36c@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-64faac681e43 state UP group default
link/ether f6:f5:27:c6:8e:fc brd ff:ff:ff:ff:ff:ff link-netnsid 3
inet6 fe80::f4f5:27ff:fec6:8efc/64 scope link
valid_lft forever preferred_lft forever
19: vetha420f5d@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-64faac681e43 state UP group default
link/ether f2:3b:25:fe:6f:eb brd ff:ff:ff:ff:ff:ff link-netnsid 2
inet6 fe80::f03b:25ff:fefe:6feb/64 scope link
valid_lft forever preferred_lft forever
21: vethd040ed9@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-64faac681e43 state UP group default
link/ether 06:d3:36:4f:ce:80 brd ff:ff:ff:ff:ff:ff link-netnsid 6
inet6 fe80::4d3:36ff:fe4f:ce80/64 scope link
valid_lft forever preferred_lft forever
HOST1$ ip r
default via 47.51.66.225 dev eno1 proto static metric 100
10.42.0.0/24 dev wls5 proto kernel scope link src 10.42.0.1 metric 600
47.51.66.224/30 dev eno1 proto kernel scope link src 47.51.66.226 metric 100
169.254.0.0/16 dev eno1 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev br-64faac681e43 proto kernel scope link src 172.18.0.1
172.28.0.0/16 dev br-38ee0842186e proto kernel scope link src 172.28.0.1
HOST1$ ip neigh
10.42.0.176 dev wls5 lladdr d6:63:88:2f:99:18 STALE
172.28.0.2 dev br-38ee0842186e lladdr 02:42:ac:1c:00:02 STALE
10.42.0.36 dev wls5 FAILED
10.42.0.218 dev wls5 FAILED
172.18.0.4 dev br-64faac681e43 lladdr 02:42:ac:12:00:04 REACHABLE
47.51.66.225 dev eno1 lladdr 94:91:7f:3a:38:94 REACHABLE
192.168.1.1 dev eno1 lladdr 94:91:7f:3a:38:94 STALE
fe80::3eec:efff:feb9:caf8 dev eno1 lladdr 3c:ec:ef:b9:ca:f8 STALE
fe80::11:bb4e:5b23:413a dev wls5 lladdr bc:d0:74:3e:36:bc STALE
fe80::4e4:a9eb:9de8:6dd6 dev wls5 FAILED
fe80::9691:7fff:fe3a:3894 dev eno1 lladdr 94:91:7f:3a:38:94 router REACHABLE
fe80::cdf:8bd3:10de:fedf dev wls5 lladdr d6:63:88:2f:99:18 STALE
HOST1$ ss -tln sport = 22
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
HOST2$ 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 3c:ec:ef:b9:ca:f8 brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 3c:ec:ef:b9:ca:f9 brd ff:ff:ff:ff:ff:ff
inet 47.51.66.227/29 brd 47.51.66.231 scope global noprefixroute eno2
valid_lft forever preferred_lft forever
inet6 2600:6c84:a900:2b2::c68/128 scope global dynamic noprefixroute
valid_lft 2722sec preferred_lft 2722sec
inet6 2600:6c84:a900:2b2:54ac:eb83:5377:6d24/64 scope global temporary dynamic
valid_lft 502863sec preferred_lft 5964sec
inet6 2600:6c84:a900:2b2:af96:2c2f:4825:ef3f/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 502863sec preferred_lft 502863sec
inet6 fe80::343e:b7c0:7c32:d7a6/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 9a:60:86:38:17:cd brd ff:ff:ff:ff:ff:ff
inet 47.51.66.227/30 brd 47.51.66.227 scope global noprefixroute usb0
valid_lft forever preferred_lft forever
inet6 fe80::2ab8:a2b3:13eb:5d2/64 scope link noprefixroute
valid_lft forever preferred_lft forever
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:b3:fe:76:9d brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:b3ff:fefe:769d/64 scope link
valid_lft forever preferred_lft forever
7: veth5f11aad@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether 42:67:78:26:bc:e4 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::4067:78ff:fe26:bce4/64 scope link
valid_lft forever preferred_lft forever
HOST2$ ip r
default via 47.51.66.225 dev eno2 proto static metric 101
default via 47.51.66.225 dev usb0 proto static metric 20100
47.51.66.224/30 dev usb0 proto kernel scope link src 47.51.66.227 metric 100
47.51.66.224/29 dev eno2 proto kernel scope link src 47.51.66.227 metric 101
169.254.0.0/16 dev usb0 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
HOST2$ ip neigh
47.51.66.228 dev eno2 FAILED
47.51.66.225 dev eno2 lladdr 94:91:7f:3a:38:94 REACHABLE
47.51.66.226 dev usb0 FAILED
192.168.1.1 dev eno2 lladdr 94:91:7f:3a:38:94 STALE
47.51.66.225 dev usb0 FAILED
172.17.0.2 dev docker0 lladdr 02:42:ac:11:00:02 STALE
fe80::9691:7fff:fe3a:3894 dev eno2 lladdr 94:91:7f:3a:38:94 router STALE
이 줄은 47.51.66.226 dev usb0 FAILED
HOST1의 주소이므로 의심스러워 보이지만 머신에 대한 USB 이더넷 연결이 없으므로 eno2만 활성화되어야 합니다.
HOST2$ ss -tln sport = 22
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
답변1
주목할 만한 두 가지 점이 있습니다.
- 호스트 1에서는 eno1을 사용하고 호스트 2에서는 eno2를 사용합니다. 이더넷 케이블을 각 호스트의 올바른 포트에 연결했는지 확인하십시오.
- Host1에서는
47.51.66.226/30
Broadcast를 사용하고 있지만47.51.66.227
, Host2에서는47.51.66.227/29
Broadcast를 사용하고 있습니다47.51.66.231
. 서브넷이 다르기 때문에 작동하지 않습니다.
이것은 플러그이므로 더 이상 코멘트가 없습니다.