步骤6
创建VLAN 2和VLAN 3的VLAN,按照前面的配置要求,将每个交换机将端口划归到各自的VLAN。
sw1(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
sw1(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#config t
Enter configuration commands, one per line. End with CNTL/Z.
sw1(config)#interface fastethernet0/1
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 2
sw1(config-if)#exit
sw1(config)#interface fastethernet0/2
sw1(config-if)#switchport access vlan 3
sw1(config-if)#
步骤7
使用命令show vlan brief检验是否已经有valn2、3。
sw2#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
我们看出并没有,由于刚刚VTP服务器设置了密码,这样就将CISCO管理域设为了安全模式,这样防止未经授权的交换机加入到用户的域内。刚才说明了这点。这时我们只须在SW2上设置密码即可。
sw2#config t
Enter configuration commands, one per line. End with CNTL/Z.
sw2(config)#vtp password xxx
Setting device VLAN database password to xxx.
sw2(config)#
或许刚刚设完密码马上验证还会没有,这时不须紧张,由于交换机每五分钟发送一次通告或者有变化时,它通告邻接交换机目前的VTP域名和配置修订号。稍等一会在验证。
sw2#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24
2 VLAN0002 active
3 VLAN0003 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
sw2#
在SW2上人工建立vlan4、vlan5
sw2#vlan database
sw2(vlan)#vlan 4
VLAN 4 added:
Name: VLAN0004
sw2(vlan)#vlan 5
VLAN 5 added:
Name: VLAN0005
sw2(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
验证:
sw2#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24
2 VLAN0002 active
3 VLAN0003 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
sw2#
这时大家会发现明明看到已经建立vlan4、5怎么会没有。大家有没有注意到交换机已经告诉大家In CLIENT state, no apply attempted.VTP客户模式不能创建,删除,和修改vlan。按照前面的配置要求,将每个交换机将端口划归到各自的VLAN。
sw2#config t
Enter configuration commands, one per line. End with CNTL/Z.
sw2(config)#interface fastethernet0/1
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 2
sw2(config-if)#exit
sw2(config)#interface fastethernet0/2
sw2(config-if)#switchport access vlan 3
sw2(config-if)#
测试连通:
在A上用ping命令测试和C的连通性:
C:\Documents and Settings\Administrator>ping 1.1.1.1
Pinging 1.1.1.1 with 32 bytes of data:
Reply from 1.1.1.1: bytes=32 time<10ms TTL=128
Reply from 1.1.1.1: bytes=32 time<10ms TTL=128
在B上用ping命令测试和D的连通性:
C:\Documents and Settings\Administrator>ping 1.1.1.2
Pinging 1.1.1.2 with 32 bytes of data:
Reply from 1.1.1.2: bytes=32 time<10ms TTL=128
Reply from 1.1.1.2: bytes=32 time<10ms TTL=128

