配置MSTP多进程下单接环和多接环接入示例

组网图形

华为配置MSTP多进程下单接环和多接环接入示例_多进程

图1 MSTP多进程下单接环和多接环接入组网

  • 组网需求
  • 配置思路
  • 操作步骤
  • 配置文件

组网需求

在二层单接环和二层双接环混合组网环境下,交换设备同时承载二三层业务。为了实现不同的环完成不同的业务,可在该组网上部署MSTP多进程,实现不同环上的生成树协议进行独立计算,互不影响。

如图1所示,二层单接环和二层双接环混合组网环境下,交换设备SwitchA和SwitchB同时承载二三层业务。在该组网下,接入双接环的两台交换设备SwitchA和SwitchB下均存在单接环。


在MSTP多进程的环中,建议端口阻塞不要配置在与根保护端口直连的链路上。

配置思路

采用如下的思路配置MSTP多进程:

  1. 配置MSTP基本功能,将设备加入到域,并创建实例,实现对流量的负载分担。
  • 每个环只能配置一个域。

  • 一个CE设备只能加入一个环。

  1. 创建MSTP多进程,实现对端口的分割管理,包括:
  1. 在设备上创建多进程并将端口加入到相应的进程。
  2. 配置共享链路。
  1. 配置其他功能,实现对设备或链路的保护,包括:
  • 配置优先级和根保护。
  • 配置共享链路保护功能。
  1. 配置设备的二层转发功能。

操作步骤

  1. 配置MSTP基本功能,将设备加入到域,并创建实例
  1. 在设备上配置域和实例
    # 在SwitchA上配置域和实例。
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2 to 100
[SwitchA-mst-region] instance 2 vlan 101 to 200
[SwitchA-mst-region] instance 3 vlan 201 to 300
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit

# 在SwitchB上配置域和实例。

<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2 to 100
[SwitchB-mst-region] instance 2 vlan 101 to 200
[SwitchB-mst-region] instance 3 vlan 201 to 300
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit
  1. 启动MSTP
    # 配置SwitchA。
[SwitchA] stp enable

# 配置SwitchB。

[SwitchB] stp enable
  1. 创建MSTP多进程
  1. 在设备上创建多进程并将端口加入到相应的进程
    #在SwitchA上创建进程1和进程2。
[SwitchA] stp process 1
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] quit

#在SwitchB上创建进程2和进程3。

[SwitchB] stp process 2
[SwitchB-mst-process-2] quit
[SwitchB] stp process 3
[SwitchB-mst-process-3] quit

#将SwitchA的端口GE0/0/3和GE0/0/4加入到进程1,端口GE0/0/2加入到进程2。

[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] stp enable
[SwitchA-GigabitEthernet0/0/4] bpdu enable
[SwitchA-GigabitEthernet0/0/4] stp binding process 1
[SwitchA-GigabitEthernet0/0/4] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] stp enable
[SwitchA-GigabitEthernet0/0/3] bpdu enable
[SwitchA-GigabitEthernet0/0/3] stp binding process 1
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] stp enable
[SwitchA-GigabitEthernet0/0/2] bpdu enable
[SwitchA-GigabitEthernet0/0/2] stp binding process 2
[SwitchA-GigabitEthernet0/0/2] quit

# 将SwitchB的端口GE0/0/3和GE0/0/4加入到进程3,端口GE0/0/2加入到进程2。

[SwitchB] interface gigabitethernet 0/0/4
[SwitchB-GigabitEthernet0/0/4] stp enable
[SwitchB-GigabitEthernet0/0/4] bpdu enable
[SwitchB-GigabitEthernet0/0/4] stp binding process 3
[SwitchB-GigabitEthernet0/0/4] quit
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] stp enable
[SwitchB-GigabitEthernet0/0/3] bpdu enable
[SwitchB-GigabitEthernet0/0/3] stp binding process 3
[SwitchB-GigabitEthernet0/0/3] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] stp enable
[SwitchB-GigabitEthernet0/0/2] bpdu enable
[SwitchB-GigabitEthernet0/0/2] stp binding process 2
[SwitchB-GigabitEthernet0/0/2] quit
  1. 配置共享链路
    # 配置SwitchA。
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] stp enable
[SwitchA-GigabitEthernet0/0/1] bpdu enable
[SwitchA-GigabitEthernet0/0/1] stp binding process 2 link-share
[SwitchA-GigabitEthernet0/0/1] quit

