• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S5830V2[S5820V2]系列以太网交换机 典型配置举例-Release22xx系列-6W100

目录

11-生成树典型配置举例

本章节下载 11-生成树典型配置举例  (327.58 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S5800/S5830V2/Configure/Typical_Configuration_Example/H3C_S5830V2[S5820V2]-Release22xx-6W100/201403/819577_30005_0.htm

11-生成树典型配置举例


1  生成树典型配置举例

1.1  简介

本章介绍了使用生成树功能实现二层环路消除和链路备份的典型配置举例。

1.2  使用限制

不能同时在端口上配置STP功能和业务环回功能。

1.3  MSTP典型配置举例

1.3.1  适用产品和版本

表1 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release2208P01,Release2210

 

1.3.2  组网需求

图1所示,Device A和Device B为汇聚层设备,Device C、Device D和Device E为接入层设备。现要求通过配置MSTP功能实现二层环路消除和冗余链路的负载分担功能。具体应用需求如下:

·     网络中无二层广播环路。

·     不同VLAN的报文按照不同的生成树实例转发:VLAN 10的报文沿实例1转发,VLAN 20的报文沿实例0转发,VLAN 30的报文沿实例2转发。

·     各VLAN对应的生成树实例的拓扑如图2所示。

图1 MSTP配置组网图

 

图2 各VLAN对应的生成树实例的拓扑

 

1.3.3  配置思路

为了使不同VLAN的流量沿不同的物理链路转发,需要配置端口在不同生成树实例中的路径开销。本例中各设备缺省路径开销的计算标准都是缺省值legacy因此各端口的缺省路径开销都是2。

1.3.4  配置注意事项

·     两台或多台使能了生成树协议的设备若要属于同一个MST域,必须同时满足以下两个条件:第一是选择因子(取值为0,不可配)、域名、修订级别和VLAN映射表的配置都相同;第二是这些设备之间的链路相通。

·     全局执行的mCheck操作(stp global mcheck)对所有端口生效,端口执行的mCheck操作(stp mcheck)仅对本端口生效。

1.3.5  配置步骤

(1)     配置VLAN和端口

请按照1.3.2  图1所示,在Device A、Device B和Device E上分别创建VLAN 10、20和30,在Device C上创建VLAN 10和20,在Device D上创建VLAN 20和30;将各设备在本举例中涉及的各端口配置为Trunk端口并允许相应的VLAN通过,开启各端口的生成树协议。缺省情况下,端口上的生成树协议处于开启状态。各设备的配置方法相似,本文仅列举出Device A的配置。

<DeviceA> system-view

[DeviceA] vlan 10

[DeviceA-vlan10] quit

[DeviceA] vlan 20

[DeviceA-vlan20] quit

[DeviceA] vlan 30

[DeviceA-vlan30] quit

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] port link-type trunk

[DeviceA-Ten-GigabitEthernet1/0/1] undo port trunk permit vlan 1

[DeviceA-Ten-GigabitEthernet1/0/1] port trunk permit vlan 10 20

[DeviceA-Ten-GigabitEthernet1/0/1] stp enable

[DeviceA-Ten-GigabitEthernet1/0/1] quit

[DeviceA] interface ten-gigabitethernet 1/0/2

[DeviceA-Ten-GigabitEthernet1/0/2] port link-type trunk

[DeviceA-Ten-GigabitEthernet1/0/2] undo port trunk permit vlan 1

[DeviceA-Ten-GigabitEthernet1/0/2] port trunk permit vlan 20 30

[DeviceA-Ten-GigabitEthernet1/0/2] stp enable

[DeviceA-Ten-GigabitEthernet1/0/2] quit

[DeviceA] interface ten-gigabitethernet 1/0/3

[DeviceA-Ten-GigabitEthernet1/0/3] port link-type trunk

[DeviceA-Ten-GigabitEthernet1/0/3] undo port trunk permit vlan 1

[DeviceA-Ten-GigabitEthernet1/0/3] port trunk permit vlan 10 20 30

[DeviceA-Ten-GigabitEthernet1/0/3] stp enable

[DeviceA-Ten-GigabitEthernet1/0/3] quit

(2)     配置Device A

# 配置MST域的域名为example,将VLAN 10、20、30分别映射到生成树实例1、0、2上,并配置MSTP的修订级别为0。缺省情况下,MST域的域名为设备的桥MAC地址,所有VLAN都映射到instance 0上,MSTP的修订级别为0。

