文章目录
前言
VTP
虚拟局域网中继协议
从一点维护整个网络上vlan的添加,删除和重命名工作
VTP域组成
在一个·同域名下通过trunk相连的一组交换机
先创建trunk
创建VTP域并且设置密码
服务器模式(SERVER)默认
可以创建,删除和修改vlan
学习转发相同的VTP通告
(学习转发配置版本号最高的)
(添加,删除 更改都会增加1版本号)
客户机模式(Client)
学习,转发相同域名的VYP通告
不可以创建,删除和修改vlan
透明模式(Transparent) 配置版本为0
可以创建删除和修改vlan但是在本地有效
转发但不学习VTP通告
什么情况下配置版本号为0
在修改域名字时
透明模式下
VTP通告类型
汇总通告:(域名 配置版本)
子集通告:(具体内容)
通告前期:(重启 域名更改 版本号低)
创建VTP域
全局模式下vtp domain
(vtp域名 空时能自动学习)
配置交换机的VTP
全局模式下vtp mode (server,client,transparent)
配置vtp密码
全局模式下 vtp password
配置vtp修
全局模式 vtp pruning
配置vtp版本号
全局模式 vtp version2
查看vtp
特权模式下show vtp status
vtp的转发
先起trunk
sw1(config)#in f0/1
sw1(config-if)#switchport mode trunk
创建vtp域:yu
sw1(config)#vtp domain yu
Domain name already set to yu.
设置密码:jian
sw1(config)#vtp password jian
Password already set to jian
查看:vtp
sw1#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name : yu
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xBB 0x57 0xDC 0xD7 0x0A 0x55 0x4B 0x2
sw2
Switch(config)#hos sw2
sw2(config)#int range f0/1-2
创建trunk
sw2(config-if-range)#switchport mode trunk
把sw2设置客户机
sw2(config)#vtp mode client
Setting device to VTP CLIENT mode.
设置域名
sw2(config)#vtp domain yu
Domain name already set to yu.
设置密码
sw2(config)#vtp password jian
Setting device VLAN database password to jian
把sw3设置客户机
Switch(config)#in f0/2
Switch(config-if)#switchport mode trunk
Switch(config)#vtp mode client
Setting device to VTP CLIENT mode.
设置域yu
Switch(config)#vtp domain yu
Domain name already set to yu
设置密码
Switch(config)#vtp password jian
Setting device VLAN database password to jian
加入vlan10 vlan20验证
sw1(config)#vlan 10
sw1(config-vlan)#exit
sw1(config)#vlan 20
sw1(config-vlan)#exit
查看
sw1#show vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 255
Number of existing VLANs : 7
VTP Operating Mode : Server
VTP Domain Name : yu
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xF0 0xCF 0x33 0xEA 0xAF 0x63 0x79 0xFE
在sw2加入vlan100
sw2(config)#vlan 100
VTP VLAN configuration not allowed when device is in CLIENT mode
查看
sw2#show vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 255
Number of existing VLANs : 7
VTP Operating Mode : Client
VTP Domain Name : yu
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
查看
sw2#show vlan brief
VLAN Name Status Ports
1 default active 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, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig1/1, Gig1/2
10 VLAN0010 active
20 VLAN0020 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default activ
项目二
设置域名yu
sw1(config)#vtp domain yu
% Incomplete command.
设置密码jian
sw1(config)#vtp password jian
%The VTP password cannot be set for NULL domain
设置sw2为透明模式
Switch(config)#hos sw2
sw2(config)#in range fastEthernet 0/1-2
sw2(config-if-range)#switchport mode trunk
sw2(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode
设置域名yu
sw2(config)#vtp domain yu
Changing VTP domain name from NULL to yu