# MSTP ![image-20240821193420313](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240821193420313.png) ### 一、配置 - **SW1** ``` u t m sy [Huawei]sy SW1 [SW1]vlan batch 10 20 [SW1]port-group 1 [SW1-port-group-1]group-member g0/0/1 g0/0/2 [SW1-port-group-1]port link-type trunk [SW1-port-group-1]port trunk allow-pass vlan 10 20 [SW1-port-group-1]quit [SW1]stp mode mstp [SW1]stp region-configuration [SW1-mst-region]region-name ntd [SW1-mst-region]instance 1 vlan 10 [SW1-mst-region]instance 2 vlan 20 [SW1-mst-region]active region-configuration [SW1]stp instance 1 priority 4096 [SW1]quit save ``` - **SW2** ``` u t m sy [Huawei]sy SW2 [SW2]vlan batch 10 20 [SW2]port-group 1 [SW2-port-group-1]group-member g0/0/1 g0/0/2 [SW2-port-group-1]port link-type trunk [SW1-port-group-1]port trunk allow-pass vlan 10 20 [SW2-port-group-1]quit [SW2]stp mode mstp [SW2]stp region-configuration [SW2-mst-region]region-name ntd [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 2 priority 4096 [SW2]quit save ``` - **SW3** ``` u t m sy [Huawei]sy SW3 [SW3]vlan batch 10 20 [SW3]int g0/0/1 [SW3-GigabitEthernet0/0/1]port link-type access [SW3-GigabitEthernet0/0/1]port default vlan 10 [SW3-GigabitEthernet0/0/1]int g0/0/2 [SW3-GigabitEthernet0/0/2]port link-type access [SW3-GigabitEthernet0/0/2]port default vlan 20 [SW3-GigabitEthernet0/0/2]quit [SW3]port-group 1 [SW3-port-group-1]group-member g0/0/3 g0/0/4 [SW3-port-group-1]port link-type trunk [SW3-port-group-1]port trunk allow-pass vlan 10 20 [SW3-port-group-1]quit [SW3]stp mode mstp [SW3]stp region-configuration [SW3-mst-region]region-name ntd [SW3-mst-region]instance 1 vlan 10 [SW3-mst-region]instance 2 vlan 20 [SW3-mst-region]active region-configuration [SW3-mst-region]quit [SW3]quit save ``` ### 二、测试 - **SW1** ``` dis stp ins 1 b MSTID Port Role STP State Protection 1 GigabitEthernet0/0/1 DESI FORWARDING NONE 1 GigabitEthernet0/0/2 DESI FORWARDING NONE dis stp ins 2 b MSTID Port Role STP State Protection 2 GigabitEthernet0/0/1 ALTE DISCARDING NONE 2 GigabitEthernet0/0/2 ROOT FORWARDING NONE ``` - **SW2** ``` dis stp ins 1 b MSTID Port Role STP State Protection 1 GigabitEthernet0/0/1 ALTE DISCARDING NONE 1 GigabitEthernet0/0/2 ROOT FORWARDING NONE dis stp ins 2 b MSTID Port Role STP State Protection 2 GigabitEthernet0/0/1 DESI FORWARDING NONE 2 GigabitEthernet0/0/2 DESI FORWARDING NONE ``` - **SW3** ``` dis stp ins 1 b MSTID Port Role STP State Protection 1 GigabitEthernet0/0/1 DESI FORWARDING NONE 1 GigabitEthernet0/0/3 ROOT FORWARDING NONE 1 GigabitEthernet0/0/4 DESI FORWARDING NONE dis stp ins 2 b MSTID Port Role STP State Protection 2 GigabitEthernet0/0/2 DESI FORWARDING NONE 2 GigabitEthernet0/0/3 DESI FORWARDING NONE 2 GigabitEthernet0/0/4 ROOT FORWARDING NONE ```