<DeviceA> system-view

[DeviceA] stp region-configuration

[DeviceA-mst-region] region-name example

[DeviceA-mst-region] instance 1 vlan 10

[DeviceA-mst-region] instance 0 vlan 20

[DeviceA-mst-region] instance 2 vlan 30

[DeviceA-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceA-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceA-mst-region] active region-configuration

[DeviceA-mst-region] quit

# 配置本设备为生成树实例1和实例2的根桥。

[DeviceA] stp instance 1 root primary

[DeviceA] stp instance 2 root primary

# 配置本设备为生成树实例0的备份根桥。

[DeviceA] stp instance 0 root secondary

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceA] stp mode mstp

# 全局使能MSTP协议。

[DeviceA] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceA] stp global mcheck

(3)     配置Device B

# 配置MST域的域名为example,将VLAN 10、20、30分别映射到生成树实例1、0、2上,并配置MSTP的修订级别为0。缺省情况下,MST域的域名为设备的桥MAC地址,所有VLAN都映射到instance 0上,MSTP的修订级别为0。

<DeviceB> system-view

[DeviceB] stp region-configuration

[DeviceB-mst-region] region-name example

[DeviceB-mst-region] instance 1 vlan 10

[DeviceB-mst-region] instance 0 vlan 20

[DeviceB-mst-region] instance 2 vlan 30

[DeviceB-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceB-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceB-mst-region] active region-configuration

[DeviceB-mst-region] quit

# 配置本设备为生成树实例0的根桥。

[DeviceB] stp instance 0 root primary

# 配置本设备为生成树实例1和实例2的备份根桥。

[DeviceB] stp instance 1 root secondary

[DeviceB] stp instance 2 root secondary

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceB] stp mode mstp

# 全局使能MSTP协议。

[DeviceB] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceB] stp global mcheck

(4)     配置Device C

# 配置MST域的域名为example,将VLAN 10、20、30分别映射到生成树实例1、0、2上,并配置MSTP的修订级别为0。缺省情况下,MST域的域名为设备的桥MAC地址,所有VLAN都映射到instance 0上,MSTP的修订级别为0。

<DeviceC> system-view

[DeviceC] stp region-configuration

[DeviceC-mst-region] region-name example

[DeviceC-mst-region] instance 1 vlan 10

[DeviceC-mst-region] instance 0 vlan 20

[DeviceC-mst-region] instance 2 vlan 30

[DeviceC-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceC-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceC-mst-region] active region-configuration

[DeviceC-mst-region] quit

# 配置Device C的Ten-GigabitEthernet1/0/1端口在实例1中的路径开销值为1。

[DeviceC] interface ten-gigabitethernet 1/0/1

[DeviceC-Ten-GigabitEthernet1/0/1] stp instance 1 cost 1

[DeviceC-Ten-GigabitEthernet1/0/1] quit

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceC] stp mode mstp

# 全局使能MSTP协议。

[DeviceC] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceC] stp global mcheck

(5)     配置Device D

# 配置MST域的域名为example,将VLAN 10、20、30分别映射到生成树实例1、0、2上,并配置MSTP的修订级别为0。缺省情况下,MST域的域名为设备的桥MAC地址,所有VLAN都映射到instance 0上,MSTP的修订级别为0。

<DeviceD> system-view

[DeviceD] stp region-configuration

[DeviceD-mst-region] region-name example

[DeviceD-mst-region] instance 1 vlan 10

[DeviceD-mst-region] instance 0 vlan 20

[DeviceD-mst-region] instance 2 vlan 30

[DeviceD-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceD-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceD-mst-region] active region-configuration

[DeviceD-mst-region] quit

# 配置Device D的Ten-GigabitEthernet1//0/1端口在实例2中的路径开销值为1。

[DeviceD] interface ten-gigabitethernet 1/0/1

[DeviceD-Ten-GigabitEthernet1/0/1] stp instance 2 cost 1

[DeviceD-Ten-GigabitEthernet1/0/1] quit

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceD] stp mode mstp

# 全局使能MSTP协议。

[DeviceD] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceD] stp global mcheck

(6)     配置Device E

# 配置MST域的域名为example,将VLAN 10、20、30分别映射到生成树实例1、0、2上,并配置MSTP的修订级别为0。缺省情况下,MST域的域名为设备的桥MAC地址,所有VLAN都映射到instance 0上,MSTP的修订级别为0。