# 配置SwitchB。

[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] stp enable
[SwitchB-GigabitEthernet0/0/1] bpdu enable
[SwitchB-GigabitEthernet0/0/1] stp binding process 2 link-share
[SwitchB-GigabitEthernet0/0/1] quit
  1. 启动进程的MSTP功能
    # 配置SwitchA。
[SwitchA] stp process 1
[SwitchA-mst-process-1] stp enable
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp enable
[SwitchA-mst-process-2] quit

# 配置SwitchB。

[SwitchB] stp process 3
[SwitchB-mst-process-3] stp enable
[SwitchB-mst-process-3] quit
[SwitchB] stp process 2
[SwitchB-mst-process-2] stp enable
[SwitchB-mst-process-2] quit
  1. 配置其他功能
  • 配置优先级和根保护
    # 配置SwitchA。
[SwitchA] stp process 1
[SwitchA-mst-process-1] stp instance 0 root primary
[SwitchA-mst-process-1] stp instance 1 root primary
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp instance 0 root primary
[SwitchA-mst-process-2] stp instance 2 root primary
[SwitchA-mst-process-2] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] stp root-protection
[SwitchA-GigabitEthernet0/0/2] quit

# 配置SwitchB。

[SwitchB] stp process 3
[SwitchB-mst-process-3] stp instance 0 root primary
[SwitchB-mst-process-3] stp instance 3 root primary
[SwitchB-mst-process-3] quit
[SwitchB] stp process 2
[SwitchB-mst-process-2] stp instance 0 root secondary
[SwitchB-mst-process-2] stp instance 2 root secondary
[SwitchB-mst-process-2] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] stp root-protection
[SwitchB-GigabitEthernet0/0/2] quit


  • 每个环中都要确保下游CE设备的MSTP优先级低于交换设备。
  • 在双接环接入时,建议SwitchA和SwitchB分别作为不同实例的主备根。
  • 配置MSTP多进程的共享链路保护功能
    # 配置SwitchA。
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp link-share-protection
[SwitchA-mst-process-2] quit

# 配置SwitchB。

[SwitchB] stp process 2
[SwitchB-mst-process-2] stp link-share-protection
[SwitchB-mst-process-2] quit
  1. 创建VLAN,并将端口加入到VLAN中
    # 在SwitchA上创建VLAN2~VLAN200,并将端口GE0/0/3和端口GE0/0/4加入到VLAN2~100中,将端口GE0/0/1和端口GE0/0/2加入到VLAN101~200中。
[SwitchA] vlan batch 2 to 200
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 100
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] port link-type trunk
[SwitchA-GigabitEthernet0/0/4] port trunk allow-pass vlan 2 to 100
[SwitchA-GigabitEthernet0/0/4] quit
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 101 to 200
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 101 to 200
[SwitchA-GigabitEthernet0/0/2] quit

# 在SwitchB上创建VLAN101~VLAN300,并将端口GE0/0/3和端口GE0/0/4加入到VLAN201~VLAN300中,将端口GE0/0/1和端口GE0/0/2加入到VLAN101~200中。

[SwitchB] vlan batch 101 to 300
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] port link-type trunk
[SwitchB-GigabitEthernet0/0/3] port trunk allow-pass vlan 201 to 300
[SwitchB-GigabitEthernet0/0/3] quit
[SwitchB] interface gigabitethernet 0/0/4
[SwitchB-GigabitEthernet0/0/4] port link-type trunk
[SwitchB-GigabitEthernet0/0/4] port trunk allow-pass vlan 201 to 300
[SwitchB-GigabitEthernet0/0/4] quit
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 101 to 200
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 101 to 200
[SwitchB-GigabitEthernet0/0/2] quit
  1. 检查配置结果
  • 在SwitchA上执行display stp interface brief命令,可以看到:
    # 端口GE0/0/4在MSTP进程1的CIST和实例1中为指定端口。
[SwitchA] display stp process 1 interface gigabitethernet 0/0/4 brief
MSTID      Port                          Role  STP State       Protection
0        GigabitEthernet0/0/4          DESI  FORWARDING      NONE
   1        GigabitEthernet0/0/4          DESI  FORWARDING      NONE

