PLEASE:
STP-Spanning Tree Protocol (Spanning Tree Protocol)
1. Logically disconnect the loop to prevent broadcast storms.
2. When the line fails, the blocking interface is activated to restore communication and play a backup role
The generation of switching network loops:
The formation of broadcast storm
Multi-frame replication
MAC address disorder
Spanning Tree Algorithm
The spanning tree algorithm is divided into three steps:
1. Select the root bridge (switch)
2. Select the root port
3. Select the designated port
Excluding the root port and designated ports, the rest is blocked ports
MSTP:
Multiple Spanning Tree Protocol—A spanning tree can be constructed for each VLAN or multiple VLANs as a group to achieve network load sharing (balance)
-----------将SW1、SW2分别做vlan10、vlan20的根网桥----------
[SW1]stp mode mstp ###将交换机配置成MSTP模式,MSTP兼容STP/RSTP。
[SW1]stp region-configuration ###进入MSTP域视图MSTP配置模式
[SW1-mst-region]region-name huawei1 ###配置MSTP域的域名为huawei1,缺省为交换设备主控板上管理网口的MAC地址。
[SW1-mst-region]revision-level 1 ###配置MST域的MSTP修订级别为1,缺省情况下MSTP域的MSTP修订级别为0,需要将各设备的MSTP修订级别修改为一致
####配置多生成树实例和VLAN的映射关系,同一vlan的数据只能对应一个实例,而一个实例可以对应多个vlan(instance 1 vlan 2 to 10)
[SW1-mst-region]instance 1 vlan 10 ###将vlan 10加入实例1中
[SW1-mst-region]instance 2 vlan 20 ###将vlan 20加入实例2中
[SW1-mst-region]check region-configuration ###查看MSTP域配置参数
[SW1-mst-region]active region-configuration ###激活MSTP域的配置(必须配置)
[SW1-mst-region]quit ###退出配置模式
[SW1]stp instance 1 root primary ###配置此交换机为实例1的主根桥
[SW1]stp instance 2 root secondary ###配置此交换机为实例2的备份根桥
------------------------------
[SW2]stp mode mstp
[SW2]stp region-configuration
[SW2-mst-region]region-name huawei1
[SW2-mst-region]revision-level 1
[SW2-mst-region]instance 1 vlan 10
[SW2-mst-region]instance 2 vlan 20
[SW2-mst-region]active region-configuration
[SW2-mst-region]quit
[SW2]stp instance 1 root secondary ###配置SW1交换机为实例1的备份根桥
[SW2]stp instance 2 root primary ###配置SW2交换机为实例2的主根桥
-----------------------------------
[SW3]stp mode mstp
[SW3]stp region-configuration
[SW3-mst-region]region-name huawei1
[SW3-mst-region]revision-level 1
[SW3-mst-region]instance 1 vlan 10
[SW3-mst-region]instance 2 vlan 20
[SW3-mst-region]active region-configuration
[SW1]stp enable ###在所有交换机上启用MSTP
[SW2]stp enable
[SW3]stp enable
[SW3]dis stp brief ###查看STP接口角色及状态信息
--------修改交换机优先级值----------------
[SW1]stp priority 0 ###数值要为4096的倍数
[SW1]stp root primary ###优先级变为0
[SW1]dis stp ###查看stp信息,可以确定哪个是根网桥