我在同一个路由器上有两个无法互相 ping 通的 vlan

网络工程 转变 路由器 VLAN
2021-07-12 04:24:09

我正在使用 cisco packet tracer 6.2 的学生版。

我有两个连接到同一路由器的 vlan,但它们无法相互 ping 通。这是我的路由器和交换机的配置。

我的路由器:

version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
hostname Router
ip dhcp excluded-address 192.168.10.254
ip dhcp excluded-address 192.168.20.254
ip dhcp pool 10
network 192.168.10.0 255.255.255.0
ip dhcp pool 20
network 192.168.20.0 255.255.255.0
ip cef
no ipv6 cef
spanning-tree mode pvst
interface FastEthernet0/0
no ip address
duplex auto
speed auto
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
interface Vlan1
no ip address
shutdown
ip classless
ip flow-export version 9
no cdp run
line con 0
line aux 0
line vty 0 4
 login
end

和我的开关:

version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
hostname Switch
spanning-tree mode pvst
interface FastEthernet0/1
switchport access vlan 10
interface FastEthernet0/2
switchport access vlan 20
interface FastEthernet0/3
switchport mode trunk
ports 4-24 are not configured. 
interface Vlan1
no ip address
shutdown
line con 0
line vty 0 4
login
line vty 5 15
login
end
1个回答

您忘记了 DHCP 配置中的默认网关。每个池都需要一个:

default-router 192.168.x.254