H3C MSTP 实验
实验拓扑
实验需求
- 所有交换机上创建 Vlan10,Vlan20,Vlan30 和 Vlan40
- 所有交换机之间的端口配置为 Trunk,并放行相关 VLAN
- 按照图示分区域配置 MSTP,并配置主备根网桥
实验步骤
VLAN基础配置(略)
在所有交换机上创建 Vlan10,Vlan20,Vlan30 和 Vlan40
在所有交换机之间的端口配置为 Trunk,并放行Vlan10,Vlan20,Vlan30 和 Vlan40
#
vlan 10
#
vlan 20
#
vlan 30
#
vlan 40
#
interface GigabitEthernet1/0/1port link-type trunkundo port trunk permit vlan 1port trunk permit vlan 10 20 30 40
#
interface GigabitEthernet1/0/2port link-type trunkundo port trunk permit vlan 1port trunk permit vlan 10 20 30 40
#
interface GigabitEthernet1/0/3port link-type trunkundo port trunk permit vlan 1port trunk permit vlan 10 20 30 40
#
interface GigabitEthernet1/0/4port link-type trunkundo port trunk permit vlan 1port trunk permit vlan 10 20 30 40
#
按照图示分区域配置 MSTP,并配置主备根网桥
分析
根据图示,网络中存在 3 个 MST 区域。交换机属于同一个 MST 区域的必要条件是域名、修订级别、实例和 VLAN 的映射关系一致,所以SW1,SW2,SW3 的配置需要一致,SW4,SW5,SW6 的配置一致,SW7 单独配置
另外,根据需求,H3C1 区域中的 实例1 映射 Vlan10 和 Vlan20,实例2 映射 Vlan30 和 Vlan40;SW1 和 SW2 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0
H3C2 区域中的 实例1 映射 Vlan10,实例2 映射 Vlan20,SW4 和 SW6 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0
H3C3 区域中的 实例1 映射 Vlan20,实例2 映射 Vlan40,SW7 为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0
SW1,SW2,SW3 的MST配置
[SW1]stp region-configuration
[SW1-mst-region]region-name H3C1
[SW1-mst-region]revision-level 1
[SW1-mst-region]instance 1 vlan 10 20
[SW1-mst-region]instance 2 vlan 30 40
[SW1-mst-region]active region-configuration [SW2]stp region-configuration
[SW2-mst-region] region-name H3C1
[SW2-mst-region] revision-level 1
[SW2-mst-region] instance 1 vlan 10 20
[SW2-mst-region] instance 2 vlan 30 40
[SW2-mst-region] active region-configuration[SW3]stp region-configuration
[SW3-mst-region] region-name H3C1
[SW3-mst-region] revision-level 1
[SW3-mst-region] instance 1 vlan 10 20
[SW3-mst-region] instance 2 vlan 30 40
[SW3-mst-region] active region-configuration
在 SW1 上配置为 实例1 的主根和 实例2 的备份根
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary
在 SW2 上配置为 实例1 的备份根和 实例2 的主根
[SW2]stp instance 1 root secondary
[SW2]stp instance 2 root primary
SW4,SW5,SW6 的MST配置
[SW4]stp region-configuration
[SW4-mst-region] region-name H3C2
[SW4-mst-region] revision-level 2
[SW4-mst-region] instance 1 vlan 10
[SW4-mst-region] instance 2 vlan 30
[SW4-mst-region] active region-configuration[SW5]stp region-configuration
[SW5-mst-region] region-name H3C2
[SW5-mst-region] revision-level 2
[SW5-mst-region] instance 1 vlan 10
[SW5-mst-region] instance 2 vlan 30
[SW5-mst-region] active region-configuration[SW6]stp region-configuration
[SW6-mst-region] region-name H3C2
[SW6-mst-region] revision-level 2
[SW6-mst-region] instance 1 vlan 10
[SW6-mst-region] instance 2 vlan 30
[SW6-mst-region] active region-configuration
在 SW4 上配置为 实例1 的主根和 实例2 的备份根
[SW4]stp instance 1 root primary
[SW4]stp instance 2 root secondary
在 SW6 上配置为 实例1 的备份根和 实例2 的主根
[SW6]stp instance 1 root secondary
[SW6]stp instance 2 root primary
SW7 MST配置
[SW7]stp region-configuration
[SW7-mst-region] region-name H3C3
[SW7-mst-region] revision-level 3
[SW7-mst-region] instance 1 vlan 20
[SW7-mst-region] instance 2 vlan 40
[SW7-mst-region] active region-configuration
实验验证
查询各交换STP端口状态
[SW1]display stp brief MST ID Port Role STP State Protection0 GigabitEthernet1/0/1 DESI FORWARDING NONE0 GigabitEthernet1/0/2 DESI FORWARDING NONE1 GigabitEthernet1/0/1 DESI FORWARDING NONE1 GigabitEthernet1/0/2 DESI FORWARDING NONE2 GigabitEthernet1/0/1 ROOT FORWARDING NONE2 GigabitEthernet1/0/2 DESI FORWARDING NONE
[SW2]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ROOT FORWARDING NONE0 GigabitEthernet1/0/2 DESI FORWARDING NONE1 GigabitEthernet1/0/1 ROOT FORWARDING NONE1 GigabitEthernet1/0/2 DESI FORWARDING NONE2 GigabitEthernet1/0/1 DESI FORWARDING NONE2 GigabitEthernet1/0/2 DESI FORWARDING NONE
[SW3]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ROOT FORWARDING NONE0 GigabitEthernet1/0/2 ALTE DISCARDING NONE0 GigabitEthernet1/0/3 DESI FORWARDING NONE0 GigabitEthernet1/0/4 DESI FORWARDING NONE1 GigabitEthernet1/0/1 ROOT FORWARDING NONE1 GigabitEthernet1/0/2 ALTE DISCARDING NONE1 GigabitEthernet1/0/3 DESI FORWARDING NONE1 GigabitEthernet1/0/4 DESI FORWARDING NONE2 GigabitEthernet1/0/1 ALTE DISCARDING NONE2 GigabitEthernet1/0/2 ROOT FORWARDING NONE2 GigabitEthernet1/0/3 DESI FORWARDING NONE2 GigabitEthernet1/0/4 DESI FORWARDING NONE
[SW4]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ROOT FORWARDING NONE0 GigabitEthernet1/0/2 DESI FORWARDING NONE0 GigabitEthernet1/0/3 DESI FORWARDING NONE1 GigabitEthernet1/0/1 MAST FORWARDING NONE1 GigabitEthernet1/0/2 DESI FORWARDING NONE1 GigabitEthernet1/0/3 DESI FORWARDING NONE2 GigabitEthernet1/0/1 MAST FORWARDING NONE2 GigabitEthernet1/0/2 DESI FORWARDING NONE2 GigabitEthernet1/0/3 ROOT FORWARDING NONE
[SW5]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ROOT FORWARDING NONE0 GigabitEthernet1/0/2 DESI FORWARDING NONE1 GigabitEthernet1/0/1 ROOT FORWARDING NONE1 GigabitEthernet1/0/2 ALTE DISCARDING NONE2 GigabitEthernet1/0/1 ALTE DISCARDING NONE2 GigabitEthernet1/0/2 ROOT FORWARDING NONE
[SW6]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ALTE DISCARDING NONE0 GigabitEthernet1/0/2 ROOT FORWARDING NONE0 GigabitEthernet1/0/3 DESI FORWARDING NONE1 GigabitEthernet1/0/1 DESI FORWARDING NONE1 GigabitEthernet1/0/2 ROOT FORWARDING NONE1 GigabitEthernet1/0/3 DESI FORWARDING NONE2 GigabitEthernet1/0/1 DESI FORWARDING NONE2 GigabitEthernet1/0/2 DESI FORWARDING NONE2 GigabitEthernet1/0/3 DESI FORWARDING NONE
[SW7]display stp briefMST ID Port Role STP State Protection0 GigabitEthernet1/0/1 ROOT FORWARDING NONE0 GigabitEthernet1/0/2 ALTE DISCARDING NONE1 GigabitEthernet1/0/1 MAST FORWARDING NONE1 GigabitEthernet1/0/2 ALTE DISCARDING NONE2 GigabitEthernet1/0/1 MAST FORWARDING NONE2 GigabitEthernet1/0/2 ALTE DISCARDING NONE
描绘STP拓扑
实例0 STP拓扑
实例1 STP拓扑
实例2 STP拓扑
实验附件
H3C MSTP实验.zip
STP拓扑.drawio