我使用带有OpenWRT的虚拟机在Linux机器(Slackware)上进行路由。我正在尝试将主机专用接口(eth0)配置为wan接口。eth1是以太网连接的桥接器接口。
我尝试测试连接到外部ip地址的配置(来自OpenWRT)。
# ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 0 packets received, 100% packet loss我使用了wireshark,我看到系统(OpenWRT侧)正在发送ARP请求,请求提供8.8.8.8的mac地址。怎么一回事?看来网关被忽略了。
我的路线:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.56.1 0.0.0.0 UG 1 0 0 eth0
default 192.168.56.1 0.0.0.0 UG 5 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.56.0 * 255.255.255.0 U 5 0 0 eth0Iptables被配置为接受所有用于输入、输出和转发的数据包。
更多测试:
# ping -I eth0 192.168.56.1
PING 192.168.56.1 (192.168.56.1): 56 data bytes
64 bytes from 192.168.56.1: seq=0 ttl=64 time=10.000 ms
64 bytes from 192.168.56.1: seq=1 ttl=64 time=0.000 ms
64 bytes from 192.168.56.1: seq=2 ttl=64 time=0.000 ms
64 bytes from 192.168.56.1: seq=3 ttl=64 time=0.000 ms
^C
--- 192.168.56.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.000/2.500/10.000 ms。
# ip route show
default via 192.168.56.1 dev eth0 proto static metric 1
default via 192.168.56.1 dev eth0 proto static metric 5
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
192.168.56.0/24 dev eth0 proto static scope link metric 5 发布于 2014-09-18 14:54:25
您可能将默认路由设置为设备,而不是网关IP。检查ip route show的默认行,没有“通过IP”部分。
编辑:对不起,我现在看到您的路由输出。但是,ip route show更有帮助,因为有些路由细节不能由路由命令显示。另外,奇怪的是,显然有两个默认的路由是相同的,希望ip会显示出这种区别。
发布于 2014-09-19 01:47:17
试图在虚拟机上重新安装OpenWRT,但没有解决问题。
在主机(路由和iptables)上进行了一些配置之后,问题消失了。我很难过,我找不出这个问题的确切原因。它看起来有一个循环(路由器再次接收到路由器发送的数据包),因为主机上的错误配置导致了问题。
如果这种情况再次发生,我会编辑这个答案,并得到更多的细节。
https://serverfault.com/questions/629561
复制相似问题