问题摘要 :来自client
的ping
不会转到rpi1
,它的ARP呼叫在srv
没有被应答。
host0
和tap0
由br0
桥接。 vpnin
和lan0
是两个独立的接口。 srv
(IP forwading已启用,并且在rpi1
与其他在此处不可见的接口之间有成功的通信,其中一个是通往Internet的网关) 详细信息 : client
自己( 10.20.1.2
), 10.20.1.254
和10.10.10.254
。 当试图ping 10.10.10.11
:
root@client:~# ping 10.10.10.11 PING 10.10.10.11 (10.10.10.11) 56(84) bytes of data. From 10.20.1.1: icmp_seq=2 Redirect Host(New nexthop: 10.10.10.11) From 10.20.1.1 icmp_seq=1 Destination Host Unreachable From 10.20.1.2 icmp_seq=3 Destination Host Unreachable From 10.20.1.2 icmp_seq=4 Destination Host Unreachable From 10.20.1.2 icmp_seq=5 Destination Host Unreachable
请注意10.20.1.1
和10.20.1.2
之间的From
的翻盖。
当在srv
上运行一个tcpdump
(ping能力丢失)时,我看到了ARP请求,但没有回复:
root@srv ~# tcpdump -i vpnin -nn 17:10:54.463072 ARP, Request who-has 10.10.10.11 tell 10.20.1.1, length 28 17:10:55.459489 ARP, Request who-has 10.10.10.11 tell 10.20.1.1, length 28 17:10:56.459459 ARP, Request who-has 10.10.10.11 tell 10.20.1.1, length 28 17:10:56.473683 ARP, Request who-has 10.10.10.11 tell 10.20.1.2, length 28 17:10:57.469788 ARP, Request who-has 10.10.10.11 tell 10.20.1.2, length 28 17:10:58.469608 ARP, Request who-has 10.10.10.11 tell 10.20.1.2, length 28
同样, 10.20.1.1
和10.20.1.2
要求回答。
srv
上的ARP表格确实有答案
root@srv ~# arp -a (...) rpi1.10.in-addr.arpa (10.10.10.11) at f4:f2:6d:09:35:1b [ether] on lan0
可能是什么原因
10.20.1.1
和10.20.1.2
之间的奇怪切换? 由于ARP请求是广播,ARP只能在同一个局域网(二层广播域)上工作。 广播不会跨越三层边界。 MAC地址是二层地址,它们只在同一个二层广播域中有意义,甚至可见。
希望将stream量发送到不同的三层networking的主机会将stream量发送到其configuration的网关的第二层地址,如有必要,使用ARP查找其configuration的网关的第二层地址。 然后,configuration的网关负责将stream量传送到到目的地的path上的下一跳。
如果需要将stream量路由到不同的networking,则需要将主机上的网关configuration为主机所在的三层networking的地址,即networking会见的点( srv
)。 为client
configuration的网关应该是10.20.1.254
,configuration的rp1
网关应该是10.10.10.254
。