48小时系统班试听入口

【网络设备】VTP技术详解

发布作者:新盟教育 发布日期:2022-11-25 浏览人数:4518人

网工技术详解

资源放送 

↓ 扫一扫 领取录屏资料

网页同步文章.png


VTP(VLAN Trunk Protocol)提供了一种用于在交换机上管理VLAN的方法,该协议使得我们可以在一个或者几个中央点(Server)上创建、修改和删除VLAN,VLAN信息通过Trunk链路自动扩散到其他交换机,任何参与VTP的交换都可以接受这些修改,所有交换机保持相同的VLAN信息。

VTP被组织成管理域(VTP Domain),相同域中的交换机能共享VLAN信息。根据交换机在VTP域中的作用不同,VTP可以分为以下3种模式。

服务器模式(Server):在VTP服务器上能创建、修改和删除VLAN,同时这些信息会通告给域中的其他的交换机。在默认情况下,交换机是服务器模式。每个 VTP域必须至少有一台服务器,域中的VTP服务器可以有多台。

客户机模式(Llient):VTP客户机上不允许创建、修改和删除 VLAN,但它会监听来自其他交换机的VTP通告并更改自己的VLAN信息。接收到的VTP信息也会在Trunk链路上向其他交换机转发,因此这种交换机还能充当VTP中继。

透明模式(Transparent):这种模式的交换机不参与VTP。可以在这种模式的交换机创建、修改和删除VLAN,但是这些VLAN信息并不会通告给其他交换机,它也不接受其他交换机的VTP通告而更新自己的VLAN信息。然而需要注意的是,它会通过Trunk链路转发接收到的VTP通告,从而充当了VTP中继的角色,因此完全可以把该交换机看成是透明的。

VTP通告是以组播帧的方式发送的,VTP通告中有一个字段称为修订号(Revision),初始值为 0.只要在VTP Server上创建、修改和删除VLAN,通告的Revision就增加1,通告中还包含了VLAN的变化信息。需要注意的是:高 Revision的通告会覆盖低Revision的通告,而不管发送者是Server还是 Client。交换机只打官腔比本地在哪保存的Resivison号更高的通告;如果交换机收到比自己的Resivison号更低的通告,会用自己的VLAN信息反向覆盖。

交换机的VTP技术实验

网络1.png


三层交换机SW配置:

SW#show run
Building configuration...
Current configuration : 1563 bytes
!
version 16.3.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW
!
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet1/0/1
 switchport mode trunk
!
interface GigabitEthernet1/0/2
 switchport mode trunk
!
interface GigabitEthernet1/0/3
!
interface GigabitEthernet1/0/4
!
interface GigabitEthernet1/0/5
!
interface GigabitEthernet1/0/6
!
interface GigabitEthernet1/0/7
!
interface GigabitEthernet1/0/8
!
interface GigabitEthernet1/0/9
!
interface GigabitEthernet1/0/10
!
interface GigabitEthernet1/0/11
!
interface GigabitEthernet1/0/12
!
interface GigabitEthernet1/0/13
!
interface GigabitEthernet1/0/14
!
interface GigabitEthernet1/0/15
!
interface GigabitEthernet1/0/16
!
interface GigabitEthernet1/0/17
!
interface GigabitEthernet1/0/18
!
interface GigabitEthernet1/0/19
!
interface GigabitEthernet1/0/20
!
interface GigabitEthernet1/0/21
!
interface GigabitEthernet1/0/22
!
interface GigabitEthernet1/0/23
!
interface GigabitEthernet1/0/24
!
interface GigabitEthernet1/1/1
!
interface GigabitEthernet1/1/2
!
interface GigabitEthernet1/1/3
!
interface GigabitEthernet1/1/4
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 mac-address 0090.2b80.b901
 ip address 192.168.10.254 255.255.255.0
!
interface Vlan20
 mac-address 0090.2b80.b902
 ip address 192.168.20.254 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
!
end
SW#


二层交换机SA配置:

SA#show run
Building configuration...
Current configuration : 1153 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SA
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 switchport access vlan 10
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
 switchport access vlan 20
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
 switchport mode trunk
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end
SA#


二层交换机SB配置:与二层交换机SA配置相同,此处略。

此时通过PC1:192.168.10.1去ping 192.168.10.254、192.168.20.254、192.168.20.1、 192.168.20.2,发现20.1和20.2ip地址不能ping通。查看三层交换机配置,发现路由功能没有开启。

网络2.png


进入三层路由,开启路由功能。

网络3.png


再次进行测试,发现全部ping通。

网络4.png



1671585dc74035d34ac554d5f2ae42fc.jpg

推荐阅读

>>>【独家首发】新版HCIE考试解读直播回顾
>>> 重磅!华为HCIE认证改版升级通知!
>>>【命令解析】Linux用户行为的常用命令
>>> 网工必备通信基础知识,还不知道你就out了?
>>>【必备干货】网工入门必会桥接教程,外网+GNS3+Vmware
>>>【技术指南】5分钟搞清楚OSPF链路状态路由协议