网络拓扑图如图,二层交换机的配置如下:
interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 10.1.1.2 255.255.255.0
!
ip default-gateway 10.1.2.2
!
三层交换机的配置
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 3
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
no ip address
!
interface Vlan3
ip address 10.1.2.2 255.255.255.0
!
ip classless
ip route 10.0.0.0 255.0.0.0 10.1.1.2
ip route 10.1.1.0 255.255.255.0 FastEthernet0/1
PCO地址是10.1.1.1 掩码是255.255.255.0,网关是10.1.1.2
PC1地址是10.1.2.1 掩码是255.255.255.0,网关是10.1.2.2
为什么PC0ping不通PC1