Cyber_Security_Notes/A. 第一阶段/拓扑练习/0821_MSTP.md
2024-08-22 11:54:55 +08:00

130 lines
3.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MSTP
![image-20240821193420313](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240821193420313.png)
### 一、配置
- **SW1**
```
<Huawei>u t m
<Huawei>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
<SW1>save
```
- **SW2**
```
<Huawei>u t m
<Huawei>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
<SW2>save
```
- **SW3**
```
<Huawei>u t m
<Huawei>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
<SW3>save
```
### 二、测试
- **SW1**
```
<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
<SW1>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**
```
<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
<SW2>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**
```
<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
<SW3>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
```