1、创建vlan
Switch>
Switch>ena
Switch#
Switch#vlan d
Switch(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
Switch(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
Switch(vlan)#vlan 4
VLAN 4 added:
Name: VLAN0004
Switch(vlan)#
2、分配IP
Switch(config)#int vlan 2
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up
Switch(config-if)#ip add 192.168.1.1 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#
3、端口划分vlan
Switch(config)#int f0/1
Switch(config-if)#swi acc vlan 2
Switch(config-if)#