MSTP

一、MSTP

  1. 单生成树的弊端:
  • 部分链路vlan不通
    image
  • 不能实现负载分担
    image
  • 对于部分vlan来讲,出现次优路径的问题
    image
  1. PVST(Cisco 私有协议) per 针对与每个vlan, 都生成一个生成树

    1. PVST 最初是Cisco,每vlan生成树, PVST+ 相当于 PVST + RSTP的结合版
    2. PVST 它要维护每个vlan的生成树,交换机存在多个vlan,就会给交换机的CPU带来很大的压力
  2. MSTP,公有协议。多实例生成树。
    实例:instance
    核心理念:把每个逻辑拓扑相同的vlan,放到统一的一个实例里面来进行管理
    image

  3. MSTP 它是基于RSTP来开发的,底层就是RSTP,有相同的角色、拓扑变更机制和收敛机制
    image

二、MSTP配置实现

  1. MSTP配置需求
    为实现分别属于不同VLAN的PC访问Internet的流量能够进行负载分担,可采用MSTP来实现,VLAN1-10为一组,VLAN11-20为另一组。

  2. MSTP配置实现
    image

    SWA
    stp enable 开启STP
    stp mode mstp 将模式切换MSTP
    #创建STP的区域
    stp region-configuration
    region-name RG1 给这个区域命名
    instance 1 vlan 1 to 10 将vlan1-10划分到实例1
    instance 2 vlan 11 to 20 将vlan11-20划分到实例2
    active region-configuration 激活区域
    注:SWB、SWC、SWD配置同SWA
    image

    SWA
    stp instance 1 root primary 将SWA设置实例1为根桥
    stp instance 2 root secondary 将SWA设置实例2为副根桥

    SWB
    stp instance 2 root primary 将SWB设置实例1为根桥
    stp instance 1 root secondary 将SWB设置实例2为副根桥

    SWC
    interface GigabitEthernet0/0/2 进入GigabitEthernet0/0/2
    stp instance 2 cost 20000 将实例2通过GigabitEthernet0/0/2的路径开销设置为20000
    interface GigabitEthernet0/0/3 进入GigabitEthernet0/0/3
    stp edged-port enable 将GigabitEthernet0/0/2设置为边缘端口

    SWD
    interface GigabitEthernet0/0/2 进入GigabitEthernet0/0/2
    stp instance 1 cost 20000 将实例2通过GigabitEthernet0/0/2的路径开销设置为20000
    interface GigabitEthernet0/0/3 进入GigabitEthernet0/0/3
    stp edged-port enable 将GigabitEthernet0/0/2设置为边缘端口

  3. MSTP配置验证

  • 在SWA上查看端口状态,结果如下:
    image
  • 在SWB上查看端口状态,结果如下:
    image
posted @ 2021-04-08 20:03  纸机  阅读(416)  评论(0)    收藏  举报