路由问题,能ping通核心交换机但不能ping通防火墙

网络工程 路由 转变 顺式催化剂
2022-02-14 16:27:07

我们有一个设置,总共有 4 个站点全部连接回一个,2 个通过光纤连接,一个通过无线链路连接。与无线网桥的链接也需要来自我们主站点的 vlan (269),因此我们将其设置为中继而不是链接。

               4507-2
                 ^
                 |
WAN -> Sonicwall -> 4507 -> 3560
                 |
                 v
               4507-3

无法从 3560 ping 到 Sonicwall 或外部。可以从 3560 ping 所有 4507 交换机。可以从防火墙 ping 到 3560。

4507 配置

interface GigabitEthernet1/1
 description *SONICWALL*
 switchport access vlan 100
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast

interface GigabitEthernet2/46
 description **Trunk to 3560**
 switchport trunk allowed vlan 269,300
 switchport mode trunk

interface Vlan100
 ip address 10.1.100.1 255.255.252.0
 ip helper-address 10.1.104.10

interface Vlan269
 no ip address
 shutdown

interface Vlan300
 ip address 172.20.20.9 255.255.255.252

ip default-gateway 10.1.100.254
ip route 0.0.0.0 0.0.0.0 10.1.100.254
ip route 10.4.100.0 255.255.252.0 172.20.20.10

3560配置ip路由

interface GigabitEthernet0/24
 description Trunk to 4507
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 269,300
 switchport mode trunk

interface Vlan100
 ip address 10.4.100.1 255.255.252.0
 ip helper-address 10.1.104.10

interface Vlan300
 ip address 172.20.20.10 255.255.255.252

ip classless
ip route 0.0.0.0 0.0.0.0 172.20.20.9
ip route 10.1.100.0 255.255.252.0 172.20.20.9

4507条路线

4507#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.1.100.254 to network 0.0.0.0

S    192.168.110.0/24 [1/0] via 10.1.104.180
     172.20.0.0/30 is subnetted, 3 subnets
C       172.20.20.8 is directly connected, Vlan300
     10.0.0.0/22 is subnetted, 20 subnets
S       10.4.100.0 [1/0] via 172.20.20.10
C       10.1.100.0 is directly connected, Vlan100
S*   0.0.0.0/0 [1/0] via 10.1.100.254

3560条路线

3560#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 172.20.20.9 to network 0.0.0.0

     172.20.0.0/30 is subnetted, 1 subnets
C       172.20.20.8 is directly connected, Vlan300
     10.0.0.0/22 is subnetted, 10 subnets
C       10.4.100.0 is directly connected, Vlan100
S       10.1.100.0 [1/0] via 172.20.20.9
S*   0.0.0.0/0 [1/0] via 172.20.20.9

Sonicwall 也有 10.4.100.0/22 到 10.4.100.1 的路由

1个回答

看起来您的问题可能是防火墙路由。

Sonicwall 也有 10.4.100.0/22 到 10.4.100.1 的路由

您需要防火墙路由去下一跳,10.1.100.1而不是路由本身的地址。您正在告诉防火墙如何到达该网络,并且网络的下一跳地址不能在网络本身上,因为防火墙不知道如何到达下一跳所在的网络,所以防火墙无法将任何内容发送到下一跳。


我的两分钱,根据经验:

我实际上会在防火墙和第 3 层交换机之间建立路由链接,而不是 VLAN,并在所有第 3 层设备之间运行路由协议。静态路由无法扩展。

/30将交换机接口配置为第 3 层接口,并将其寻址为与或/31网络的点对点接口。/30在 SVI 上为 VLAN 使用网络,但您可能会遇到一些使用 SVI 延迟检测链路问题的问题,如果您在物理接口上解决,则不会出现这种情况。

对于 4507,而不是:

interface GigabitEthernet1/1
 description *SONICWALL*
 switchport access vlan 100
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast

使用类似的东西:

interface GigabitEthernet1/1
 description *SONICWALL*
 no switchport
 ip address 172.20.20.13 255.255.255.252

此外,请了解通过将第 2 层 VLAN 扩展到远程位置,您会增加第 2 层问题的可能性,并且该问题将影响两个站点而不是一个站点。今天几乎没有什么要求在同一个第 2 层域上拥有两台主机。我们生活在第 3 层世界中,并且路由运行良好。我认为将 VLAN 扩展到远程位置没有任何好处,但我确实看到了这样做的一些缺点。