.1 實(shí)驗任務(wù)在Catalyst 2950交換機上配置VTP
1.2 實(shí)驗環(huán)境和網(wǎng)絡(luò )拓撲
1.3 完成標準
(1) 按照拓撲圖要求連接交換機,在VTP服務(wù)器上配置VLAN,配置為VTP客戶(hù)機的交換機能夠學(xué)習到VLAN信息,不能添加、刪除和修改VLAN。
(2) 配置為透明模式的交換機可以自己添加、刪除和修改VLAN,但是不學(xué)習VLAN信息。
2.詳細操作步驟
Step 1: 配置交換機的VTP
(1) 配置交換機的A、B和C的VTP域為Benet
交換機A配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname A //配置交換機名為A
*Mar 1 00:00:44.671: %SYS-5-CONFIG_I: Configured from console by console
A(config)#interface f0/0 //配置端口0為中繼端口連接交換機B
A(config-if)#switchport mode trunk
*Mar 1 00:21:45.123: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunk
A(config-if)#exit
A(config)#exit
A#vlan database
A(vlan)#vtp domain benet //配置VTP域為benet
Changing VTP domain name from NULL to benet
交換機B配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname B
*Mar 1 00:00:44.671: %SYS-5-CONFIG_I: Configured from console by console
B(config)#interface f0/0 //配置端口0為中繼端口連接交換機A
B(config-if)#switchport mode trunk
*Mar 1 00:18:28.991: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunk
B(config)#interface f0/1 //配置端口1為中繼端口連接交換機C
B(config-if)#switchport mode trunk
*Mar 1 00:18:38.791: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trunk
B(config-if)#exit
A(config)#exit
B#vlan database
B(vlan)#vtp domain benet //配置VTP域為benet
Changing VTP domain name from NULL to benet
交換機C配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname C
*Mar 1 00:01:12.647: %SYS-5-CONFIG_I: Configured from console by cosole
C(config)#interface f0/0 //配置端口0為中繼端口連接交換機
C(config-if)#switchport mode trunk
*Mar 1 00:16:39.635: %DTP-5-TRUNKPORTON: Port Fa0/0 has become dot1q trunk
C(config-if)#exit
A(config)#exit
C#vlan
C#vlan database
C(vlan)#vtp domain benet //配置VTP域為benet
Changing VTP domain name from NULL to benet
(2) 配置交換機A、B和C的VTP工作模式分別為Server、Transparent和Client
交換機A配置如下:
A(vlan)#vtp server //配置交換機A的VTP工作模式為Server
Device mode already VTP SERVER.
A(vlan)#exit
APPLY completed.
Exiting....
A#show vtp status
VTP Version : 2
Configuration Revision : 0 //配置修改編號從0開(kāi)始
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21
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)
交換機B配置如下:
B(vlan)#vtp transparent //配置交換機B的VTP工作模式為Transparent
Setting device to VTP TRANSPARENT mode.
B(vlan)#exit
APPLY completed.
Exiting....
B#show vtp status
VTP Version : 2
Configuration Revision : 0 //配置修改編號從0開(kāi)始
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Transparent
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
交換機C配置如下:
C(vlan)#vtp client //配置交換機C的VTP工作模式為Client
Setting device to VTP CLIENT mode.
C(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
C#show vtp status
VTP Version : 2
Configuration Revision : 0 //配置修改編號從0開(kāi)始
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Client
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x36 0xC7 0xEE 0x81 0xF1 0x23 0x1A 0x21
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Step 2: 配置交換機的VLAN,并驗證VTP各模式的特點(diǎn)
(1) 在交換機A上配置VLAN2和VLAN3
交換機A配置如下:
A#vlan database
A(vlan)#vlan 2 name VLAN2 //配置VLAN2和VLAN3
VLAN 2 added:
Name: VLAN2
A(vlan)#vlan 3 name VLAN3
VLAN 3 added:
Name: VLAN3
A(vlan)#exit
APPLY completed.
Exiting....
A#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
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
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
交換機B配置如下:
B#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
Fa1/0, Fa1/1, Fa1/2, Fa1/3
Fa1/4, Fa1/5, Fa1/6, Fa1/7
Fa1/8, Fa1/9, Fa1/10, Fa1/11
Fa1/12, Fa1/13, Fa1/14, Fa1/15
//因為交換機B的VTP模式為Transparent,在此不同步Server上的VLAN配置
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
交換機C配置如下:
C#show vlan-switch
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/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active
3 VLAN3 active
//因為交換機C的VTP模式為Client,在此同步Server上的VLAN配置
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
1002 fddi 101002 1500 - 0 - - - 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
(2) 在交換機B上配置VLAN4和VLAN5
B#vlan database
B(vlan)#vlan 4 name VLAN4 //配置VLAN4和VLAN5
VLAN 4 added:
Name: VLAN4
B(vlan)#vlan 5 name VLAN5
VLAN 5 added:
Name: VLAN5
B(vlan)#exit
APPLY completed.
Exiting....
B#show vlan-s
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, Fa1/0, Fa1/1
Fa1/2, Fa1/3, Fa1/4, Fa1/5
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/10, Fa1/11, Fa1/12, Fa1/13
Fa1/14, Fa1/15
4 VLAN4 active
5 VLAN5 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
4 enet 100004 1500 - - - - - 0 0
5 enet 100005 1500 - - - - - 0 0
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
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
交換機A配置如下:
A#show vlan-s
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/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active
3 VLAN3 active
//因為交換機B的VTP模式為Transparent,在此不同步Server上的VLAN配置
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
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
交換機C配置如下:
C#show vlan-switch
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/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active
3 VLAN3 active
//因為交換機B的VTP模式為Transparent,在此不同步Server上的VLAN配置
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
1002 fddi 101002 1500 - 0 - - - 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
Step 3: 配置交換機的VTP口令
(1) 配置交換機A的VTP口令,添加VLAN6
交換機A配置如下:
A#vlan d
A(vlan)#vtp password cisco //配置VTP口令為cisco
Setting device VLAN database password to cisco.
A(vlan)#vlan 6 name VLAN6 //添加VLAN6
VLAN 6 added:
Name: VLAN6
A(vlan)#exit
APPLY completed.
Exiting....
A#
A#show vtp s
VTP Version : 2
Configuration Revision : 2 //以上操作導致配置修改編號增加
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
A con0 is now available : 0x54 0xA2 0xFA 0x30 0x7D 0x9D 0x3C 0xC7
Configuration last modified by 0.0.0.0 at 3-1-02 00:09:07
Local updater ID is 0.0.0.0 (no valid interface found)
交換機B配置如下:
B#show vtp s
VTP Version : 2
Configuration Revision : 0 //交換機B為Transparent工作模式,不同步VTP中VLAN信息,配置修改編號無(wú)變化
Maximum VLANs supported locally : 256
Number of existing VLANs : 7
VTP Operating Mode : Transparent
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xA2 0xD1 0x76 0x41 0x79 0xF4 0x7F 0x4D
Configuration last modified by 0.0.0.0 at 3-1-02 00:07:14
交換機C配置如下:
C#show vtp s
VTP Version : 2
Configuration Revision : 1 //同步Server的VLAN2、VLAN3,配置修改該編號增加,但沒(méi)有設置VTP口令,針對Server后兩次動(dòng)作沒(méi)有同步,配置修改編號沒(méi)有增加
Maximum VLANs supported locally : 256
Number of existing VLANs : 7
VTP Operating Mode : Client
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC0 0xD6 0xEA 0xAC 0x21 0x06 0x71 0x4B
Configuration last modified by 0.0.0.0 at 3-1-02 00:03:55
(2) 配置交換機B和C的VTP命令
交換機A配置如下:
B#vlan d
B(vlan)#vtp password cisco //配置VTP口令為cisco
Setting device VLAN database password to cisco.
B(vlan)#exit
APPLY completed.
Exiting....
B#show vtp s
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 7
VTP Operating Mode : Transparent
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xE7 0x04 0xDD 0xBA 0x5D 0x21 0x32 0x19
Configuration last modified by 0.0.0.0 at 3-1-02 00:12:24
交換機C配置如下:
C#vlan d
C(vlan)#vtp password cisco //配置VTP口令為cisco
Setting device VLAN database password to cisco.
C(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
C#show vtp s
VTP Version : 2
Configuration Revision : 2 //修改口令后同步Server的VLAN信息導致配置修改編號增加
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Client
VTP Domain Name : benet
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x54 0xA2 0xFA 0x30 0x7D 0x9D 0x3C 0xC7
Configuration last modified by 0.0.0.0 at 3-1-02 00:09:07
C#show vlan-s
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/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15
2 VLAN2 active
3 VLAN3 active
6 VLAN6 active //與Server同步VLAN6
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
6 enet 100006 1500 - - - - - 0 0
1002 fddi 101002 1500 - 0 - - - 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
Step 4: 配置VTP修剪
在交換機A、B和C上配置VTP修剪
交換機A配置如下:
A#vlan d
A(vlan)#vtp pruning //配置VTP修剪
Pruning switched ON
A(vlan)#exit
APPLY completed.
Exiting....
A#show vtp s
VTP Version : 2
Configuration Revision : 3 //以上操作導致配置修改標號增加
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : benet
VTP Pruning Mode : Enabled //VTP剪切狀態(tài)開(kāi)啟
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x5B 0xA1 0xB8 0x83 0x26 0xF0 0x94 0xB8
Configuration last modified by 0.0.0.0 at 3-1-02 00:12:48
Local updater ID is 0.0.0.0 (no valid interface found)
交換機B配置如下:
B#vlan d
B(vlan)#vtp pruning //配置VTP修剪
Pruning switched ON
B(vlan)#exit
APPLY completed.
Exiting....
B#show vtp s
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 7
VTP Operating Mode : Transparent
VTP Domain Name : benet
VTP Pruning Mode : Enabled //VTP剪切狀態(tài)開(kāi)啟
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xE7 0x04 0xDD 0xBA 0x5D 0x21 0x32 0x19
Configuration last modified by 0.0.0.0 at 3-1-02 00:12:24
交換機C配置如下:
C(vlan)#vtp pruning //配置VTP修剪
Pruning already switched on.
C(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
C#show vtp s
VTP Version : 2
Configuration Revision : 3 //同步Server導致配置修改編號增加
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Client
VTP Domain Name : benet
VTP Pruning Mode : Enabled //VTP剪切狀態(tài)開(kāi)啟
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x5B 0xA1 0xB8 0x83 0x26 0xF0 0x94 0xB8
Configuration last modified by 0.0.0.0 at 3-1-02 00:12:48
3.實(shí)驗總結
通過(guò)使用VTP協(xié)議,交換機之間能夠互相傳遞VLAN信息,實(shí)現了VLAN的統一配置和統一管理。此實(shí)驗簡(jiǎn)單描述了VTP的配置過(guò)程,配置要點(diǎn)為:
l 交換機的VTP工作模式:Server、Client和Transparent。Server模式下交換機可控制它所在域中Vlan的生成和修改;Client模式下交換機不允許管理員創(chuàng )建、修改或刪除;Transparent模式下交換機不參與VTP,只轉發(fā)VTP通告消息,但它可以創(chuàng )建和刪除本地Vlan。
l 每個(gè)VTP設備會(huì )紀錄自己的VTP配置修改編號;VTP通告會(huì )包含發(fā)送者的VTP配置修改編號,這一信息用于確認接受到的信息是否比當前的信息更新。每個(gè)VTP通告從配置版本號0開(kāi)始。每當發(fā)生變化時(shí),配置版本編號加1。
l 在交換機上配置VTP口令,用于保證網(wǎng)絡(luò )內交換機VLAN配置的安全性。同一VTP域內的交換機,口令配置要一致。
l VTP通過(guò)修剪來(lái)減少沒(méi)有必要擴散的通信量,提高中繼鏈路的帶寬利用率。