Bry*_*yan 7 networking linux routing switch vlan
我有一个基于 Linux 的路由器,有四个接口(每个接口都有自己的私有子网)。
当我直接连接的设备直接(即,没有开关,只是一个补丁电缆)将一个接口和另一个装置直接到另一个,如以下,则路由器完美地工作。
DEVICE1
192.168.8.11 ------- 192.168.8.254
ROUTER
10.58.129.254 ------- DEVICE2
10.58.129.1
Run Code Online (Sandbox Code Playgroud)
当我将路由器与我们的交换机连接时,如下所示,路由器不工作。
DEVICE1
192.168.8.11 ----------- switch1
|
switch2
|
switch3
|
192.168.8.254
ROUTER
10.58.129.254 -------- switch3
|
DEVICE2
10.58.129.1
Run Code Online (Sandbox Code Playgroud)
所有交换机都是第 3 层,交换机 1 (Dell PowerConnect 3548P) 与交换机 2 (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 route
Route 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 2
S 0.0.0.0/0 [50/0] via 10.58.3.16, vlan 3
C 10.58.3.0/24 [0/0] directly connected, vlan 3
C 10.58.4.0/24 [0/0] directly connected, vlan 4
C 10.58.5.0/24 [0/0] directly connected, vlan 5
C 10.58.9.0/24 [0/0] directly connected, vlan 9
C 10.58.10.0/24 [0/0] directly connected, vlan 10
C 10.58.11.0/24 [0/0] directly connected, vlan 11
C 10.58.12.0/24 [0/0] directly connected, vlan 12
S 10.58.64.0/24 [40/0] via 10.58.3.17, vlan 3
S 10.58.128.0/24 [40/0] via 10.58.3.254, vlan 3
S 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 3
switch2#ping 10.58.129.254
Pinging 10.58.129.254 with 64 bytes of data:
----10.58.129.254 PING Statistics----
4 packets transmitted,0 packets received,100% packet loss
round-trip (ms) min/avg/max = 0/NaN/0
switch2#ping 192.168.8.254
Pinging 192.168.8.254 with 64 bytes of data:
----192.168.8.254 PING Statistics----
4 packets transmitted,0 packets received,100% packet loss
round-trip (ms) min/avg/max = 0/NaN/0
Run Code Online (Sandbox Code Playgroud)
路由器诊断
router# traceroute -d 192.168.8.11
traceroute 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 ms
router# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.58.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.58.128.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
10.58.129.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
router# ping 192.168.8.11
PING 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 ms
64 bytes from 192.168.8.11: icmp_seq=2 ttl=128 time=0.237 ms
Run Code Online (Sandbox Code Playgroud)
设备 1 诊断
(device1)c:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...bc 30 5b d8 41 c3 ...... Broadcom NetXtreme 57xx Gigabit Controller - Pac
ket 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 1
Default Gateway: 192.168.8.254
===========================================================================
Persistent Routes:
None
(device1)c:\>tracert -d 10.58.129.254
Tracing 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).
Run Code Online (Sandbox Code Playgroud)
所以从device1, running ping 10.58.129.254
, and with tcpdump
running在Linux路由器的192.168.8.254接口上,可以看到ICMP回显请求和回复
router# tcpdump -i eth4
17:08:08.326221 IP 192.168.8.11 > 10.58.129.254: ICMP echo request, id 512, seq 63746, length 40
17:08:08.326240 IP 10.58.129.254 > 192.168.8.11: ICMP echo reply, id 512, seq 63746, length 40
Run Code Online (Sandbox Code Playgroud)
但是回复永远不会返回到设备 1。
有谁知道问题可能是什么?eth2,3 & 4 上的 tcpdump 还显示了以下输出(我在 eth0 上没有看到它,这是由核心交换机路由的上述一个 VLAN):
19:49:16.246286 STP 802.1w, Rapid STP, Flags [Learn, Forward], bridge-id
8000.a4:ba:db:69:74:91.8014, length 43
19:49:18.257007 STP 802.1w, Rapid STP, Flags [Learn, Forward], bridge-id
8000.a4:ba:db:69:74:91.8014, length 43
Run Code Online (Sandbox Code Playgroud)
我知道这是生成树,但我不知道这是否是一件坏事。这是否提供任何线索?需要说明的是,上述 STP 消息中的硬件地址是交换机 3 的地址。
在第二个拓扑中,您似乎有一个分割子网。192.168.8.0/24 跨越多个交换机,您将其声明为第 3 层。在 switch2 的输出中,您有一个指向单个接口的 /24 的静态路由:
S 192.168.8.0/24 [1/0] via 10.58.3.254, vlan 3
Run Code Online (Sandbox Code Playgroud)
这意味着到达 switch2 且目的地为 192.168.8.254 或 192.168.8.11 的流量将被转发到同一下一跃点。至少其中一个目的地
为了使其按您的预期工作,您有以下几种选择:
归档时间: |
|
查看次数: |
1924 次 |
最近记录: |