我的网络上有一个 Web 管理交换机。它与我所在的主机 PC 一起连接到路由器。我无法通过路由器 ping 通它。
路由器是 Fedora 服务器。
路由器适用的接口有:
enp3s0 wan interface
enp4s0 with static IP 192.168.2.2/24
enp6s0 with static IP 10.2.4.1/24
路由器上的路由表有适用的条目:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.2 0.0.0.0 UG 100 0 0 enp4s0
0.0.0.0 10.2.4.1 0.0.0.0 UG 103 0 0 enp6s0
10.2.4.0 0.0.0.0 255.255.255.0 U 103 0 0 enp6s0
192.168.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp4s0
主机通过以下 IP 直接连接到这些接口:
IP MAC attached if
switch 192.168.2.1 (static) 60:be:b4:13:28:e1 enp4s0
pc 10.2.4.5 (dhcp) 1c:2a:a3:1e:74:df enp6s0
当我从主机 ping 时,会出现超时。因此,我从 enp4s0 上的路由器运行了 tcpdump
sudo tcpdump -i enp4s0 -n
16:18:06.345052 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 430, length 64
16:18:07.334961 ARP, Request who-has 192.168.2.2 tell 192.168.2.2, length 28
16:18:07.369062 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 431, length 64
16:18:08.361151 ARP, Request who-has 192.168.2.2 tell 192.168.2.2, length 28
16:18:08.393080 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 432, length 64
16:18:09.385150 ARP, Request who-has 192.168.2.2 tell 192.168.2.2, length 28
16:18:09.417072 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 433, length 64
[ ... ]
16:18:17.609124 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 441, length 64
16:18:18.601152 ARP, Request who-has 192.168.2.1 tell 192.168.2.2, length 28
16:18:18.601366 ARP, Reply 192.168.2.1 is-at 1c:2a:a3:1e:74:df, length 46
16:18:18.633088 IP 10.2.4.5 > 192.168.2.1: ICMP echo request, id 48, seq 442, length 64
可辨别的事实:
- 数据包沿着路由器的 nftables 正向链从 enp6s0 传输到 enp4s0
- 然后交换机询问谁拥有网关 192.168.2.2。但它没有得到任何回应。
- 路由器随后询问谁拥有 192.168.2.1。交换机以其 mac 进行响应。
- 路由器的arp表记录了它。
- 交换机仍然不知道谁拥有 192.168.2.2
路由器适用的 arp 条目
Address HWtype HWaddress Flags Mask Iface
192.168.2.1 ether 1c:2a:a3:1e:74:df C enp4s0
10.2.4.5 ether 04:7c:16:4d:0a:84 C enp6s0
交换机没有响应 ping,而且,也没有响应我管理它的网络请求。当我从浏览器发送网络请求时,我立即收到一堆“请求谁拥有 192.168.2.2”,这表明 http 请求已到达交换机并且知道回复该 IP,但它仍然不知道谁拥有该 IP。它一直在询问。
这里是主机pc适用的arp表条目,显示路由器响应了PC的arp请求,那么为什么不响应交换机呢?
Address HWtype HWaddress Flags Mask Iface
10.2.4.1 ether 60:be:b4:13:28:e3 C enp12s0
这是唯一的 192.168。网络。所有其他接口都以 10 开头。
什么原因导致路由器不回复交换机的 arp 请求,以便我最终可以 ping 并管理它。