<DeviceE> system-view

[DeviceE] stp region-configuration

[DeviceE-mst-region] region-name example

[DeviceE-mst-region] instance 1 vlan 10

[DeviceE-mst-region] instance 0 vlan 20

[DeviceE-mst-region] instance 2 vlan 30

[DeviceE-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceE-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceE-mst-region] active region-configuration

[DeviceE-mst-region] quit

# 配置Device E的Ten-GigabitEthernet1//0/2端口在实例0中的路径开销值为1。

[DeviceE] interface ten-gigabitethernet 1/0/2

[DeviceE-Ten-GigabitEthernet1/0/2] stp instance 0 cost 1

[DeviceE-Ten-GigabitEthernet1/0/2] quit

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceE] stp mode mstp

# 全局使能MSTP协议。

[DeviceE] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceE] stp global mcheck

1.3.6  验证配置

当网络拓扑稳定后,通过使用display stp brief命令可以查看各设备上生成树的简要信息。例如:

# 查看Device A上生成树的简要信息。

[DeviceA] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/3         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/3         DESI  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/3         DESI  FORWARDING    NONE

# 查看Device B上生成树的简要信息。

[DeviceB] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/3         DESI  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/3         ALTE  DISCARDING    NONE

   2        Ten-GigabitEthernet1/0/2         ROOT  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/3         ALTE  DISCARDING    NONE

# 查看Device C上生成树的简要信息。

[DeviceC] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

# 查看Device D上生成树的简要信息。

[DeviceD] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ROOT  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

# 查看Device E上生成树的简要信息。

[DeviceE] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   1        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   2        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

根据上述显示信息,可以绘出各VLAN所对应的MSTI,如图3所示,满足应用需求。

图3 各VLAN对应的MSTI示意图

 

1.3.7  配置文件

·     Device A

#

vlan 10

#

vlan 20

#

vlan 30

#

stp region-configuration

 region-name example

 instance 1 vlan 10

 instance 2 vlan 30

 active region-configuration

#

 stp instance 0 root secondary

 stp instance 1 root primary

 stp instance 2 root primary

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 20 30

#

interface Ten-GigabitEthernet1/0/3

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20 30

#

·     Device B

#

vlan 10

#

vlan 20

#

vlan 30

#

stp region-configuration

 region-name example

 instance 1 vlan 10

 instance 2 vlan 30

 active region-configuration

#

 stp instance 0 root primary

 stp instance 1 root secondary

 stp instance 2 root secondary

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 20 30

#

interface Ten-GigabitEthernet1/0/3

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20 30

#

·     Device C

#

vlan 10

#

vlan 20

#

stp region-configuration

 region-name example

 instance 1 vlan 10

 instance 2 vlan 30

 active region-configuration

#

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20

 stp instance 1 cost 1

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20

#

·     Device D

#

vlan 20

#

vlan 30

#

stp region-configuration

 region-name example

 instance 1 vlan 10

 instance 2 vlan 30

 active region-configuration

#

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 20 30

 stp instance 2 cost 1

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 20 30

#

·     Device E

#

vlan 10

#

vlan 20

#

vlan 30

#

stp region-configuration

 region-name example

 instance 1 vlan 10

 instance 2 vlan 30

 active region-configuration

#

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20 30

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 20 30

 stp instance 0 cost 1

#

1.4  RSTP典型配置举例

1.4.1  适用产品和版本

表2 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release2208P01,Release2210

 

1.4.2  组网需求

图4所示,用户局域网内采用分层组网:

·     Device A为核心层交换机;

·     Device B、Device C为汇聚层交换机,Device C和Device B之间通过两条链路相连;

·     Device D、Device E、Device F为接入层交换机,下面直接挂接用户的PC。

·     本例中假定所有设备的端口路径开销相同。

现要求使用RSTP技术阻断二层环路,实现链路备份。具体应用需求如下:

·     配置Device A为根桥,并保护根桥不被维护人员的错误配置或网络中的恶意攻击影响。

·     Device C为Device B的备份交换机,当Device B出现故障的时候,由Device C转发数据。

·     配置Device D、E、F直接与用户相连的端口为边缘端口,并使能BPDU保护功能。

·     保护网络的稳定性,防止网络被伪造的TC-BPDU恶意攻击。

