当我直接将设备(即没有交换机,只是一根跳线)直接连接到一个接口而另一个设备直接连接到另一个设备时,如下所示,那么路由器可以正常工作.
DEVICE1192.168.8.11 ------- 192.168.8.254 ROUTER 10.58.129.254 ------- DEVICE2 10.58.129.1
当我连接路由器与我们之间的交换机,然后路由器不起作用.
DEVICE1192.168.8.11 ----------- switch1 | switch2 | switch3 | 192.168.8.254 ROUTER 10.58.129.254 -------- switch3 | DEVICE2 10.58.129.1
所有交换机都是第3层,Switch1(Dell PowerConnect 3548P)与Switch2(Dell PowerConnect 6224F)有光纤连接,这是我们的核心交换机,可处理大多数VLAN之间的路由.它通过光纤连接到Switch3(Dell PowerConnect 6224).
核心交换机上的路由未启用两个VLAN(192.168.8.11或10.58.129.254)中的任何一个.原因是我们的核心交换机不支持基于策略的路由,因此这个linux机箱背后的原因是在这些VLAN上执行路由.
通过交换机连接路由器,从Device1,我可以Ping linux路由器上的接口192.168.8.254,但不能Ping其他接口(10.58.129.254).
Switch2配置/诊断
switch2#show ip routeRoute Codes: R - RIP Derived,O - OSPF Derived,C - Connected,S - Static B - BGP Derived,IA - OSPF Inter Area E1 - OSPF External Type 1,E2 - OSPF External Type 2 N1 - OSPF NSSA External Type 1,N2 - OSPF NSSA External Type 2S 0.0.0.0/0 [50/0] via 10.58.3.16,vlan 3C 10.58.3.0/24 [0/0] directly connected,vlan 3C 10.58.4.0/24 [0/0] directly connected,vlan 4C 10.58.5.0/24 [0/0] directly connected,vlan 5C 10.58.9.0/24 [0/0] directly connected,vlan 9C 10.58.10.0/24 [0/0] directly connected,vlan 10C 10.58.11.0/24 [0/0] directly connected,vlan 11C 10.58.12.0/24 [0/0] directly connected,vlan 12S 10.58.64.0/24 [40/0] via 10.58.3.17,vlan 3S 10.58.128.0/24 [40/0] via 10.58.3.254,vlan 3S 10.58.129.0/24 [1/0] via 10.58.3.254,vlan 3 S 192.168.8.0/24 [1/0] via 10.58.3.254,vlan 3switch2#Ping 10.58.129.254Pinging 10.58.129.254 with 64 bytes of data:----10.58.129.254 Ping Statistics----4 packets transmitted,0 packets received,100% packet lossround-trip (ms) min/avg/max = 0/NaN/0switch2#Ping 192.168.8.254Pinging 192.168.8.254 with 64 bytes of data:----192.168.8.254 Ping Statistics----4 packets transmitted,100% packet lossround-trip (ms) min/avg/max = 0/NaN/0
路由器诊断
router# traceroute -d 192.168.8.11traceroute to 192.168.8.11 (192.168.8.11),30 hops max,60 byte packets 1 192.168.8.11 (192.168.8.11) 0.237 ms 0.222 ms 0.211 msrouter# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface10.58.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth010.58.128.0 0.0.0.0 255.255.255.0 U 0 0 0 eth310.58.129.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4router# Ping 192.168.8.11Ping 192.168.8.11 (192.168.8.11) 56(84) bytes of data.64 bytes from 192.168.8.11: icmp_seq=1 ttl=128 time=2.23 ms64 bytes from 192.168.8.11: icmp_seq=2 ttl=128 time=0.237 ms
Device1诊断
(device1)c:\>route print===========================================================================Interface List0x1 ........................... MS TCP Loopback interface0x2 ...bc 30 5b d8 41 c3 ...... broadcom NetXtreme 57xx Gigabit Controller - Packet Scheduler Miniport======================================================================================================================================================Active Routes:Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.8.254 192.168.8.11 20 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 192.168.8.0 255.255.255.0 192.168.8.11 192.168.8.11 20 192.168.8.11 255.255.255.255 127.0.0.1 127.0.0.1 20 192.168.8.255 255.255.255.255 192.168.8.11 192.168.8.11 20 224.0.0.0 240.0.0.0 192.168.8.11 192.168.8.11 20 255.255.255.255 255.255.255.255 192.168.8.11 192.168.8.11 1Default Gateway: 192.168.8.254===========================================================================Persistent Routes: None(device1)c:\>tracert -d 10.58.129.254Tracing route to 10.58.129.254 over a maximum of 30 hops 1 * * * Request timed out. 2 * * * Request timed out. 3 * * * Request timed out. 4 * * * Request timed out.(etc. until 30 hops).
所以从device1运行Ping 10.58.129.254,并且在linux路由器的192.168.8.254接口上运行tcpdump,我可以看到ICMP回应请求和回复
router# tcpdump -i eth417:08:08.326221 IP 192.168.8.11 > 10.58.129.254: ICMP echo request,ID 512,seq 63746,length 4017:08:08.326240 IP 10.58.129.254 > 192.168.8.11: ICMP echo reply,length 40
但是回复永远不会返回到device1.
有谁知道问题可能是什么?
关于eth2,3&的tcpdump 4还显示以下输出(我没有在eth0上看到它,这是上面由核心交换机路由的一个VLAN):
19:49:16.246286 STP 802.1w,RAPId STP,Flags [Learn,Forward],brIDge-ID8000.a4:ba:db:69:74:91.8014,length 4319:49:18.257007 STP 802.1w,length 43
我知道这是生成树,但我不知道这是不是坏事.这提供了任何线索吗?有关信息,上述STP消息中的硬件地址是switch3的硬件地址.
解决方法 在第二个拓扑中,您似乎具有拆分子网. 192.168.8.0/24跨越多个您指定为第3层的交换机.在您的switch2输出中,您有一个静态路由,用于此/ 24指向单个接口:S 192.168.8.0/24 [1/0] via 10.58.3.254,vlan 3
这意味着命中192.168.8.254或192.168.8.11的流量命中交换机2将被转发到同一个下一跳.至少有一个目的地
为了使其按预期工作,您有以下几种选择:
>将交换机[123]配置为第2层交换机,使192.168.8.0 / 24再次成为单个广播域.>在每个链接上配置单独的网络:{device1 – > switch1,switch1 – > switch2等}
总结以上是内存溢出为你收集整理的Linux路由器问题全部内容,希望文章能够帮你解决Linux路由器问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)