# 端口GE0/0/2在MSTP进程2的CIST和实例2中为指定端口。

[SwitchA] display stp process 2 interface gigabitethernet 0/0/2 brief
MSTID      Port                         Role  STP State       Protection
0        GigabitEthernet0/0/2          DESI  FORWARDING      ROOT
   2        GigabitEthernet0/0/2          DESI  FORWARDING      ROOT
  • 在SwitchB上执行display stp interface brief命令,可以看到:
    # 端口GE0/0/4在MSTP进程3的CIST和实例3中为指定端口。
[SwitchB] display stp process 3 interface gigabitethernet 0/0/4 brief
MSTID      Port                          Role  STP State       Protection
0        GigabitEthernet0/0/4          DESI  FORWARDING      NONE
   3        GigabitEthernet0/0/4          DESI  FORWARDING      NONE

# 端口GE0/0/2在MSTP进程2的CIST和实例2中为指定端口。

[SwitchB] display stp process 2 interface gigabitethernet 0/0/2 brief
MSTID      Port                         Role  STP State       Protection
0        GigabitEthernet0/0/2          DESI  FORWARDING      ROOT
   2        GigabitEthernet0/0/2          DESI  FORWARDING      ROOT

配置文件

以下只给出MSTP相关的配置文件。

  • SwitchA的配置文件
#                                                                               
 sysname SwitchA                                                                
#                                                                               
 vlan batch 2 to 200                                                            
#                                                                               
stp region-configuration                                                       
  region-name RG1                                                               
  instance 1 vlan 2 to 100                                                      
  instance 2 vlan 101 to 200                                                    
  instance 3 vlan 201 to 300                                                      
  active region-configuration                                                   
#                                                                               
stp process 1                                                                   
 stp instance 0 root primary                                                    
 stp instance 1 root primary                                                    
 stp enable                                                                     
stp process 2                                                                   
 stp instance 0 root primary                                                    
 stp instance 2 root primary                                                    
 stp link-share-protection                                                      
 stp enable                                                                     
#                                                                        
interface GigabitEthernet0/0/1                                                  
 port link-type trunk
 port trunk allow-pass vlan 101 to 200                                          
 stp binding process 2 link-share                                 
#                                                                               
interface GigabitEthernet0/0/2                                                  
 port link-type trunk
 port trunk allow-pass vlan 101 to 200                                          
 stp binding process 2                                                          
 stp root-protection                                                            
#                                                                               
interface GigabitEthernet0/0/3             
 port link-type trunk
 port trunk allow-pass vlan 2 to 100                                            
 stp binding process 1                                                          
#                                                                               
interface GigabitEthernet0/0/4               
 port link-type trunk
 port trunk allow-pass vlan 2 to 100                                            
 stp binding process 1                                                       
#                                                                               
return
  • SwitchB的配置文件
#                                                                               
sysname SwitchB                                                                
#                                                                               
vlan batch 101 to 300                                                            
#                                                                               
stp region-configuration                                                       
 region-name RG1                                                               
 instance 1 vlan 2 to 100                                                      
 instance 2 vlan 101 to 200                                                    
 instance 3 vlan 201 to 300                                                      
 active region-configuration                                                   
#                                                                               
stp process 2                                                                   
 stp instance 0 root secondary                                                  
 stp instance 2 root secondary                                                  
 stp link-share-protection                                                      
 stp enable                                                                     
stp process 3                                                                   
 stp instance 0 root primary                                                    
 stp instance 3 root primary                                                    
 stp enable                                                                     
#                                                                                
interface GigabitEthernet0/0/1                 
 port link-type trunk
 port trunk allow-pass vlan 101 to 200                                          
 stp binding process 2 link-share                                               
#                                                                               
interface GigabitEthernet0/0/2                        
 port link-type trunk
 port trunk allow-pass vlan 101 to 200                                          
 stp binding process 2                                                          
 stp root-protection                                                            
#                                                                               
interface GigabitEthernet0/0/3          
 port link-type trunk
 port trunk allow-pass vlan 201 to 300                                            
 stp binding process 3                                                          
#                                                                               
interface GigabitEthernet0/0/4               
 port link-type trunk
 port trunk allow-pass vlan 201 to 300                                            
 stp binding process 3                                                          
#                                                                                
return