MSTP(多生成树协议)PC1
IPv4配置
静态
IP地址:192.168.10.10
子网掩码:255.255.255.0
网关:192.168.10.1
PC2
静态
IP地址:192.168.20.10
子网掩码:255.255.255.0
网关192.168.20.1
LSW3
undo terminal monitor
system-view
[Huawei]sysname SW3
[SW3]user-interface console 0
[SW3-ui-console0]idle-timeout 0 0
[SW3-ui-console0]quit
[SW3]vlan batch 10 20
[SW3]interface Ethernet 0/0/3
[SW3-Ethernet0/0/3]port hybrid pvid vlan 10
[SW3-Ethernet0/0/3]port hybrid untagged vlan 10 20
[SW3-Ethernet0/0/3]quit
[SW3] interface Ethernet 0/0/4
[SW3-Ethernet0/0/4]port hybrid pvid vlan 20
[SW3-Ethernet0/0/4]port hybrid untagged vlan 10 20
[SW3-Ethernet0/0/4]quit
[SW3] interface Ethernet 0/0/1
[SW3-Ethernet0/0/1]port hybrid pvid vlan 10
[SW3-Ethernet0/0/1]port hybrid untagged vlan 10 20
[SW3-Ethernet0/0/1]quit
[SW3] interface Ethernet 0/0/2
[SW3-Ethernet0/0/2]port hybrid pvid vlan 20
[SW3-Ethernet0/0/2]port hybrid untagged vlan 10 20
[SW3-Ethernet0/0/2]quit
[SW3]stp mode mstp
[SW3]stp region-configuration
[SW3-mst-region]region-name huawei
[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
LWS1
undo terminal monitor
system-view
[Huawei]sysname SW1
[SW1]user-interface console 0
[SW1-ui-console0]idle-timeout 0 0
[SW1-ui-console0]quit
[SW1]vlan batch 10 20
[SW1] interface Ethernet 0/0/1
[SW1-Ethernet0/0/1]port hybrid pvid vlan 10
[SW1-Ethernet0/0/1]port hybrid untagged vlan 10 20
[SW1-Ethernet0/0/1]quit
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[SW1-GigabitEthernet0/0/1]port hybrid untagged vlan 10 20
[SW1-GigabitEthernet0/0/1]quit
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/2]quit
[SW1]stp mode mstp
[SW1]stp region-configuration
[SW1-mst-region]region-name Huawei
[SW1-mst-region]revision-level 1
[SW1-mst-region]instance 1 vlan 10
[SW1-mst-region]instance 2 vlan 20
[SW1-mst-region]active region-configuration
[SW1-mst-region]quit
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary
LSW2
undo terminal monitor
system-view
[Huawei]sysname SW2
[SW2]user-interface console 0
[SW2-ui-console0]idle-timeout 0 0
[SW2-ui-console0]quit
[SW2]vlan batch 10 20
[SW2]int e0/0/1
[SW2-Ethernet0/0/1]port hybrid pvid vlan 20
[SW2-Ethernet0/0/1]port hybrid untagged vlan 10 20
[SW2-Ethernet0/0/1]quit
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]port hybrid pvid vlan 20
[SW2-GigabitEthernet0/0/1]port hybrid untagged vlan 10 20
[SW2-GigabitEthernet0/0/1]quit
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW2-GigabitEthernet0/0/2]quit
[SW2]stp mode mstp
[SW2]stp region-configuration
[SW2-mst-region]region-name Huawei
[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 2 root primary
[SW2]stp instance 1 root secondary
AR1
undo terminal monitor
system-view
[Huawei]sysname R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0 0
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.10.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.20.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]int LoopBack 0
[R1-LoopBack0]ip add 1.1.1.1 32