实验过程: 第一步:登录sw1 S1#show vlan-s
VLAN Name Status Ports
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
1 enet 100001 1500 - - - - - 1002 1003
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
S1#
第二步:进入vlan database模式下
S1#vlan da
S1#vlan database (进入数据库模式下进行)
S1(vlan)#vlan 2 name VLAN2
VLAN 2 added:
Name: VLAN2
S1(vlan)#vlan 3 name vlan3
VLAN 3 added:
Name: vlan3
S1(vlan)#vlan 4 name vlan4
VLAN 4 added:
Name: vlan4
S1(vlan)#exit
APPLY completed.
Exiting....
S1#
第三步:再次查看创建vlan的结果: S1#show vlan-switch
VLAN Name Status Ports
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active
3 vlan3 active
4 vlan4 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
1 enet 100001 1500 - - - - - 1002 1003
2 enet 100002 1500 - - - - - 0 0
3 enet 100003 1500 - - - - - 0 0
4 enet 100004 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
S1#
第四步:查看vlan配置文件
S1#dir flash: (vlan的信息在2900系列上是保存在flash下的vlan.dat文件中的)
Directory of flash:/
1 -rw- 780 <no date> vlan.dat
8388604 bytes total (8387760 bytes free) S1# 第五步:将F0/2划入到vlan中 S1(config)#int f0/2 S1(config-if)#switchport mode access S1(config-if)#switchport access vlan 2 S1(config-if)# S1(config-if)# 第六步:验证是否将接口划分到vlan中 S1#show vlan-s
VLAN Name Status Ports
1 default active Fa0/0, Fa0/1, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active Fa0/2 (看到这里已经好了)
3 vlan3 active
4 vlan4 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
1 enet 100001 1500 - - - - - 1002 1003
2 enet 100002 1500 - - - - - 0 0
3 enet 100003 1500 - - - - - 0 0
4 enet 100004 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
S1#
清除交换机上划分的大量的vlan信息 1.vlan data下no vlan {vlan-id} 2.del vlan.dat