AI智能
改变未来

华为网络实验(4)——MSTP

MSTP:一个VLAN一颗生成树,实现链路的负载均衡。

MSTP的命令:

stp mode mstp
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
stp instance 1 root primary
stp instance 2 root secondary(根据具体情况而定)

拓扑图:

SW1配置文件:

#
sysname sw1
#
vlan batch 10 20

#
interface Ethernet0/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10 20
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10 20

 

SW2配置文件:

#
sysname sw2
#
vlan batch 10 20

#
interface Ethernet0/0/1
 port hybrid pvid vlan 20
 port hybrid untagged vlan 10 20
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/1
 port hybrid pvid vlan 20
 port hybrid untagged vlan 10 20

 

SW3配置文件:

#
sysname sw3
#
vlan batch 10 20

interface Ethernet0/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10 20
#
interface Ethernet0/0/2
 port hybrid pvid vlan 20
 port hybrid untagged vlan 10 20
#
interface GigabitEthernet0/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10 20

#

interface GigabitEthernet0/0/2
port hybrid pvid vlan 20
 port hybrid untagged vlan 10 20

 

输入display stp brief查看各端口的状态

SW1

SW2

SW3

根据上图可知,SW3的g0/0/1口为AP口,处于blocking状态。

配置MSTP

SW1

stp mode mstp
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
stp instance 1 root primary
stp instance 2 root secondary
 

SW2

stp mode mstp
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
stp instance 2 root primary
stp instance 1 root secondary

 

SW3

stp mode mstp
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration

配置完之后查看端口状态:

SW1:

SW2:

SW3:

可以看到,SW3的AP口自动进行了转换,不会影响数据的传输。

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 华为网络实验(4)——MSTP