我遇到这样一种情况:我可以 ping/ssh 到与服务器(S)位于同一子网的其他计算机(B/C),但无法 ping 或 ssh 到 S。
B和C都能够正常连接到s1,也能够正常连接到A。
我一直在研究原因,我怀疑路由表存在问题
在 B 和 C 上(有效)
$ ip route
default via 128.218.162.1 dev enx000acd295212 proto dhcp metric 100
128.218.162.0/24 dev enx000acd295212 proto kernel scope link src 128.218.162.132 metric 100
169.254.0.0/16 dev enx000acd295212 scope link metric 1000
$ ip addr show dev enx000acd295212
8: enx000acd295212: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0a:cd:29:52:12 brd ff:ff:ff:ff:ff:ff
inet 128.218.162.132/24 brd 128.218.162.255 scope global dynamic noprefixroute enx000acd295212
valid_lft 587218sec preferred_lft 587218sec
inet6 fe80::b8e3:8728:9e1d:a695/64 scope link noprefixroute
valid_lft forever preferred_lft forever
在 cA 上(已损坏)
$ ip route
default via 128.218.162.1 dev eth0 metric 100
128.218.162.0/24 dev eth0 proto kernel scope link src 128.218.162.41
169.254.0.0/16 dev eth0 scope link metric 1000
$ ip addr show eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:24:9b:29:dd:ea brd ff:ff:ff:ff:ff:ff
inet 128.218.162.41/24 brd 128.218.162.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::224:9bff:fe29:ddea/64 scope link
valid_lft forever preferred_lft forever
S1 在 128.218.162.39 上
从 A 向 S1 发出 ping 操作,并由 A 的 IP 返回
$ ping 128.218.162.39
PING 128.218.162.39 (128.218.162.39) 56(84) bytes of data.
From 128.218.162.41 icmp_seq=1 Destination Host Unreachable
From 128.218.162.41 icmp_seq=2 Destination Host Unreachable
From 128.218.162.41 icmp_seq=3 Destination Host Unreachable
任何想法都将不胜感激!