【网络】· VTP虚拟局域网中继

编程入门 行业动态 更新时间:2024-10-08 02:28:24

【网络】· VTP虚拟<a href=https://www.elefans.com/category/jswz/34/1769448.html style=局域网中继"/>

【网络】· VTP虚拟局域网中继

目录

🍉VTP技术

🍉以太网通道配置

🍒sw1配置

🍒sw2配置

🍉VTP工作原理

🍒VTP模式

🍒VTP通告

🍒VTP的版本

🍒VTP修改编号

🍒VTP通告类型

🍒VTP修剪

🍒VTP前置

🍉VTP配置命令

🍉VTP实例

🍉TCP/IP总结


     🦐博客主页:大虾好吃吗的博客

     🦐专栏地址:网络专栏

VTP技术

        这个技术是Cisco的私有协议,在网络的核心之间,需要两条链路能够实现负载均衡,提高链路带宽、并能够相互备份。这时就需要了解EthernetChannel,它通过捆绑多条以太网链路来提高链路带宽,并运行一种机制,将多个以太网端口捆绑成一个逻辑链路。以太网通道最多可以捆绑八条物理链路,其中物理链路可以使双绞线也是可以是光纤的。

以太网通道遵循以下规则。

1. 参与捆绑的端口必须是同一个VLAN,或把它们配置为中继端口。

2. 端口配置的是中继模式,那么两端都应配置为相同的中继模式。所需要的端口支持相同的VLAN范围,,如果VLAN许可范围不一致,则端口不属于以太网通道。

3. 所有参与绑定的端口物理配置必须相同,应有同样的速度和双工模式。

以太网通道配置

sw1配置

Switch(config)#int r f0/1 - 2
Switch(config-if-range)#channel-group 1 mode on

sw2配置

Switch(config)#int r f0/1 - 2
Switch(config-if-range)#channel-group 1 mode on

注:channel-group 后面的1是组号(1-6)

查看

Switch#show etherchannel summary
Flags:  D - down        P - in port-channelI - stand-alone s - suspendedH - Hot-standby (LACP only)R - Layer3      S - Layer2U - in use      f - failed to allocate aggregatoru - unsuitable for bundlingw - waiting to be aggregatedd - default port
​
​
Number of channel-groups in use: 1
Number of aggregators:           1
​
Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------
​
1      Po1(SU)           -      Fa0/1(P) Fa0/2(P) 

VTP工作原理

        VTP(VLAN Trunking Protocol,虚拟局域网中继协议),通过VTP协议,交换机之间可以相互传递VLAN信息,从而实现VLAN的统一配置和统一管理。VTP是一种消息协议,它使用第二层帧,在交换机之间传递信息,被称为VTP通过。有了VTP就可以在一台交换机上集中修改VLAN配置,所做的修改会自动传播到网络中的其他交换机上,从而实现VLAN配置的一致性。

        实现该功能的前提是这些交换机都在同一个VTP域中。

        VTP域也称为VLAN管理域,有一个以上共享VTP域名的相互连接的交换机组成。

配置VTP域的要求如下:

每台交换机使用相同的VTP域名,并且是相邻的。

在交换机之间必须配置为中继链路。

VTP模式

服务器模式:每个VTP域中至少有一个服务器模式的主机,以便创建、删除、修改VLAN及提供VLAN信息。

客户机模式:不允许创建、删除等操作,监听本域中的VTP通告,并修改自己的VTP配置。

透明模式:透明模式的交换机不参与VTP,可以自行修改本身的VLAN配置,但是不向外通告自己的VLAN配置信息。

VTP通告

在使用VTP时,加入VTP域的每台交换机在中继端口上通告下面信息。

管理域。

版本号。

配置修改编号。

它所知道的VLAN。

每个已知的VLAN的某些参数。

VTP的版本

        在VTP管理域中,有两个版本可以采用,分别是1和2,两个版本不能相互操作,所以在同一个VYP域中,每台交换机的域必须配置相同的VTP版本。

VTP修改编号

        通知VTP功能的一项关键参数就是VTP配置修改编号。修改编号是一个32位的数字,从0开始,每修改一次配置,编号就增加1 ,直到4294967295,然后循环归0重新增加。

VTP通告类型

汇总通告

子集通告

通告请求

VTP修剪

        VTP修剪能减少中继链路上不必要的广播流量。VTP通告修剪没必要扩散的流量,从而可以提高中继链路的带宽利用率。

VTP前置

配置VTP前需要先考虑到当前网络环境中的基本任务。

1.考虑VTP运行的版本

2.使用已有域还是新建域

3.考虑交换机的VTP工作模式

4.是否启用修剪功能

VTP配置命令

1、创建VTP域

Switch(config)#vtp domain 域名

2、配置交换机VTP模式

Switch(config)#vtp mode {server | client | transparent}

注:三种工作模式

3、配置VTP口令

Switch(config)#vtp password 密码

4、配置VTP修剪

Switch(config)#vtp pruning

5、配置VTP版本

Switch(config)#vtp version 2

注:默认版本为1,通过上面命令指定2版本

6、查看VTP配置信息

查看VTP口令

Switch#show vtp password 

查看VTP配置信息

Switch#show vtp status

VTP实例

        根据下方拓扑图部署,sw1位server模式,sw2和sw3为client模式,在sw1上配置VLAN,sw1和sw2学习sw1的VLAN信息。

