配置VLAN管理地址
sw1(config)#int vlan 1
sw1(config-if)#ip add 172.16.0.1 255.255.255.0
sw1(config-if)#^Z
创建项目需要的VLAN
sw1#sh vlan-s
VLAN Name Status Ports
―- ――――――――――�C ――― ――――――――――-
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
―- ―�C ―――- ―�C ―― ―― ――�C ―- ――�C ―― ――
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
默认情况下交换机所有接口都属于vlan 1
进入vlan数据库模式中划分vlan
sw1#vlan da
sw1(vlan)#vlan 10 name Marketing
VLAN 10 added:
Name: Marketing
sw1(vlan)#vlan 30 name Teacher
VLAN 30 added:
Name: Teacher
sw1(vlan)#vlan 40 name Accounting
VLAN 40 added:
Name: Accounting
sw1(vlan)#vlan 100 name Students
VLAN 100 added:
Name: Students
sw1(vlan)#exit
APPLY completed.
Exiting….
输入exit为退出并保存。
sw1#sh vlan-s
VLAN Name Status Ports
―- ――――――――――�C ――― ――――――――――-
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
10 Marketing active
30 Teacher active
40 Accounting active
100 Students 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
―- ―�C ―――- ―�C ―― ―― ――�C ―- ――�C ―― ――
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
40 enet 100040 1500 - - - - - 0 0
100 enet 100100 1500 - - - - - 0 0
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
将接口划分到vlan下
sw1#config t
sw1(config)#int f0/2
sw1(config-if)#sw mo acc
sw1(config-if)#sw ac vlan 10
sw1(config-if)#int f0/3
sw1(config-if)#sw mo acc
sw1(config-if)#sw ac vlan 10
sw1(config-if)#int f0/4
sw1(config-if)#sw mo ac
sw1(config-if)#sw ac vlan 10
sw1(config-if)#int f0/5
sw1(config-if)#sw mo acc
sw1(config-if)#sw ac vlan 10
sw1(config-if)#int f0/6
sw1(config-if)#sw mo ac
sw1(config-if)#sw ac vlan 10
sw1(config-if)#int f0/7
sw1(config-if)#sw mo ac
sw1(config-if)#sw ac vlan 30
sw1(config-if)#int f0/8
sw1(config-if)#sw mo ac
sw1(config-if)#sw ac vlan 30
sw1(config-if)#int f0/9
sw1(config-if)#sw ac vlan 40
sw1(config-if)#int f0/10
sw1(config-if)#sw ac vlan 100
sw1(config-if)#in f0/11
sw1(config-if)#sw ac vlan 100
sw1(config-if)#in f0/12
sw1(config-if)#sw ac vlan 100
sw1(config-if)#exit
sw1(config)#^Z
查看划分情况
sw1#sh vlan-s
VLAN Name Status Ports
―- ――――――――――�C ――― ――――――――――-
1 default active Fa0/0, Fa0/1, Fa0/13, Fa0/14
Fa0/15
10 Marketing active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6
30 Teacher active Fa0/7, Fa0/8
40 Accounting active Fa0/9
100 Students active Fa0/10, Fa0/11, Fa0/12
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active