实验拓扑图:
一、配置核心交换机
1、链路聚合LSW1
[Huawei]interface Eth-Trunk 1
[Huawei-Eth-Trunk1]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 1
[Huawei-GigabitEthernet0/0/1]interface g 0/0/2
[Huawei-GigabitEthernet0/0/2]eth-trunk 1
[Huawei-GigabitEthernet0/0/2]quit
2、链路聚合LSW2
[Huawei]interface Eth-Trunk 1
[Huawei-Eth-Trunk1]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 1
[Huawei-GigabitEthernet0/0/1]interface g 0/0/2
[Huawei-GigabitEthernet0/0/2]eth-trunk 1
[Huawei-GigabitEthernet0/0/2]quit
二、生成树
1、LSW1
[Huawei] vlan batch 2 to 5
[Huawei]interface Eth-Trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type trunk
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/5
[Huawei-GigabitEthernet0/0/5]port link-type trunk
[Huawei-GigabitEthernet0/0/5]port trunk allow-pass vlan 2 to 4094
[Huawei]stp region-configuration
[Huawei-mst-region]region-name sxh
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 2 4
[Huawei-mst-region]instance 1 vlan 3 5
[Huawei-mst-region]active region-configuration
[Huawei]stp instance 1 priority 4096
[Huawei]stp instance 2 priority 8192
2、LSW2
[Huawei] vlan batch 2 to 5
[Huawei]interface Eth-Trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type trunk
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/5
[Huawei-GigabitEthernet0/0/5]port link-type trunk
[Huawei-GigabitEthernet0/0/5]port trunk allow-pass vlan 2 to 4094
[Huawei]interface GigabitEthernet 0/0/6
[Huawei-GigabitEthernet0/0/6]port link-type trunk
[Huawei-GigabitEthernet0/0/6]port trunk allow-pass vlan 2 to 4094
[Huawei]stp region-configuration
[Huawei-mst-region]region-name sxh
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 2 4
[Huawei-mst-region]instance 2 vlan 3 5
[Huawei-mst-region]active region-configuration
[Huawei]stp instance 1 priority 8192
[Huawei]stp instance 2 priority 4096
三、核心交换机指定网关
1、LSW1
[Huawei]interface Vlanif 2
[Huawei-Vlanif2]ip address 192.168.2.1 24
[Huawei-Vlanif2]quit
[Huawei]interface Vlanif 3
[Huawei-Vlanif3]ip address 192.168.3.1 24
[Huawei-Vlanif3]quit
[Huawei]interface Vlanif 4
[Huawei-Vlanif4]ip address 192.168.4.1 24
[Huawei-Vlanif4]quit
[Huawei]interface Vlanif 5
[Huawei-Vlanif5]ip address 192.168.5.1 24
[Huawei-Vlanif5]quit
2、LSW2
[Huawei]interface Vlanif 2
[Huawei-Vlanif2]ip address 192.168.2.1 24
[Huawei-Vlanif2]quit
[Huawei]interface Vlanif 3
[Huawei-Vlanif3]ip address 192.168.3.1 24
[Huawei-Vlanif3]quit
[Huawei]interface Vlanif 4
[Huawei-Vlanif4]ip address 192.168.4.1 24
[Huawei-Vlanif4]quit
[Huawei]interface Vlanif 5
[Huawei-Vlanif5]ip address 192.168.5.1 24
[Huawei-Vlanif5]quit
四、汇聚层交换机更改端口
1、LSW3
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port link-type access
2、LSW4
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port link-type access
3、LSW5
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port link-type access
4、LSW6
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port link-type access
五、汇聚层指定网关
1、LSW3
[Huawei]vlan batch 2 to 5
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei]interface Vlanif 2
[Huawei-Vlanif2]ip address 192.168.2.1 24
2、LSW4
[Huawei]vlan batch 2 to 5
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port default vlan 3
[Huawei]interface Vlanif 3
[Huawei-Vlanif3]ip address 192.168.3.1 24
3、LSW5
[Huawei]vlan batch 2 to 5
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port default vlan 4
[Huawei]interface Vlanif 4
[Huawei-Vlanif4]ip address 192.168.4.1 24
4、LSW6
[Huawei]vlan batch 2 to 5
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]port default vlan 5
[Huawei]interface Vlanif 5
[Huawei-Vlanif5]ip address 192.168.5.1 24
六、PC机设置网关、IP地址
1、PC1
2、PC2
3、PC3
4、PC4
七、尝试ping其他三台PC机
(至此,试验成功。)