构建实验拓扑
实验思路:在4台交换机上分别创建一个相同的MST域,然后指定不同vlan的根网桥。这里分别用SW1和SW3作为vl10与vl20的根网桥,实现负载均衡。
LWS1配置
[Huawei]stp region-configuration //进入MST视图
[Huawei-mst-region]region-name q1 //创建一个名为q1的区域
[Huawei-mst-region]instance 1 vl 10 //将vlan10生成一个生成树
[Huawei-mst-region]instance 2 vlan 20 //将vlan20生成一个生成树
[Huawei-mst-region]active region-configuration //激活MST域配置
[Huawei-mst-region]q
设置主备交换机
[Huawei]stp instance 1 root primary
[Huawei]stp instance 2 root secondary
[Huawei]stp pathcost-standard legacy
[Huawei]stp enable
[Huawei-Ethernet0/0/2]stp root-protection
[Huawei-Ethernet0/0/2]q
创建多个vlan,并且对应接口绑定不同的链路
[Huawei]vl batch 10 20
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port link tr
[Huawei-Ethernet0/0/2]port tr al vl al
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link tr
[Huawei-Ethernet0/0/3]port tr al vl al
[Huawei-Ethernet0/0/3]q
查询stp状态
[Huawei]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING NONE
0 Ethernet0/0/2 DESI FORWARDING ROOT
0 Ethernet0/0/3 ROOT FORWARDING NONE
1 Ethernet0/0/2 DESI FORWARDING ROOT
1 Ethernet0/0/3 DESI FORWARDING NONE
2 Ethernet0/0/2 DESI FORWARDING ROOT
2 Ethernet0/0/3 ROOT FORWARDING NONE
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link tr
[Huawei-Ethernet0/0/1]port tr al vl al
[Huawei-Ethernet0/0/1]q
[Huawei]q
LSW3配置
[Huawei]stp region-configuration
[Huawei-mst-region]region-name q1
[Huawei-mst-region]instance 1 vl 10
[Huawei-mst-region]instance 2 vl 20
[Huawei-mst-region]active region-configuration
[Huawei-mst-region]q
[Huawei]stp instance 2 root primary
[Huawei]stp instance 1 root secondary
[Huawei]stp pathcost-standard legacy
[Huawei]stp enable
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]stp root-protection
[Huawei-Ethernet0/0/2]q
[Huawei]vlan batch 10 20
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port link tr
[Huawei-Ethernet0/0/3]port tr al vl al
[Huawei-Ethernet0/0/3]int e0/0/2
[Huawei-Ethernet0/0/2]port link tr
[Huawei-Ethernet0/0/2]port tr al vl al
[Huawei-Ethernet0/0/2]int e0/0/1
[Huawei-Ethernet0/0/1]port link tr
[Huawei-Ethernet0/0/1]port tr al vl al
[Huawei-Ethernet0/0/1]q
Lsw2配置
[Huawei]stp region-configuration
[Huawei-mst-region]region-name q1
[Huawei-mst-region]instance 1 vl 10
[Huawei-mst-region]instance 2 vl 20
[Huawei-mst-region]active region-configuration
[Huawei-mst-region]q
[Huawei]stp pathcost-standard legacy
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]stp instance 1 cost 20000
[Huawei-Ethernet0/0/2]q
[Huawei]stp en
[Huawei]stp enable
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]stp disable
[Huawei-Ethernet0/0/3]q
[Huawei]vl batch 10 20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link tr
[Huawei-Ethernet0/0/1]port tr al vl al
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link tr
[Huawei-Ethernet0/0/2]port tr al vl al
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link ac
[Huawei-Ethernet0/0/3]port de vl 10
[Huawei-Ethernet0/0/3]q
[Huawei]display stp brief
LSW4配置
[Huawei]stp region-configuration
[Huawei-mst-region]region-name q1
[Huawei-mst-region]instance 1 vl 10
[Huawei-mst-region]instance 2 vl 20
[Huawei-mst-region]active region-configuration
[Huawei-mst-region]q
[Huawei]stp pathcost-standard legacy
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]stp instance 2 cost 20000
[Huawei-Ethernet0/0/2]q
[Huawei]stp enable
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]stp disable
[Huawei-Ethernet0/0/3]q
[Huawei]vlan batch 10 20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link tr
[Huawei-Ethernet0/0/1]port tr al vl al
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link tr
[Huawei-Ethernet0/0/2]port tr al vl al
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link ac
[Huawei-Ethernet0/0/3]port de vl 20
[Huawei-Ethernet0/0/3]q
[Huawei]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 ROOT FORWARDING NONE
0 Ethernet0/0/2 DESI FORWARDING NONE
1 Ethernet0/0/1 ROOT FORWARDING NONE
1 Ethernet0/0/2 ALTE DISCARDING NONE
2 Ethernet0/0/1 ROOT FORWARDING NONE
2 Ethernet0/0/2 DESI FORWARDING NONE
R1配置
[Huawei]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.1]ip add 1.1.1.1 24
[Huawei-GigabitEthernet0/0/0.1]q
[Huawei]int g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/1.1]arp broadcast enable
[Huawei-GigabitEthernet0/0/1.1]ip add 2.1.1.1 24