配置LSW1
LSW1(config)# interface Ethernet0/0/1
LSW1(config-if)# switchport mode access
LSW1(config-if)# switchport access vlan 3
LSW1(config)# interface Ethernet0/0/2
LSW1(config-if)# switchport mode trunk
LSW1(config-if)# switchport trunk allowed vlan 3,2
配置LSW2
LSW2(config)# interface Ethernet0/0/1
LSW2(config-if)# switchport mode trunk
LSW2(config-if)# switchport trunk allowed vlan 2,4
配置LSW3
LSW3(config)# interface Ethernet0/0/1
LSW3(config-if)# switchport mode access
LSW3(config-if)# switchport access vlan 4
配置PC1
PC1> enable
PC1# configure terminal
PC1(config)# interface Ethernet0/0/1
PC1(config-if)# ip address 192.168.1.2 255.255.255.0
PC1(config-if)# exit
PC1(config)# exit
配置PC2
PC2> enable
PC2# configure terminal
PC2(config)# interface Ethernet0/0/1
PC2(config-if)# ip address 192.168.2.2 255.255.255.0
PC2(config-if)# exit
PC2(config)# exit
配置PC3
PC3> enable
PC3# configure terminal
PC3(config)# interface Ethernet0/0/1
PC3(config-if)# ip address 192.168.3.2 255.255.255.0
PC3(config-if)# exit
PC3(config)# exit