实验拓扑: <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

拓扑介绍:

   DS1和DS2分别为两台3560交换机,网络拓扑可以看作是分布层和接入层的两层结构,也可以看作是核心层和接入层的紧缩骨干式架构;实验中称作分布层;

   AS1和AS2是两台2960作为接入层交换机,二者均使用千兆上联至两台分布层交换机,并且均为双挂;

实验介绍:

  把接入层交换机作为VTP的客户端,而分布层交换机做为VTP的服务器端(可能这样并不适合真正的生产网络环境);

实验步骤:

1. 设置分布层的vtp域:

DS1

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#hostname DS1

DS1(config)#vtp domain cisco

Changing VTP domain name from NULL to cisco

DS2同上,免去叙述

查看DS1此时的VTP状态:

DS1(config)#do sh vtp status

VTP Version                     : 2

Configuration Revision          : 0

Maximum VLANs supported locally : 1005

Number of existing VLANs        : 5

VTP Operating Mode              : Server

VTP Domain Name                 : cisco

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0xAA 0xB9 0x0C 0xCD 0xD7 0xE8 0xA6 0xE0 

Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

Local updater ID is 0.0.0.0 (no valid interface found)

因为vtp的默认状态即是server模式,因此DS1和DS2毋须改变vtp模式;

2. 设置接入层的vtp域:

AS1

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#hostname AS1

AS1(config)#vtp domain cisco

Changing VTP domain name from NULL to cisco

AS1(config)#vtp mode client 

Setting device to VTP CLIENT mode.

AS2同上,免去叙述

查看AS1此时的VTP状态:

AS1(config)#do sh vtp status

VTP Version                     : 2

Configuration Revision          : 0

Maximum VLANs supported locally : 255

Number of existing VLANs        : 5

VTP Operating Mode              : Client

VTP Domain Name                 : cisco

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0xAA 0xB9 0x0C 0xCD 0xD7 0xE8 0xA6 0xE0 

Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

至此,四个交换机均属于cisco这个vtp domain,并且DS1和DS2工作在server模式,AS1和AS2工作在client模式。

3. 配置trunk:

因为交换机之间通过干道链路交换VTP更新,所以在这四个交换机之间的链路都需要配置成trunk链路。

DS1

DS1(config)#int gi0/1

DS1(config-if)#switchport 

DS1(config-if)#switchport mode trunk 

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

DS1(config-if)#switchport trunk ?

  allowed  Set allowed VLAN characteristics when interface is in trunking mode

  native   Set trunking native characteristics when interface is in trunking

           Mode

Cisco的PacketTracer模拟器里面的3560没有配置干道封装模式的选项

DS2的配置同上;

AS1:

AS1(config)#int gi1/1

AS1(config-if)#sw mo trunk 

AS2的配置同上;

4. 在DS1上新建3个vlan 10,20,30,查看DS1的VTP状态:

DS1(config)#vlan 10

DS1(config-vlan)#exit

DS1(config)#vlan 20

DS1(config-vlan)#exit

DS1(config)#vlan 30

DS1(config-vlan)#exit

DS1#sh vtp status

VTP Version                     : 2

Configuration Revision          : 3

Maximum VLANs supported locally : 1005

Number of existing VLANs        : 8

VTP Operating Mode              : Server

VTP Domain Name                 : cisco

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x3D 0x7B 0xC7 0x5E 0xC3 0xF0 0x52 0xC8 

Configuration last modified by 0.0.0.0 at 3-1-93 00:21:19

Local updater ID is 0.0.0.0 (no valid interface found)

查看AS1的VTP状态:

AS1#sh vtp status

VTP Version                     : 2

Configuration Revision          : 3

Maximum VLANs supported locally : 255

Number of existing VLANs        : 8

VTP Operating Mode              : Client

VTP Domain Name                 : cisco

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x3D 0x7B 0xC7 0x5E 0xC3 0xF0 0x52 0xC8 

Configuration last modified by 0.0.0.0 at 3-1-93 00:21:19

Configuration Revision从0变到了3,原因是新增一个VLAN,Configuration Revision就会加1;

结束:

   至此,VTP配置成功,sevrver上的更新可以通过干道传播到client端,client端根据更细的Configuration Revision和目前自己的Configuration Revision,如果更新的版本号大于目前的版本号,client将使用新的VLAN信息覆盖已有的VLAN配置信息。