[计算机网络】【网络设备】VTP

本文详细介绍了VTP(VLAN Trunk Protocol)在三层交换机配置中的应用,涉及VTP服务器、客户机和透明模式,以及如何通过实验配置VTP来管理和同步VLAN。通过实例展示了如何在交换机上配置VTP,解决网络中VLAN信息同步的问题。
摘要由CSDN通过智能技术生成

VTP

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

  1. 服务器模式(Server):在 VTP 服务器上能创建、修改和删除 VLAN,同时这些信息会通告给域中的其他的交换机。在默认情况下,交换机是服务器模式。每个 VTP 域必须至少有一台服务器,域中的 VTP 服务器可以有多台。
  2. 客户机模式(Llient):VTP 客户机上不允许创建、修改和删除 VLAN,但它会监听来自其他交换机的 VTP 通告并更改自己的 VLAN 信息。接收到的 VTP 信息也会在 Trunk 链路上向其他交换机转发,因此这种交换机还能充当 VTP 中继。
  3. 透明模式(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 信息反向覆盖。

2-3-2 交换机的VTP技术实验

 三层交换机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通。查看三层交换机配置,发现路由功能没有开启。

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

 

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一枚铜钱⊙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值