建立两个vlan,把一二口划入vlan1,三四口划入vlan2 Switch>enable Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int vlan 1 Switch(config-if)#ip address 192.168.0.1 255.255.255.0 Switch(config-if)#no shut Switch(config-if)#vlan 2 Switch(config-vlan)#int vlan 2 Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#no shut Switch(config-if)#int f0/1 Switch(config-if)#switchport access vlan 1 Switch(config-if)#int f0/2 Switch(config-if)#switchport access vlan 1 Switch(config-if)#int range f0/3-4 Switch(config-if-range)#switchport access vlan 2 Switch(config-if-range)#exit