图4 RSTP配置组网图

 

 

说明

在后面的配置步骤中仅列出了RSTP相关的配置。

 

1.4.3  配置思路

·     为了保护根桥不被维护人员的错误配置或网络中的恶意攻击影响,在Device A、Device B、Device C的指定端口上开启根保护功能。

·     为了使Device C成为Device B的备份交换机,为Device B配置较高的Bridge优先级。

·     为了防止网络被伪造的TC-BPDU恶意攻击,启动根桥设备Device A的TC防攻击功能。

1.4.4  配置步骤

(1)     配置Device A

# 配置设备工作在RSTP模式。

<DeviceA> system-view

[DeviceA] stp mode rstp

# 配置Device A为树根。

[DeviceA] stp root primary

说明

配置Device A为树根还有一种方法,就是将设备的Bridge优先级配置为0,配置命令为:

[DeviceA] stp priority 0

 

# 在与Device B、Device C相连的指定端口上启动根保护功能

[DeviceA] interface Ten-GigabitEthernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] stp root-protection

[DeviceA-Ten-GigabitEthernet1/0/1] quit

[DeviceA] interface Ten-GigabitEthernet 1/0/2

[DeviceA-Ten-GigabitEthernet1/0/2] stp root-protection

[DeviceA-Ten-GigabitEthernet1/0/2] quit

# 启动Device A的TC防攻击功能。缺省情况下,该功能处于开启状态。

[DeviceA] stp tc-protection

# 全局启动RSTP功能。

[DeviceA] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于RSTP模式。

[DeviceA] stp global mcheck

# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出Ten-GigabitEthernet 1/0/4)

[DeviceA] interface Ten-GigabitEthernet 1/0/4

[DeviceA-Ten-GigabitEthernet1/0/4] undo stp enable

[DeviceA-Ten-GigabitEthernet1/0/4] quit

(2)     配置Device B

# 配置设备工作在RSTP模式。

<DeviceB> system-view

[DeviceB] stp mode rstp

# 配置Device B的Bridge优先级为4096。

[DeviceB] stp priority 4096

# 在各个指定端口上启动根保护功能

[DeviceB] interface Ten-GigabitEthernet 1/0/4

[DeviceB-Ten-GigabitEthernet1/0/4] stp root-protection

[DeviceB-Ten-GigabitEthernet1/0/4] quit

[DeviceB] interface Ten-GigabitEthernet 1/0/5

[DeviceB-Ten-GigabitEthernet1/0/5] stp root-protection

[DeviceB-Ten-GigabitEthernet1/0/5] quit

[DeviceB] interface Ten-GigabitEthernet 1/0/6

[DeviceB-Ten-GigabitEthernet1/0/6] stp root-protection

[DeviceB-Ten-GigabitEthernet1/0/6] quit

# STP时间参数、端口上的参数都采用缺省值。

# 全局启动RSTP功能。

[DeviceB] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于RSTP模式。

[DeviceB] stp global mcheck

# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出Ten-GigabitEthernet 1/0/8)

[DeviceB] interface Ten-GigabitEthernet 1/0/8

[DeviceB-Ten-GigabitEthernet1/0/8] undo stp enable

[DeviceB-Ten-GigabitEthernet1/0/8] quit

(3)     配置Device C

# 配置设备工作在RSTP模式。

<DeviceC> system-view

[DeviceC] stp mode rstp

# 配置Device C的Bridge优先级配置为8192,充当Device B的备份交换机。

[DeviceC] stp priority 8192

# 在各个指定端口上启动根保护功能

[DeviceC] interface Ten-GigabitEthernet 1/0/4

[DeviceC-Ten-GigabitEthernet1/0/4] stp root-protection

[DeviceC-Ten-GigabitEthernet1/0/4] quit

[DeviceC] interface Ten-GigabitEthernet 1/0/5

[DeviceC-Ten-GigabitEthernet1/0/5] stp root-protection

[DeviceC-Ten-GigabitEthernet1/0/5] quit

[DeviceC] interface Ten-GigabitEthernet 1/0/6

[DeviceC-Ten-GigabitEthernet1/0/6] stp root-protection

[DeviceC-Ten-GigabitEthernet1/0/6] quit

# STP的时间参数、端口上的参数都采用缺省值。

# 全局启动RSTP功能。

[DeviceC] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于RSTP模式。

