VTP技术详解

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技术实验

三层交换机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通。

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值