3.6 VTP基本配置

实验目的:

1、掌握VTP基本配置。

2、理解VTPServerClient模式。

3、理解VTP的管理域、密码、配置版本号。

实验拓扑:

PingingLab传世经典系列《CCNA完全配置宝典》-3.6 VTP基本配置_CISCO

实验步骤:

1、依据图中拓扑部署VTP技术,整个VTP管理域为PingingLab,密码为Cisco,其中SW1Server,其他交换机为Client,配置如下=>

SW1上配置:

SW2上配置:

SW2#vlan database

SW2(vlan)#vtp client

SW2(vlan)#vtp domain PingingLab

SW2(vlan)#vtp password Cisco

SW2(vlan)#exit

SW3上配置:

SW3#vlan database

SW3(vlan)#vtp client

SW3(vlan)#vtp domain PingingLab

SW3(vlan)#vtp password Cisco

SW3(vlan)#exit

此时查看VTP信息,如下:

SW1#show vtp status

VTP Version : 2

Configuration Revision : 0[PL4]

Maximum VLANs supported locally : 256

Number of existing VLANs : 5[PL5]

VTP Operating Mode : Server[PL6]

VTP Domain Name : PingingLab[PL7]

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x4E 0xC8 0xE0 0x2D 0x31 0x2E 0x45 0x01

Configuration last modified by 0.0.0.0 at 3-1-02 01:22:27

Local updater ID is 0.0.0.0 (no valid interface found)

SW2#show vtp status

VTP Version : 2

Configuration Revision : 0

Maximum VLANs supported locally : 256

Number of existing VLANs : 5

VTP Operating Mode : Client

VTP Domain Name : PingingLab

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x4E 0xC8 0xE0 0x2D 0x31 0x2E 0x45 0x01

Configuration last modified by 0.0.0.0 at 3-1-02 01:22:27

以上可以看出,由于此时Server端未创建VLAN,默认配置版本号都为0

2、为了使得全网都能学习到VLAN10/20/30,需要在Server创建,配置如下=>

SW1(vlan)#vlan 10 name VLAN_10

SW1(vlan)#vlan 20 name VLAN_20

SW1(vlan)#vlan 30 name VLAN_30

SW1(vlan)#exit

此时查看SW1VTP信息,如下:

SW1#show vtp status

VTP Version : 2

Configuration Revision : 1

Maximum VLANs supported locally : 256

Number of existing VLANs : 8

VTP Operating Mode : Server

VTP Domain Name : PingingLab

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x46 0xD6 0x5A 0x38 0xF2 0xFD 0xA5 0xE6

Configuration last modified by 0.0.0.0 at 3-1-02 01:39:10

Local updater ID is 0.0.0.0 (no valid interface found)

由于VLAN信息出现变动,所以VTP版本号增加,此时查看其他Client端信息,如下:

SW2#show vtp status

VTP Version : 2

Configuration Revision : 1

Maximum VLANs supported locally : 256

Number of existing VLANs : 8

VTP Operating Mode : Client

VTP Domain Name : PingingLab

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x46 0xD6 0x5A 0x38 0xF2 0xFD 0xA5 0xE6

Configuration last modified by 0.0.0.0 at 3-1-02 01:39:10

可以看到,由于Server端版本号较高,Client端已经从Server端同步VLAN信息,查看VLAN信息,如下:

SW2#show vlan-switch brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active 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

10 VLAN_10 active

20 VLAN_20 active

30 VLAN_30 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

同样在SW3上查看VLAN信息,如下:

SW3#show vlan-switch brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/0, 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 VLAN_10 active

20 VLAN_20 active

30 VLAN_30 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

可以看到,通过部署VTP技术,此时VLAN信息全局同步。

3、修改SW2SW3的管理域或者密码,并在SW1修改VLAN信息,查看VTP同步效果。

SW2上修改域名:

SW2(vlan)#vtp domain PL

Changing VTP domain name from PingingLab to PL

SW2(vlan)#exit

SW3上修改密码:

SW3(vlan)#vtp password PL

Setting device VLAN database password to PL.

SW3(vlan)#exit

SW1上修改VLAN

SW1#vlan database

SW1(vlan)#vlan 10 name TEST

SW1(vlan)#no vlan 20

SW1(vlan)#exit

此时查看SW1VLAN信息:

SW1#show vlan-switch brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active  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 TEST active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

再次观察SW2SW3VLAN信息,如下:

SW2#show vlan-switch brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active 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

10 VLAN_10 active

20 VLAN_20 active

30 VLAN_30 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

SW3#show vlan-switch brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/0, 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 VLAN_10 active

20 VLAN_20 active

30 VLAN_30 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

可以看到,由于域名和密码的不一致,所以导致VTP信息无法同步。此实验完成。


[PL1]定义VTP模式,全局模式方式:

(config)vtp mode server/client

[PL2]定义VTP管理域,与全局模式配置方法一致

[PL3]定义VTP密码,实现VTP安全,与全局模式配置方法一致。

[PL4]此处显示配置版本号,默认为0,每次VLAN信息的变动都会增加1,配置版本号越大越优先,配置版本号小的交换机会向配置版本号高的交换机自动同步VLAN信息。

[PL5]本地存在的VLAN数目,默认有系统VLAN 5个,即

VLAN110021005,并且没法修改和删除。

[PL6]VTP操作模式,有ServerClientTransparent三种,默认所有交换机都是Server模式。

[PL7]VTP域名,大小写敏感。

==========================================

PingingLab·高品质IT教育提供商

CCIE 实验室·IT项目实战·高端人才定制

深圳拼客信息科技有限公司·广州大学城外环西路站

新浪微博:@拼客科技PingingLab  @PingingLab-陈鑫杰

PingingLab微信公众号:pinginglab

PingingLab技术交流群:240920680