[DeviceC] stp global mcheck

# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出Ten-GigabitEthernet 1/0/8)

[DeviceC] interface Ten-GigabitEthernet 1/0/8

[DeviceC-Ten-GigabitEthernet1/0/8] undo stp enable

[DeviceC-Ten-GigabitEthernet1/0/8] quit

(4)     配置Device D

# 配置设备工作在RSTP模式。

<DeviceD> system-view

[DeviceD] stp mode rstp

# 将直接与用户相连的端口配置为边缘端口,并使能BPDU保护功能。(此处仅以Ten-GigabitEthernet 1/0/4为例)

[DeviceD] interface Ten-GigabitEthernet 1/0/4

[DeviceD-Ten-GigabitEthernet1/0/4] stp edged-port

[DeviceD-Ten-GigabitEthernet1/0/4] quit

[DeviceD] stp bpdu-protection

# STP的时间参数、端口的其他参数都采用缺省值。

# 全局启动RSTP功能。

[DeviceD] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于RSTP模式。

[DeviceD] stp global mcheck

# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出Ten-GigabitEthernet 1/0/3)

[DeviceD] interface Ten-GigabitEthernet 1/0/3

[DeviceD-Ten-GigabitEthernet1/0/3] undo stp enable

[DeviceD-Ten-GigabitEthernet1/0/3] quit

(5)     配置Device E和Device F

# Device E和F的配置同Device D,此处不再赘述。

1.4.5  验证配置

当网络拓扑稳定后,使用display stp brief命令查看各设备上生成树的简要信息。

# 查看Device A上生成树的简要信息。

[DeviceA] display stp brief

 MST ID     Port                              Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         DESI  FORWARDING    ROOT

   0        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    ROOT

# 查看Device B上生成树的简要信息。

[DeviceB] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/3         DESI  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/4         DESI  FORWARDING    ROOT

   0        Ten-GigabitEthernet1/0/5         DESI  FORWARDING    ROOT

   0        Ten-GigabitEthernet1/0/6         DESI  FORWARDING    ROOT

# 查看Device C上生成树的简要信息。

[DeviceC] display stp brief

MST ID      Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/3         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/4         DESI  FORWARDING    ROOT

   0        Ten-GigabitEthernet1/0/5         DESI  FORWARDING    ROOT

   0        Ten-GigabitEthernet1/0/6         DESI  FORWARDING    ROOT

# 查看Device D上生成树的简要信息。

[DeviceD] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/4         DESI  FORWARDING    NONE

# 查看Device E上生成树的简要信息。

[DeviceE] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/4         DESI  FORWARDING    NONE

# 查看Device F上生成树的简要信息。

[DeviceF] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

   0        Ten-GigabitEthernet1/0/4         DESI  FORWARDING    NONE

根据上述显示信息,可以绘出拓扑收敛后的示意图,如图5所示。

图5 拓扑示意图

 

1.4.6  配置文件

·     Device A

#

 stp mode rstp

 stp instance 0 root primary

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 stp root-protection

#

interface Ten-GigabitEthernet1/0/2

 stp root-protection

#

interface Ten-GigabitEthernet1/0/4

 undo stp enable

#

·     Device B

#

 stp mode rstp

 stp instance 0 priority 4096

 stp global enable

#

interface Ten-GigabitEthernet1/0/4

 stp root-protection

#

interface Ten-GigabitEthernet1/0/5

 stp root-protection

#

interface Ten-GigabitEthernet1/0/6

 stp root-protection

#

interface Ten-GigabitEthernet1/0/8

 undo stp enable

#

·     Device C

#

 stp mode rstp

 stp instance 0 priority 8192

 stp global enable

#

interface Ten-GigabitEthernet1/0/4

 stp root-protection

#

interface Ten-GigabitEthernet1/0/5

 stp root-protection

#

interface Ten-GigabitEthernet1/0/6

 stp root-protection

#

interface Ten-GigabitEthernet1/0/8

 undo stp enable

#

·     Device D

#

 stp mode rstp

 stp bpdu-protection

 stp global enable

#

interface Ten-GigabitEthernet1/0/3

 undo stp enable

#

interface Ten-GigabitEthernet1/0/4

 stp edged-port

#

1.5  与采用私有密钥计算配置摘要的第三方厂商设备互通

1.5.1  适用产品和版本

表3 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release2208P01,Release2210

 

