已有vlan20、vlan30
vlan20包含10-15端口,vlan30包含1-5和7端口
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range FastEthernet 0/10-15
Switch(config-if -range)#switchport mode access
Switch(config-if -range)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface range FastEthernet 0/1-5,7
Switch(config-if -range)#switchport mode access
Switch(config-if -range)#switchport access vlan 30
Switch(config-if)#exit
Switch(config)#interface FastEthernet 0/7
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit