VLAN 之间的 Cisco 路由

VLAN 之间的 Cisco 路由

我在 Cisco 路由器上从两个 VLAN 进行路由时遇到了问题,配置如下:

interface FastEthernet0/1.13
 encapsulation dot1Q 13
 ip address 192.168.13.254 255.255.255.0
 ip nat inside
 no ip virtual-reassembly
!
interface FastEthernet0/1.21
 encapsulation dot1Q 21
 ip address 10.10.10.29 255.255.255.0
 ip nat outside
 no ip virtual-reassembly
!

路由部分:

ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 <ISP GW IP>
ip route 10.10.5.0 255.255.255.0 10.10.10.90

路由器上还有其他东西,特别是一个大的访问列表以及大量的 NAT,但与这些 VLAN 无关。

如果我在 VLAN 13 主机上并尝试 ping 例如 VLAN21 地址,这不应该工作吗?

编辑#1

的结果sh ip route

Gateway of last resort is <ISP GW> to network 0.0.0.0

C    192.168.12.0/24 is directly connected, FastEthernet0/1.12
C    192.168.13.0/24 is directly connected, FastEthernet0/1.13
     <ISP subnet> is subnetted, 2 subnets
C       <ISP IP> is directly connected, FastEthernet0/0.120
C       <ISP IP> is directly connected, FastEthernet0/1.16
C    192.168.11.0/24 is directly connected, FastEthernet0/1.11
     10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
S       10.10.5.0/20 [1/0] via 10.10.10.90
C       10.10.10.1/24 is directly connected, FastEthernet0/1.21
C    192.168.0.0/24 is directly connected, FastEthernet0/1.10
S*   0.0.0.0/0 [1/0] via <ISP GW>

答案1

您使用此命令时遇到问题:

ip route 10.10.5.0 255.255.240.0 10.10.10.90

您没有到10.10.10.90下一跳的路由:

     10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
S       10.10.5.0/20 [1/0] via 10.10.10.90

如果路由器不知道如何到达下一跳,则无法路由到网络10.10.5.0/20,流量将被丢弃。对于任何路由,路由器都需要知道如何到达下一跳地址,但路由器具有ip address 10.10.10.29 255.255.255.192仅通向 的直连网络10.10.10.63,并且由于某种原因未通向 。没有直接连接到10.10.10.90下一跳地址的网络的接口。

您确实不应该将外部 (WAN) 接口用作 VLAN 接口。通常,您希望使用物理地址作为外部 (WAN) 接口。

另外,您还可以显示直接连接的路线:

C    172.16.0.0/16 is directly connected, FastEthernet0/1.21

不幸的是,这与您显示的该接口配置不匹配。

永远不要为直接连接的网络包含静态路由。

相关内容