1.5.2  组网需求

配置摘要是用HMAC-MD5算法将MST域配置中VLAN和实例的映射关系加密计算而成的。由于一些厂商的设备对MSTP协议的实现上存在差异,即用加密算法计算配置摘要时采用私有的密钥,从而导致即使MST域配置相同,不同厂商的设备之间也不能实现在MSTP域内的互通。

图6所示,Device A、Device B和Device C互联,并配置在同一MST域内。Device C为第三方厂商设备,MAC地址为00e0-fc0e-6554,并被配置为根交换机。Device C用加密算法计算配置摘要时采用私有的密钥。Device B的MAC地址比Device A的MAC地址小。

现要求通过配置摘要侦听功能,实现Device A、Device B和Device C在MST域内的完全互通。

图6 摘要侦听功能配置组网图

 

1.5.3  配置注意事项

·     建议配置完摘要侦听功能后再使能生成树协议。在网络稳定的情况下不要进行摘要侦听功能的配置,以免造成临时的流量中断。

·     只有当全局和端口上都使能了摘要侦听功能后,该功能才能生效。使能摘要侦听功能时,建议先在所有与第三方厂商设备相连的端口上使能该功能,再全局使能该功能,以一次性让所有端口的配置生效,从而减少对网络的冲击。

·     请不要在MST域的边界端口上使能摘要侦听功能,否则可能会导致环路。

·     摘要侦听功能在端口生效后,由于不再通过配置摘要的比较计算来判断是否在同一个域内,因此需要保证互连设备的域配置中VLAN与MSTI映射关系的配置相同。

1.5.4  配置步骤

(1)     在Device A上完成MSTP域的基本配置并使能MSTP功能

# 配置MST域的域名为example,VLAN和实例的映射关系保持缺省配置,即VLAN1~VLAN 4094都映射到instance 0上,配置MSTP的修订级别为0。

<DeviceA> system-view

[DeviceA] stp region-configuration

[DeviceA-mst-region] region-name example

[DeviceA-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceA-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceA-mst-region] active region-configuration

[DeviceA-mst-region] quit

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceA] stp mode mstp

# 全局使能MSTP协议。

[DeviceA] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceA] stp global mcheck

(2)     在Device B上完成MSTP域的基本配置并使能MSTP功能,配置方法与Device A上的配置相同,配置步骤略

(3)     在Device C上完成以下任务,具体方法请参考对应厂商产品的手册:

·     配置MST域的域名为example;

·     将VLAN1~VLAN 4094都映射到instance 0上;

·     配置MSTP的修订级别为0;

·     确保域的配置生效;

·     将Device C配置为instance 0的根桥;

·     使能生成树协议。

说明

当您希望将H3C设备与用加密算法计算配置摘要时采用私有的密钥的第三方设备配置在同一域中时,即需要在H3C设备上配置本功能。本例中MST域的配置采用简单配置,仅做示例。

 

(4)     在Device A上配置摘要侦听功能

# 在Device A的端口Ten-GigabitEthernet1/0/1上使能摘要侦听功能,并全局使能摘要侦听功能(只有全局和端口上都使能了摘要侦听功能后,该功能才能生效)。

<DeviceA> system-view

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] stp config-digest-snooping

[DeviceA-Ten-GigabitEthernet1/0/1] quit

[DeviceA] stp global config-digest-snooping

(5)     在Device B上配置摘要侦听功能

# 在Device B的端口Ten-GigabitEthernet1/0/1上使能摘要侦听功能,并全局使能摘要侦听功能(只有全局和端口上都使能了摘要侦听功能后,该功能才能生效)。

<DeviceB> system-view

[DeviceB] interface ten-gigabitethernet 1/0/1

[DeviceB-Ten-GigabitEthernet1/0/1] stp config-digest-snooping

[DeviceB-Ten-GigabitEthernet1/0/1] quit

[DeviceB] stp global config-digest-snooping

1.5.5  验证配置

当网络拓扑稳定后,使用display stp brief命令查看各设备上生成树的简要信息。

# 查看Device A上生成树的简要信息。

[DeviceA] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         ALTE  DISCARDING    NONE

# 查看Device B上生成树的简要信息。

[DeviceB] display stp brief

 MST ID     Port                             Role  STP State     Protection

   0        Ten-GigabitEthernet1/0/1         ROOT  FORWARDING    NONE

   0        Ten-GigabitEthernet1/0/2         DESI  FORWARDING    NONE

