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

03-二层技术-以太网交换配置举例

06-H3C_生成树典型配置举例

本章节下载 06-H3C_生成树典型配置举例  (344.70 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S7500E/S7500X-G/Configure/Typical_Configuration_Example/H3C_S7500X-G_CE-R7724-6W100/03/201807/1091699_30005_0.htm

06-H3C_生成树典型配置举例

生成树配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H3C_彩色.emf



1  简介

本文档介绍了生成树的配置举例。

2  配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文假设您已了解生成树特性。

3  MSTP典型配置举例

3.1  组网需求

1所示:

·     网络中所有设备都属于同一个MST域,设备的端口均允许VLAN 11~30通过。

·     Device A和Device B为核心层设备,Device C和Device D为汇聚层设备。

·     假定所有端口路径开销相同。

要求通过配置MSTP功能,实现:

·     网络中无二层环路。

·     Device C和Device D的VLAN 11~20报文、VLAN 21~30报文沿不同链路分别上行到Device A和Device B,实现流量负载分担和链路备份。

图1 MSTP配置组网图

 

3.2  配置思路

·     要使所有设备属于同一MST域,在所有设备上配置相同的如下参数:

¡     生成树的工作模式(缺省为MSTP模式,无需配置)

¡     域名(本例配置为test)

¡     修订级别(缺省为0,无需配置)

¡     VLAN映射表(本例将VLAN 11~20映射到MSTI 1,VLAN 21~30映射到MSTI 2)

·     为了使MSTI 1和MSTI 2拓扑中的上行链路不同并互相作为冗余备份,配置Device A为MSTI 1的根桥,Device B为MSTI 2的根桥。另外,本例中配置Device A、B、C、D在MSTI 0的优先级依次降低,使Device A成为IST域根。形成的多个生成树实例拓扑如2所示。

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

 

3.3  使用版本

本举例是在S7500XG-CMW710-R7724版本上进行配置和验证的。

3.4  配置步骤

3.4.1  配置Device A

# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。

<DeviceA> system-view

[DeviceA] vlan 11 to 30

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

[DeviceA-if-range] port link-type trunk

[DeviceA-if-range] port trunk permit vlan 11 to 30

[DeviceA-if-range] quit

# 配置MST域的域名为test,将VLAN 11~20映射到MSTI 1,VLAN 21~30映射到MSTI 2。

[DeviceA] stp region-configuration

[DeviceA-mst-region] region-name test

[DeviceA-mst-region] instance 1 vlan 11 to 20

[DeviceA-mst-region] instance 2 vlan 21 to 30

[DeviceA-mst-region] active region-configuration

[DeviceA-mst-region] quit

# 配置本设备为MSTI 0和1的根桥。

[DeviceA] stp instance 0 to 1 root primary

# 全局使能生成树协议。

[DeviceA] stp global enable

3.4.2  配置Device B

# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。

<DeviceB> system-view

[DeviceB] vlan 11 to 30

[DeviceB] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3

[DeviceB-if-range] port link-type trunk

[DeviceB-if-range] port trunk permit vlan 11 to 30

[DeviceB-if-range] quit

# 配置MST域的域名为test,将VLAN 11~20映射到MSTI 1,VLAN 21~30映射到MSTI 2。

[DeviceB] stp region-configuration

[DeviceB-mst-region] region-name test

[DeviceB-mst-region] instance 1 vlan 11 to 20

[DeviceB-mst-region] instance 2 vlan 21 to 30

[DeviceB-mst-region] active region-configuration

[DeviceB-mst-region] quit

# 配置本设备为MSTI 2的根桥,以及MSTI 0的备份根桥。

[DeviceB] stp instance 2 root primary

[DeviceB] stp instance 0 root secondary

# 全局使能生成树协议。

[DeviceB] stp global enable

3.4.3  配置Device C

# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。

<DeviceC> system-view

[DeviceC] vlan 11 to 30

[DeviceC] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/2

[DeviceC-if-range] port link-type trunk

[DeviceC-if-range] port trunk permit vlan 11 to 30

[DeviceC-if-range] quit

# 配置MST域的域名为test,将VLAN 11~20映射到MSTI 1,VLAN 21~30映射到MSTI 2。

[DeviceC] stp region-configuration

[DeviceC-mst-region] region-name test

[DeviceC-mst-region] instance 1 vlan 11 to 20

[DeviceC-mst-region] instance 2 vlan 21 to 30

[DeviceC-mst-region] active region-configuration

[DeviceC-mst-region] quit

# 全局使能生成树协议。

[DeviceC] stp global enable

3.4.4  配置Device D

# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。

<DeviceD> system-view

[DeviceD] vlan 11 to 30

[DeviceD] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/2

[DeviceD-if-range] port link-type trunk

[DeviceD-if-range] port trunk permit vlan 11 to 30

[DeviceD-if-range] quit

# 配置MST域的域名为test,将VLAN 11~20映射到MSTI 1,VLAN 21~30映射到MSTI 2。

[DeviceD] stp region-configuration

[DeviceD-mst-region] region-name test

[DeviceD-mst-region] instance 1 vlan 11 to 20

[DeviceD-mst-region] instance 2 vlan 21 to 30

[DeviceD-mst-region] active region-configuration

[DeviceD-mst-region] quit

# 配置本设备在MSTI 0的优先级为36864,从而使本设备在MSTI 0的优先级低于Device C(Device C使用缺省优先级32768)。

[DeviceD] stp instance 0 priority 36864

# 全局使能生成树协议。

[DeviceD] stp global enable

3.5  验证配置

(1)     查看生成树实例拓扑信息

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

[DeviceA] 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                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/1                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/3                ROOT  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                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/1                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/3                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/1                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

# 查看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

 1        Ten-GigabitEthernet1/0/1                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                ALTE  DISCARDING  NONE

 2        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 2        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

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

[DeviceD] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 1        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/1                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                ALTE  DISCARDING  NONE

根据上述显示信息中的Alternate端口(阻塞端口),可以绘出各VLAN所对应MSTI的拓扑,如图3所示。

图3 MSTI 0~2的拓扑

 

可以看到,Device C和Device D的VLAN 11~20报文和VLAN 21~30报文沿不同的上行链路转发;网络中无二层环路。

(2)     验证链路备份功能

关闭Device C的端口XGE1/0/1(这是Device C在MSTI 0~1中的上行链路所在端口)。然后查看Device A、B、C、D上生成树的简要信息。

[DeviceA] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/3                ROOT  FORWARDING  NONE

[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                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/1                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/3                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/1                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

[DeviceC] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

[DeviceD] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 1        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 1        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/1                ROOT  FORWARDING  NONE

 2        Ten-GigabitEthernet1/0/2                ALTE  DISCARDING  NONE

根据上述显示信息中的Alternate端口(阻塞端口),可以绘出各VLAN所对应MSTI的拓扑,如图4所示。

图4 某链路断开后MSTI 0~2的拓扑

 

 

可以看到,Device C在MSTI 0~1中的上行链路所在端口已从原先的XGE1/0/1切换为XGE1/0/2。

3.6  配置文件

·     Device A

#

vlan 1

#

vlan 11 to 30

#

stp region-configuration

 region-name test

 instance 1 vlan 11 to 20

 instance 2 vlan 21 to 30

 active region-configuration

#

 stp instance 0 to 1 root primary

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/3

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

·     Device B

#

vlan 1

#

vlan 11 to 30

#

stp region-configuration

 region-name test

 instance 1 vlan 11 to 20

 instance 2 vlan 21 to 30

 active region-configuration

#

 stp instance 0 root secondary

 stp instance 2 root primary

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/3

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

·     Device C

#

vlan 1

#

vlan 11 to 30

#

stp region-configuration

 region-name test

 instance 1 vlan 11 to 20

 instance 2 vlan 21 to 30

 active region-configuration

#

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

·     Device D

#

vlan 1

#

vlan 11 to 30

#

stp region-configuration

 region-name test

 instance 1 vlan 11 to 20

 instance 2 vlan 21 to 30

 active region-configuration

#

 stp instance 0 priority 36864

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

interface Ten-GigabitEthernet1/0/2

 port link-type trunk

 port trunk permit vlan 1 11 to 30

#

4  RSTP典型配置举例

4.1  组网需求

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

·     Device A为核心层设备,Device B、Device C为汇聚层设备,Device D、Device E为接入层设备。

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

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

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

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

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

图5 RSTP配置组网图

 

4.2  配置思路

·     要使Device C成为Device B的备份,就给Device B配置较高的桥优先级。本例中配置Device B的优先级为4096,Device C为8192。

·     要使Device A成为根桥,需要使它的桥ID(优先级+MAC地址)在全网最小。本例中Device A的MAC地址小于Device B(如图6所示),配置Device A的优先级为4096就可以使它成为根桥。

说明

要配置一台设备为根桥,也可以用stp root primarystp priority 0命令将其优先级变为0。

 

·     为了维持根桥的稳定,在Device A、B、C的指定端口上开启根保护功能。要找到指定端口,可以在完成本例的配置步骤后,在各设备上用display stp brief命令查找角色为DESI的端口;或者根据STP算法预测如图6所示的生成树拓扑和指定端口信息。

图6 RSTP拓扑图

 

4.3  使用版本

本举例是在S7500XG-CMW710-R7724版本上进行配置和验证的。

4.4  配置步骤

4.4.1  配置Device A

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

<DeviceA> system-view

[DeviceA] stp mode rstp

# 配置设备的优先级为4096。

[DeviceA] stp priority 4096

# 全局使能生成树协议。

[DeviceA] stp global enable

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

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

[DeviceA-if-range] stp root-protection

[DeviceA-if-range] quit

4.4.2  配置Device B

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

<DeviceB> system-view

[DeviceB] stp mode rstp

# 配置设备的优先级为4096。

[DeviceB] stp priority 4096

# 全局使能生成树协议。

[DeviceB] stp global enable

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

[DeviceB] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3

[DeviceB-if-range] stp root-protection

[DeviceB-if-range] quit

4.4.3  配置Device C

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

<DeviceC> system-view

[DeviceC] stp mode rstp

# 配置设备的优先级为8192。

[DeviceC] stp priority 8192

# 全局使能生成树协议。

[DeviceC] stp global enable

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

[DeviceC] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/2

[DeviceC-if-range] stp root-protection

[DeviceC-if-range] quit

4.4.4  配置Device D、E

Device D、E的配置相同,这里以Device D为例。

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

<DeviceD> system-view

[DeviceD] stp mode rstp

# 全局使能生成树协议。

[DeviceD] stp global enable

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

[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

4.5  验证配置

(1)     查看生成树实例拓扑信息

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

[DeviceA] 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

# 查看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

 0        Ten-GigabitEthernet1/0/4                ROOT  FORWARDING  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                DESI  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/3                ALTE  DISCARDING  NONE

 0        Ten-GigabitEthernet1/0/4                ROOT  FORWARDING  NONE

# 查看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  BPDU

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

[DeviceE] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/1                ALTE  DISCARDING  NONE

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/4                DESI  FORWARDING  BPDU

 

根据上述显示信息(角色为ALTE的是阻塞端口,DESI是指定端口,ROOT是根端口),可以绘出生成树的拓扑,如图7所示。

图7 RSTP拓扑示意图

 

(2)     验证根桥保护功能

# 初始状态,Device D认为Device A是根桥。

[DeviceD] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 32768.00e0-fc00-c518

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 4096.0000-fc00-47cd, 40

 RegRoot ID/IRPC     : 32768.00e0-fc00-c518, 0

...

可以看到,Device D上的根桥ID为Device A的桥ID。

# 出于攻击根桥的目的,将Device D的桥优先级设为0(比合法根桥Device A的优先级更高),使Device D认为自己是根桥,并往外发送根桥ID为0.00e0-fc00-c518的BPDU。

[DeviceD] stp priority 0

[DeviceD] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 0.00e0-fc00-c518

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 0.00e0-fc00-c518, 0

 RegRoot ID/IRPC     : 0.00e0-fc00-c518, 0

...

# 将Device E的桥优先级也设为0,使它认为自己是根桥,并往外发送根桥ID为0.7425-8a0f-8000的BPDU。

[DeviceE] stp priority 0

[DeviceE] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 0.7425-8a0f-8000

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 0.7425-8a0f-8000, 0

 RegRoot ID/IRPC     : 0.7425-8a0f-8000, 0

...

# 查看Device B、C上的生成树信息。

[DeviceB] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 4096.7425-8a02-4c00

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 4096.0000-fc00-47cd, 20

 RegRoot ID/IRPC     : 4096.7425-8a02-4c00, 0

...

[DeviceC] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 8192.0cda-41b1-d1c0

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 4096.0000-fc00-47cd, 20

 RegRoot ID/IRPC     : 8192.0cda-41b1-d1c0, 0

...

可以看到Device B、C的根桥ID仍为Device A的桥ID。这是因为Device B、C上与Device D、E相连的指定端口均开启了根保护功能,不受优先级更高的BPDU影响。

# 此时如果把Device B的指定端口(例如连接Device E的Ten-GigabitEthernet1/0/2)去掉根保护功能,则会导致Device B上原有合法根桥Device A失去根桥的地位,引起网络拓扑结构的错误变动。

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

[DeviceB-Ten-GigabitEthernet1/0/2] undo stp root-protection

[DeviceB-Ten-GigabitEthernet1/0/2] display stp

-------[CIST Global Info] [Mode RSTP] -------

 Bridge ID           : 4096.7425-8a02-4c00

 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20

 Root ID/ERPC        : 0.7425-8a0f-8000, 20

...

[DeviceB-Ten-GigabitEthernet1/0/2] display stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/1                DESI  DISCARDING  ROOT

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/3                DESI  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/4                DESI  FORWARDING  NONE

(3)     验证链路备份功能

# 假设Device B因故障重启。在Device B恢复正常前,查看Device A、C、D、E上生成树的简要信息。

[DeviceA] dis stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/2                DESI  FORWARDING  ROOT

[DeviceC] dis 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

 0        Ten-GigabitEthernet1/0/4                ROOT  FORWARDING  NONE

[DeviceD] dis stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/4                DESI  FORWARDING  BPDU

[DeviceE] dis stp brief

 MST ID   Port                                    Role  STP State   Protection

 0        Ten-GigabitEthernet1/0/1                ROOT  FORWARDING  NONE

 0        Ten-GigabitEthernet1/0/4                DESI  FORWARDING  BPDU

可见Device D、E上原先阻塞的端口变为根端口并进入转发状态。

根据上述显示信息可以绘出生成树的拓扑,如图8所示。可见Device B故障的时候由Device C转发数据。

图8 链路备份时的拓扑

 

(4)     验证BPDU保护功能

# 以Device D上的边缘端口XGE1/0/4为例,当它收到BPDU报文时,端口自动进入down状态,以保护生成树拓扑不受外来BPDU影响。可通过以下命令查看被生成树保护功能down掉的端口信息。

[DeviceD] display stp down-port

 Down Port                               Reason

 Ten-GigabitEthernet1/0/4                BPDU-Protected

# 当对端不再发送BPDU报文时,边缘端口XGE1/0/4恢复Up状态。

[DeviceD] display interface brief | include UP

InLoop0               UP   UP(s)    --

M-E0/0/0              UP   UP       192.168.2.125

NULL0                 UP   UP(s)    --

XGE1/0/1              UP   10G(a)  F(a)   T    1

XGE1/0/2              UP   10G(a)  F(a)   T    1

XGE1/0/4              UP   10G(a)  F(a)   A    1

4.6  配置文件

·     Device A

#

vlan 1

#

 stp instance 0 priority 4096

 stp mode rstp

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 stp root-protection

#

interface Ten-GigabitEthernet1/0/2

 stp root-protection

#

·     Device B

#

vlan 1

#

 stp instance 0 priority 4096

 stp mode rstp

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 stp root-protection

#

interface Ten-GigabitEthernet1/0/2

 stp root-protection

#

interface Ten-GigabitEthernet1/0/3

 stp root-protection

#

interface Ten-GigabitEthernet1/0/4

#

·     Device C

#

vlan 1

#

 stp instance 0 priority 8192

 stp mode rstp

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

 stp root-protection

#

interface Ten-GigabitEthernet1/0/2

 stp root-protection

#

interface Ten-GigabitEthernet1/0/3

#

interface Ten-GigabitEthernet1/0/4

#

·     Device D、E

#

vlan 1

#

 stp mode rstp

 stp bpdu-protection

 stp global enable

#

interface Ten-GigabitEthernet1/0/1

#

interface Ten-GigabitEthernet1/0/2

#

interface Ten-GigabitEthernet1/0/4

 stp edged-port

#

5  相关资料

·     H3C S7500X-G系列交换机 二层技术-以太网交换机配置指导-R7724

·     H3C S7500X-G系列交换机 二层技术-以太网交换机命令参考-R7724

 

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

新华三官网
联系我们