配置sw1的VTP

Switch>en
Switch#conf t
Switch(config)#host sw1             #修改主机名
sw1(config)#vtp domain test         #创建sete域
sw1(config)#vtp mode server         #指定工作模式
sw1(config)#int f0/24               #进入0/24接口
sw1(config-if)#sw m t               #配置为trunk

配置sw2的VTP

Switch>en
Switch#conf t
Switch(config)#host sw2
sw2(config)#vtp domain test
sw2(config)#vtp mode client
sw2(config)#int f0/24
sw2(config-if)#sw m t
sw2(config-if)#int f0/23
sw2(config-if)#sw m t

配置sw3的VTP

Switch>en
Switch#conf t
Switch(config)#host sw3
sw3(config)#vtp domain test
sw3(config)#vtp mode client
sw3(config)#int f0/23
sw3(config-if)#sw m t

在sw1上创建vlan2和vlan3,名称分别为name_a和name_b。

sw1(config-if)#exit
sw1(config)#vlan 2
sw1(config-vlan)#name name_a
sw1(config-vlan)#vlan 3
sw1(config-vlan)#name name_b

将端口2、3添加到vlan2,将4、5添加到vlan3,下面用的是简写命令,详情查看前面的文章。

sw1(config-vlan)#exit
sw1(config)#int r f 0/2 - 3
sw1(config-if-range)#sw a v 2
sw1(config-if-range)#int r f 0/4 - 5
sw1(config-if-range)#sw a v 3

配置sw1的管理ip地址

sw1(config-if-range)#int vlan 1
sw1(config-if)#ip add 192.168.1.1 255.255.255.0
sw1(config-if)#no sh

查看sw1上的VLAN信息

sw1(config-if)#end
​
sw1#show vlan brief
​
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Fa0/23, Gig0/1Gig0/2
2    name_a                           active    Fa0/2, Fa0/3
3    name_b                           active    Fa0/4, Fa0/5
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active 

查看sw1的VTP状态

sw1#show vtp status
VTP Version                     : 2             #VTP支持的版本
Configuration Revision          : 4             #修改编号
Maximum VLANs supported locally : 255           #最大VLAN数
Number of existing VLANs        : 7 
VTP Operating Mode              : Server        #VTP模式
VTP Domain Name                 : test          #域名
VTP Pruning Mode                : Disabled      #VTP修剪
VTP V2 Mode                     : Disabled      #没有开启VTP版本2
VTP Traps Generation            : Disabled
MD5 digest                      : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28   #MD5摘要信息
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45                   #更新者
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)

查看sw2的VLAN信息

sw2#show vlan brief 
​
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Gig0/1, Gig0/2
2    name_a                           active    
3    name_b                           active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active   

        通过查看上面的信息,可以看到sw2已经学到了VLAN2和VLAN3,名称也是一样的,但是它并不学习VLAN中的端口。

再看下面sw2的VTP信息,和sw1上查到的基本一致。

在sw2上查看VTP状态

sw2#show vtp status
VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28 
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45

配置VTP口令

sw1#conf t
sw1(config)#vtp password 123

配置VTP口令后,修改VLAN配置,添加VLAN4,

sw1#vlan data
sw1(vlan)#vlan 4 name name_c
VLAN 4 added:Name: name_c

查看sw1的VTP信息

sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#show vtp status
VTP Version                     : 2
Configuration Revision          : 8
Maximum VLANs supported locally : 255
Number of existing VLANs        : 8
VTP Operating Mode              : Server
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xAC 0xFC 0x0A 0x55 0xFE 0x26 0x93 0x02 
Configuration last modified by 192.168.1.1 at 3-1-93 00:46:18
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)

查看sw2,因为没配置口令,sw1发出的VTP更新通告被sw2忽略,所以查到的信息还是上次的。

sw2#show vtp status
VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28 
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45

查看sw2的vlan信息,没有学习到vlan4

sw2#show vlan brief 
​
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Gig0/1, Gig0/2
2    name_a                           active    
3    name_b                           active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    

在sw2上配置VTP口令

sw2#conf t
sw2(config)#vtp password 123

在来查看sw2的VTP信息和VLAN信息,这时数据都过来了。

sw2(config)#exit
​
sw2#show vtp status
VTP Version                     : 2
Configuration Revision          : 8
Maximum VLANs supported locally : 255
Number of existing VLANs        : 8
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xAC 0xFC 0x0A 0x55 0xFE 0x26 0x93 0x02 
Configuration last modified by 192.168.1.1 at 3-1-93 00:46:18
​
sw2#show vlan brief 
​
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Gig0/1, Gig0/2
2    name_a                           active    
3    name_b                           active    
4    name_c                           active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active  

TCP/IP总结

        在工作环境中,相信很多人都看到了,我们实际用到的大多数还是huawei设备,也有一些使用cisco或其他设备。但是整篇文章的意义是讲解该设备的工作原理,总结出各个设备的长处和短处也是一种谈资。比如,文章前面写的布线和网络模型,以及单臂路由和链路类型,原理上华为和cisco基本相同。后面也会根据博主自身时间,继续针对cisco和huawei、H3C总结各种网络设备的原理和实例,所以本专栏TCP/IP就此完结,我们下一个专栏见。

更多推荐

【网络】· VTP虚拟局域网中继

本文发布于:2024-02-07 10:13:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1756581.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:局域网   网络   VTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!