- stp只能实现不同VLAN阻塞相同端口,不能实现VLAN分流;
概述
- 多生成树协议MSTP(Multiple Spanning Tree Protocol)是IEEE 802.1s中定义的生成树协议,通过生成多个生成树,来解决以太网环路问题。
作用
- 形成多棵无环路的树,解决广播风暴并实现冗余备份。
- 多棵生成树在VLAN间实现负载均衡,不同VLAN的流量按照不同的路径转发。
实现
- 将不同的VLAN流量添加到不同编号的生成树中,形成多生成数环境,不同生成树可以阻塞不同端口,从而达到VLAN分流效果;
命令
- 进入STP配置域
stp region-configuration - 设置域名称
region-name 名称 - 创建实例(实例编号取值范围:0~48),确定是承载的VLAN编号
instance 实例编号 vlan VLAN编号 - 应用配置(S5700需要执行该命令,CE交换机直接执行
commit)
active region-configuration - 设置根网桥
stp instance 编号 root primary - 查看指定实例信息
dis stp instance 编号 - 开启STP功能(CE交换机)
stp enable - 设置STP模式为MSTP(CE交换机)
stp mode mstp
LSW1:
sysvlan batch 10 20int g0/0/1p l tp t a v 10 20int g0/0/2p l tp t a v 10 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configurationqstp instance 1 root primary
LSW2:
sysvlan batch 10 20int g0/0/2p l tp t a v 10 20int g0/0/1p l tp t a v 10 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configurationqstp instance 2 root primary
LSW3:
sysvlan batch 10 20int g0/0/1p l tp t a v 10 20int g0/0/2p l tp t a v 10 20int g0/0/3p l ap d v 10int g0/0/4p l ap d v 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configuration
LSW4:
sysvlan batch 10 20int g0/0/1p l tp t a v 10 20int g0/0/2p l tp t a v 10 20int g0/0/3p l ap d v 10int g0/0/4p l ap d v 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configuration
CE案例
CE1:
sysvlan batch 10 20commitint g1/0/0undo shutdowncommitp l tp t a v 10 20commitint g1/0/1undo shutdowncommitp l tp t a v 10 20commitqstp enableycommitstp mode mstpcommitstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20commitqstp instance 1 root primarycommit
CE2:
sysvlan batch 10 20commitint g1/0/0undo shutdowncommitp l tp t a v 10 20commitint g1/0/1undo shutdowncommitp l tp t a v 10 20commitqstp enableycommitstp mode mstpcommitstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20commitqstp instance 2 root primarycommit
LSW3:
sysvlan batch 10 20int g0/0/1p l tp t a v 10 20int g0/0/2p l tp t a v 10 20int g0/0/3p l ap d v 10int g0/0/4p l ap d v 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configuration
LSW4:
sysvlan batch 10 20int g0/0/1p l tp t a v 10 20int g0/0/2p l tp t a v 10 20int g0/0/3p l ap d v 10int g0/0/4p l ap d v 20qstp region-configurationregion-name M1instance 1 vlan 10instance 2 vlan 20active region-configuration