计算机应用工程笔记(第九周)

计算机网络工程

作者:hingsmy
作者邮箱:hingsmy@gamail.com
本人代为发布,已征得原作者同意


2020 年 11 月 9 日 第9周

VLAN Trunking Protocol (VTP) VLAN中继协议(VTP)


  • VTP Version 1,2,3 VTP版本1,2,3
    • VTP reduces administration in a switched network. Configure a new VLAN on one VTPserver, the VLAN is distributed through all switches in the domain. VTP is aCisco-proprietary protocol. VTP减少了交换网络中的管理工作量。在一个VTP服务器上配置一个新的VLAN,该VLAN将会同步到域中的所有交换机中。 VTP是思科专有的协议。
  • VTP Server Mode VTP服务器模式
    • can create, modify, and delete VLANs and specify other configurationparameters, such as VTP version and VTP pruning, for the entire VTP domain 可以为整个VTP域创建,修改和删除VLAN并指定其他配置参数,例如VTP版本和VTP修剪
  • VTP Client Mode VTP客户端模式
    • cannot create, change, or delete VLANs on a VTP client 无法在VTP客户端上创建,更改或删除VLAN
  • VTP Transparent Mode VTP透明模式
    • does not advertise its VLAN configuration and does not synchronize its VLANconfiguration based on received advertisements, but transparent switches doforward VTP advertisements that they receive out their trunk ports in VTPVersion 2 不会发布其VLAN配置,也不会根据收到的通告同步其VLAN配置,但是透明交换机会转发VTP通告,因为它们接收了VTP版本2中的中继端口
  • Configuration Revision 配置修订
    • Each time that you make a VLAN change in a VTP device, the configurationrevision is incremented by one. 每次在VTP设备中进行VLAN更改时,configuration revision 都会增加一
    • VTP must run on Trunk port VTP必须在中继端口上运行

在一个非常大的二层网络里面,比如说你有100台或者1000台交换机的这种网络里面,如果在一台交换机上面你需要配置10个vlan,那么在一个1000台交换机的网络里面,配置量是相当大的。手动的配置vlan,工作量非常大,而且会非常耗时。那么为了解决这个问题,就引入了一种协议,这种协议的名字叫做VTP,vlan trunking protocol。

VTP的功能是让所有的交换机上面的vlan同步。 在 VTP的这种协议里面,比如说我有三台交换机连接在一起,在 vtp的协议当中,我们需要选一个交换机,选中其中任意的一个交换机,配置VTP协议的mode。

把该交换机配置成一个server,接着剩下的这些交换机可以把它配置成client。那么当我需要配置vlan的时候,我只需要去到 server上面配置。比如说在server上面创建一个vlan10,client则会自动跟server同步,也会生成同样的vlan。这样的话在一个很大的网络里面,我仅需对其中的server进行配置,整个网络的vlan信息就会同步,这是vTP的一个主要功能。

那么VTP它是思科私有的协议,VTP目前为止它有三个版本,在VTP的协议当中,每一个交换机可以承担一个角色,其中一个角色就是server。我们可以在这台当server的交换机上创建,修改和删除我们的vlan的配置。作为client的交换机,我们则不能对vlan进行任何的修改。还有一种角色叫transparent。Transparent他不会synchronize,他不会对 vlan进行一个同步,但是他会把VTP的信息继续向后传达。

在VTP当中,有个概念叫做configuration revisions,每当我们在 server上面,对vlan的信息进行一个改动,不管你是增加删除还是修改vlan的时候,只要做过一次改动,它都会做一个记录。revision,这个叫修订号,它是一个数字,从0开始,每次改动就加一,VTP协议必须要在trunk port上面才可以进行传递。

VTP 配置实验


Server:
SW(config)#vtp version 2
SW(config)#vtp mode server
SW(config)#vtp domain ccna++
SW(config)#vtp password pwd
SW(config)#do show vtp status
Client:
SW(config)#vtp version 2
SW(config)#vtp mode client
SW(config)#vtp domain ccna++
SW(config)#vtp password pwd
SW(config)#do show vtp status
Transparent:
SW(config)#vtp version 2
SW(config)#vtp mode transparent

在现实的生产环境当中,VTP协议尽量不要去使用,这个协议非常的危险,因为它会带来全局的影响,整个网络都被一个交换机的错误配置影响到。

Native VLAN


The trunk port is assigned a default port VLAN ID (PVID) for a VLAN upon whichall untagged traffic will travel. This VLAN is also called the native VLAN and isalways VLAN 1 by default, but it can be changed to any VLAN number. TrunkPort中会有一个默认的Vlan专门负责无标签的流量通过。该Vlan被称为 native vlan,通常情况下,该vlan是vlan1,但它可以被改成任何的vlan ID。

Can PCs in different VLAN talk to each other? 不同vlan中的电脑能相互通信吗?


什么是 native VLAN?

交换机和交换机之间他需要有一些交流,比如说spanning tree,这种二层的协议,这些协议是跑在 native vlan上面的,所以我们并没有对它进行定义,它默认它就会去用native vlan。

在交换机里面有一种很特别的vlan,即native vlan。当我在向外发送数据包的时候,如果这个数据包它属于native vlan,trunk port不会进行打标签。

在交换机上面,我们 native vlan 默认的是vlan1,但我们可以把它换去随便任意的一个vlan。

Native VLAN 配置实验


SW_A FaO/1 —> VLAN 10
SW_A Fa0/2 —> Trunk but Native VLAN is 10
SW_B FaO/1 ---> VLAN 20
SW_B Fa0/2 ---> Trunk but Native VLAN is 20
Disable CDP (Cisco Discovery Protocol) on both switch
Disable STP (Spanning Tree) on both switch
PC_A is able to ping PC_B
Configure Native VLAN:
interface FastEthernet0/2
switchport trunk native vlan 10
switchport mode trunk
Disable STP:
Switch(config)#no spanning-tree vlan 10

VLAN Deployment VLAN部署


End-to-end VLANs端到端VLANs
Users are grouped into VLANs independent of physical location. If usersare moved within the campus, their VLAN membership remains the same.用户分为与物理位置无关的VLAN。如果用户在园区内移动,则其VLAN身份保持不变。

Local VLANs (recommended) 本地VLANs(推荐)
Users are grouped into VLANs depending of physical location. If Users aremoved within the campus, their VLAN membership changes. 根据物理位置将用户分为不同的VLAN。如果用户在园区内移动,则其VLAN身份也会更改。


vlan的设计有两种,一种称之为end to end,即端到端的vlan设计方式,一种叫做local本地vlan。

这两种设计方案优缺点有哪些?end to end的这种设计方案相当的简单明了,只要是一个部门的人,不管在哪里都在同一个vlan里面,用二层交换机就可以实现。local vlan这种设计,要用三层交换机才可以实现。

从价格上来说,二层交换机比三层交换机要便宜,所以end to end的vlan设计成本小。

end to end这种设计它有一个问题,它创造出了一个很大的广播域,任何一点出问题整个广播域都会受影响。local vlan这种设计,每一栋楼它都在自己的vlan里面,所以基于这些优缺点的考虑,一般情况下,我们会采用这种local vlan的设计方案。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值