(1)     在Device A和Device B上查看MST 0的根桥信息,可以看到根桥都是Device C(00e0-fc0e-6554为Device C的MAC地址)。

# 在MSTP模式下,显示生成树的根桥信息。

<DeviceA> display stp root

 MST ID  Root Bridge ID        ExtPathCost IntPathCost Root Port

   0     0.00e0-fc0e-6554      20           0          Ten-GigabitEthernet1/0/1

根据上述显示信息,可以看到Device A、Device B和Device C可以在同一MST域中互通了。

1.5.6  配置文件

·     Device A

#

stp region-configuration

 region-name example

 active region-configuration

#

 stp global enable

#

 stp global config-digest-snooping

#

interface Ten-GigabitEthernet1/0/1

 stp config-digest-snooping

#

·     Device B

#

stp region-configuration

 region-name example

 active region-configuration

#

 stp global enable

#

 stp global config-digest-snooping

#

interface Ten-GigabitEthernet1/0/1

 stp config-digest-snooping

#

1.6  与对生成树协议的实现存在私有性差异的上游第三方厂商设备互通

1.6.1  适用产品和版本

表4 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release2208P01,Release2210

 

1.6.2  组网需求

RSTP和MSTP的指定端口可以通过与下游设备根端口交互Proposal报文和Agreement报文快速迁移端口状态。

当我方设备作为下游设备,与上游对生成树协议的实现存在差异的第三方厂商设备互联时,二者在快速迁移的配合上可能会存在一定的限制。

图7所示:Device A为H3C设备,Device B为对MSTP协议的实现存在私有性差异的第三方厂商设备,Device A和Device B配置在同一MST域内且Device B为根桥。

通过在Device A的Ten-GigabitEthernet1/0/1端口上使能No Agreement Check功能,使得Device B的Ten-GigabitEthernet1/0/1端口能够进行状态的快速迁移。

图7 No Agreement Check功能配置组网图

 

1.6.3  配置注意事项

请在设备的根端口上进行No Agreement Check功能配置。只有在根端口上配置本功能才会生效。

1.6.4  配置步骤

(1)     在Device A上完成MSTP域的基本配置并使能MSTP功能

# 配置MST域的域名为example,VLAN和实例的映射关系保持缺省配置,即VLAN1~VLAN 4094都映射到instance 0上,配置MSTP的修订级别为0。

<DeviceA> system-view

[DeviceA] stp region-configuration

[DeviceA-mst-region] region-name example

[DeviceA-mst-region] revision-level 0

# 查看MST域的预配置信息(建议在激活MST域的配置前,先查看MST域的预配置是否正确,确认配置无误后再激活MST域的配置)。

[DeviceA-mst-region] check region-configuration

# 激活MST域的配置。

[DeviceA-mst-region] active region-configuration

[DeviceA-mst-region] quit

# 配置生成树的工作模式为MSTP模式。缺省情况下,生成树的工作模式为MSTP模式。

[DeviceA] stp mode mstp

# 全局使能MSTP协议。

[DeviceA] stp global enable

# 全局执行mcheck操作确保设备各端口都工作于MSTP模式。

[DeviceA] stp global mcheck

(2)     在Device B上完成以下任务,具体方法请参考对应厂商产品的手册:

·     配置MST域的域名为example;

·     将VLAN1~VLAN 4094都映射到instance 0上;

·     配置MSTP的修订级别为0;

·     确保域的配置生效;

·     将Device B配置为instance 0的根桥;

·     使能生成树协议。

说明

当H3C设备作为下游设备,上游第三方设备指定端口的状态迁移实现机制与H3C设备有差异时,即需要在H3C设备连接上游设备的根端口上使用本功能。本例中MST域的配置采用简单配置,仅做示例。

 

(3)     # 在Device A的端口Ten-GigabitEthernet1/0/1上使能No Agreement Check功能。

<DeviceA> system-view

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] stp no-agreement-check

1.6.5  验证配置

完成配置后,连接Device A和Device B。在Device B上使用display stp brief命令查看到Device B的指定端口Ten-GigabitEthernet1/0/1在数秒内迁移到FORWARDING状态,实现了快速迁移。

1.6.6  配置文件

·     Device A

#

stp region-configuration

 region-name example

 active region-configuration

#

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 stp no-agreement-check

#

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们