PC 1 在 VLAN 10 上
PC 2 位于 VLAN 20
路由器 1 位于 VLAN 30
SW 和 Router2 之间是中继,允许 vlan 10-30
我可以在 PC1 和 PC2 之间 ping,但我不能从路由器 1 ping 任何 PC。我应该添加额外的路由吗?
更新:
更简单的版本(仍然不起作用)
我有这样的拓扑:
这是我的配置:
转变
int fa0/1
sw mode access
sw access vlan 10
int fa0/2
sw mode access
sw access vlan 20
int fa0/3
sw mode trunk
sw trunk allowed vlan 10-20
路由器 R_1 配置
int fa0/0.10
encapsulation dot1q
ip address 10.0.10.1 255.255.255.0
int fa0/0.20
encapsulation dot1q
ip address 10.0.20.1 255.255.255.0
电脑配置
ip : 10.0.10.100/24 default gateway : 10.0.10.1
路由器 R_2 上的配置
int fa0/0
ip address 10.0.20.100 255.255.255.0
R_2的路由配置
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.10.0 is directly connected, FastEthernet0/0.10
C 10.0.20.0 is directly connected, FastEthernet0/0.20
演出结束后:
Router#show run
Building configuration...
Current configuration : 719 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
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 10.0.10.1 255.255.255.0
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.0.20.1 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
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
R_2的路由配置
Gateway of last resort is 10.0.20.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.20.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.0.20.1
演出结束后:
Router#show run
Building configuration...
Current configuration : 596 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 10.0.20.100 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.20.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
