04-生成树典型配置指导
本章节下载: 04-生成树典型配置指导 (277.09 KB)
生成树协议是一种二层管理协议,它通过选择性地阻塞网络中的冗余链路来消除二层环路,同时还具备链路备份的功能。
与众多协议的发展过程一样,生成树协议也是随着网络的发展而不断更新的,从最初的STP(Spanning Tree Protocol,生成树协议)到RSTP(Rapid Spanning Tree Protocol,快速生成树协议),再到最新的MSTP(Multiple Spanning Tree Protocol,多生成树协议)。
(1) STP简介
STP由IEEE制定的802.1D标准定义,用于在局域网中消除数据链路层物理环路的协议。运行该协议的设备通过彼此交互信息发现网络中的环路,并有选择的对某些端口进行阻塞,最终将环路网络结构修剪成无环路的树型网络结构,从而防止报文在环路网络中不断增生和无限循环,避免设备由于重复接收相同的报文造成的报文处理能力下降的问题发生。
STP包含了两个含义,狭义的STP是指IEEE 802.1D中定义的STP协议,广义的STP是指包括IEEE 802.1D定义的STP协议以及各种在它的基础上经过改进的生成树协议。
(2) RSTP简介
RSTP由IEEE制定的802.1w标准定义,它在STP基础上进行了改进,实现了网络拓扑的快速收敛。其“快速”体现在,当一个端口被选为根端口和指定端口后,其进入转发状态的延时在某种条件下大大缩短,从而缩短了网络最终达到拓扑稳定所需要的时间。
RSTP可以快速收敛,但是和STP一样存在以下缺陷:局域网内所有网桥共享一棵生成树,不能按VLAN阻塞冗余链路,所有VLAN的报文都沿着一棵生成树进行转发。
(3) MSTP简介
MSTP(Multiple Spanning Tree Protocol,多生成树协议)由IEEE制定的802.1s标准定义,MSTP功能允许用户将一个或者多个VLAN映射到MSTI(Multiple Spanning Tree Instance,多生成树实例)上,使指定VLAN的报文只在建立了映射关系的实例内发送,以节省通信开销和减少资源占用率。
MSTP可以弥补STP和RSTP的缺陷,既可以快速收敛,也能使不同VLAN的流量沿各自的路径转发,从而为冗余链路提供了更好的负载分担机制。
MSTP的特点如下:
l MSTP设置VLAN映射表(即VLAN和生成树的对应关系表),把VLAN和生成树联系起来。通过增加“实例”(将多个VLAN整合到一个集合中)这个概念,将多个VLAN捆绑到一个实例中,以节省通信开销和资源占用率。
l MSTP把一个交换网络划分成多个域,每个域内形成多棵生成树,生成树之间彼此独立。
l MSTP将环路网络修剪成为一个无环的树型网络,避免报文在环路网络中的增生和无限循环,同时还提供了数据转发的多个冗余路径,在数据转发过程中实现VLAN数据的负载分担。
l MSTP兼容STP和RSTP。
如图1-1所示,Device A和Device B为汇聚层设备,Device C和Device D为接入层设备。
l 网络中所有设备属于同一个MSTP域。
l 要求通过配置使不同VLAN的报文按照不同的生成树实例转发:VLAN 10的报文沿实例1转发,VLAN 30沿实例3转发,VLAN 40沿实例4转发,VLAN 20沿实例0转发。
l 要求VLAN 10和VLAN 30在汇聚层设备终结、VLAN 40在接入层设备终结,即配置实例1和实例3的根桥分别为Device A和Device B,实例4的根桥为Device C。
图1-1 MSTP配置组网图
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S5500-SI系列以太网交换机 |
Release 2202 ,Release 2208 |
S5120-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5120-EI-D系列以太网交换机 |
Release 1505 |
S5120-SI系列以太网交换机 |
Release 1101,Release 1505 |
S5120-LI系列以太网交换机 |
Release 1107 |
E552&E528以太网交换机 |
Release 1103 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
S3100V2系列以太网交换机 |
Release 5103 |
E126B以太网交换机 |
Release 5103 |
(1) 配置VLAN和端口
请按照图1-1所示,在Device A和Device B上分别创建VLAN 10、20和30,在Device C上创建VLAN 10、20和40,在Device D上创建VLAN 20、30和40;将各设备的各端口配置为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 gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port link-type trunk
[DeviceA-GigabitEthernet1/0/1] undo port trunk permit vlan 1
[DeviceA-GigabitEthernet1/0/1] port trunk permit vlan 10 20
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-GigabitEthernet1/0/2] undo port trunk permit vlan 1
[DeviceA-GigabitEthernet1/0/2] port trunk permit vlan 20 30
[DeviceA-GigabitEthernet1/0/2] quit
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-type trunk
[DeviceA-GigabitEthernet1/0/3] undo port trunk permit vlan 1
[DeviceA-GigabitEthernet1/0/3] port trunk permit vlan 10 20 30
[DeviceA-GigabitEthernet1/0/3] quit
(2) 配置Device A
# 配置MST域的域名为example,将VLAN 10、30、40分别映射到生成树实例1、3、4上,并配置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 3 vlan 30
[DeviceA-mst-region] instance 4 vlan 40
[DeviceA-mst-region] revision-level 0
# 激活MST域的配置。
[DeviceA-mst-region] active region-configuration
[DeviceA-mst-region] quit
# 配置本设备为生成树实例1的根桥。
[DeviceA] stp instance 1 root primary
# 全局使能MSTP协议。
[DeviceA] stp enable
(3) 配置Device B
# 配置MST域的域名为example,将VLAN 10、30、40分别映射到生成树实例1、3、4上,并配置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 3 vlan 30
[DeviceB-mst-region] instance 4 vlan 40
[DeviceB-mst-region] revision-level 0
# 激活MST域的配置。
[DeviceB-mst-region] active region-configuration
[DeviceB-mst-region] quit
# 配置本设备为生成树实例3的根桥。
[DeviceB] stp instance 3 root primary
# 全局使能MSTP协议。
[DeviceB] stp enable
(4) 配置Device C
# 配置MST域的域名为example,将VLAN 10、30、40分别映射到生成树实例1、3、4上,并配置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 3 vlan 30
[DeviceC-mst-region] instance 4 vlan 40
[DeviceC-mst-region] revision-level 0
# 激活MST域的配置。
[DeviceC-mst-region] active region-configuration
[DeviceC-mst-region] quit
# 配置本设备为生成树实例4的根桥。
[DeviceC] stp instance 4 root primary
# 全局使能MSTP协议。
[DeviceC] stp enable
(5) 配置Device D
# 配置MST域的域名为example,将VLAN 10、30、40分别映射到生成树实例1、3、4上,并配置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 3 vlan 30
[DeviceD-mst-region] instance 4 vlan 40
[DeviceD-mst-region] revision-level 0
# 激活MST域的配置。
[DeviceD-mst-region] active region-configuration
[DeviceD-mst-region] quit
# 全局使能MSTP协议。
[DeviceD] stp enable
(6) 检验配置效果
当网络拓扑稳定后,通过使用display stp brief命令可以查看各设备上生成树的简要信息。例如:
# 查看Device A上生成树的简要信息。
[DeviceA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 DESI FORWARDING NONE
1 GigabitEthernet1/0/3 DESI FORWARDING NONE
3 GigabitEthernet1/0/2 DESI FORWARDING NONE
3 GigabitEthernet1/0/3 ROOT FORWARDING NONE
# 查看Device B上生成树的简要信息。
[DeviceB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
1 GigabitEthernet1/0/2 DESI FORWARDING NONE
1 GigabitEthernet1/0/3 ROOT FORWARDING NONE
3 GigabitEthernet1/0/1 DESI FORWARDING NONE
3 GigabitEthernet1/0/3 DESI FORWARDING NONE
# 查看Device C上生成树的简要信息。
[DeviceC] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING NONE
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
0 GigabitEthernet1/0/3 DESI FORWARDING NONE
1 GigabitEthernet1/0/1 ROOT FORWARDING NONE
1 GigabitEthernet1/0/2 ALTE DISCARDING NONE
4 GigabitEthernet1/0/3 DESI FORWARDING NONE
# 查看Device D上生成树的简要信息。
[DeviceD] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
0 GigabitEthernet1/0/3 ALTE DISCARDING NONE
3 GigabitEthernet1/0/1 ROOT FORWARDING NONE
3 GigabitEthernet1/0/2 ALTE DISCARDING NONE
4 GigabitEthernet1/0/3 ROOT FORWARDING NONE
根据上述显示信息,可以绘出各VLAN所对应的MSTI,如图1-2所示。
图1-2 各VLAN对应的MSTI示意图
l Device A上的配置
#
vlan 10
#
vlan 20
#
vlan 30
#
stp instance 1 root primary
stp enable
stp region-configuration
region-name example
instance 1 vlan 10
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
#
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/2
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 30
#
interface GigabitEthernet1/0/3
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20 30
#
l Device B上的配置
#
vlan 10
#
vlan 20
#
vlan 30
#
stp instance 3 root primary
stp enable
stp region-configuration
region-name example
instance 1 vlan 10
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
#
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 30
#
interface GigabitEthernet1/0/2
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/3
port link-type trunk
port trunk permit vlan all
#
l Device C上的配置
#
vlan 10
#
vlan 20
#
vlan 40
#
stp instance 4 root primary
stp enable
stp region-configuration
region-name example
instance 1 vlan 10
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
#
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/2
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/3
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 40
#
l Device D上的配置
#
vlan 20
#
vlan 30
#
vlan 40
#
stp enable
stp region-configuration
instance 1 vlan 10
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
#
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 30
#
interface GigabitEthernet1/0/2
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 30
#
interface GigabitEthernet1/0/3
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 20 40
#
l 不能同时在端口上配置MSTP和以下功能:业务环回、RRPP、Smart Link和STP协议的BPDU Tunnel功能。
l 当同时使能GVRP和生成树协议时,GVRP报文将沿CIST传播。因此当同时使能了GVRP和生成树协议时,如果希望通过GVRP在网络中发布某个VLAN,则配置生成树协议的VLAN映射表时要保证将该VLAN映射到CIST上。
l 两台或多台使能了生成树协议的设备若要属于同一个MST域,必须同时满足以下两个条件:第一是选择因子(取值为0,不可配)、域名、修订级别和VLAN映射表的配置都相同;第二是这些设备之间的链路相通。
l 在完整配置显示时,部分设备缺省全局开启STP功能,这些设备的完整配置中没有stp enable项。
l S5120-SI系列交换机Release 1101版本、E552&E528以太网交换机Release 1103版本生成树实例取值范围为0~3,最多支持配置4个生成树实例。
l S5120-LI系列交换机Release 1107版本生成树实例的取值为0或1,最多支持配置2个生成树实例。
根据IEEE 802.1s规定,只有在MST域配置(包括域名、修订级别、VLAN映射关系和配置摘要)完全一致的情况下,相连的设备才被认为是在同一个域内。当设备使能了MSTP协议以后,设备之间通过识别BPDU数据报文内的配置ID来判断相连的设备是否与自己处于相同的MST域内;配置ID包含域名、修订级别、配置摘要等内容,其中配置摘要长16字节,是由HMAC-MD5算法将VLAN实例映射关系加密计算而成。
在网络中,由于一些厂商的设备在对MSTP协议的实现上存在差异,即用加密算法计算配置摘要时采用私有的密钥,从而导致即使MST域配置相同,不同厂商的设备之间也不能实现在MSTP域内的互通。
通过在设备上与对MSTP协议的实现存在私有性差异的第三方厂商设备相连的端口使能摘要侦听功能,可以实现与这些厂商设备在MST域内的完全互通。
l Device C为第三方厂商设备,并已经被配置为根交换机,Device C对MSTP协议的实现存在私有性差异;
l Device A和Device B分别与Device C互联,并配置在同一域内;
l 在Device A和Device B上使能摘要侦听功能,实现与Device C在MSTP域内的互通。
图1-3 摘要侦听功能配置组网图
表1-2 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S5500-SI系列以太网交换机 |
Release 2202 ,Release 2208 |
S5120-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5120-EI-D系列以太网交换机 |
Release 1505 |
S5120-SI系列以太网交换机 |
Release 1101,Release 1505 |
S5120-LI系列以太网交换机 |
Release 1107 |
E552&E528以太网交换机 |
Release 1103 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
S3100V2系列以太网交换机 |
Release 5103 |
E126B以太网交换机 |
Release 5103 |
Device A、Device B和Device C互联并配置在同一MSTP域内。三台设备均已经完成MSTP基本配置,具体配置过程略。
(1) 配置Device A
# 在Device A的端口GigabitEthernet1/0/1上使能摘要侦听功能,并全局使能摘要侦听功能。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] stp config-digest-snooping
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] stp config-digest-snooping
(2) 配置Device B
# 在Device B的端口GigabitEthernet1/0/1上使能摘要侦听功能,并全局使能摘要侦听功能。
<DeviceB> system-view
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] stp config-digest-snooping
[DeviceB-GigabitEthernet1/0/1] quit
[DeviceB] stp config-digest-snooping
(3) 检验配置效果
当网络拓扑稳定后,通过使用display stp brief命令可以查看各设备上生成树的简要信息。
l Device A上的配置
#
stp config-digest-snooping
#
interface GigabitEthernet1/0/1
stp config-digest-snooping
#
l Device B上的配置
#
stp config-digest-snooping
#
interface GigabitEthernet1/0/1
stp config-digest-snooping
#
l 摘要侦听功能在端口生效后,由于不再通过配置摘要的比较计算来判断是否在同一个域内,因此需要保证互连设备的域配置中VLAN与MSTI映射关系的配置相同。
l 全局使能摘要侦听功能后,禁止修改MST域配置中VLAN与MSTI的映射关系,禁止执行undo stp region-configuration命令取消当前域配置,但可以修改域配置中的域名和修订级别。
l 只有当全局和端口上都使能了摘要侦听功能后,该功能才能生效。使能摘要侦听功能时,建议先在所有与第三方厂商设备相连的端口上使能该功能,再全局使能该功能,以一次性让所有端口的配置生效,从而减少对网络的冲击。
l 请不要在MST域的边界端口上使能摘要侦听功能,否则可能会导致环路。
l 建议配置完摘要侦听功能后再使能生成树协议。在网络稳定的情况下不要进行摘要侦听功能的配置,以免造成临时的流量中断。
RSTP和MSTP的指定端口快速迁移机制使用两种协议报文:
l Proposal报文:指定端口请求快速迁移的报文。
l Agreement报文:同意对端进行快速迁移的报文。
上游设备的指定端口需要向下游设备发送Proposal报文,请求快速切换;该指定端口收到下游设备根端口回复的Agreement报文后才能进行快速迁移,转为转发状态。
当我方设备与作为上游设备且与对生成树协议的实现存在差异的第三方厂商设备互联时,二者在快速迁移的配合上可能会存在一定的限制。
通过在我方设备与对生成树协议的实现存在私有性差异的上游第三方厂商设备相连的端口上使能No Agreement Check功能,可避免这种情况的出现,使得上游的第三方厂商设备的指定端口能够进行状态的快速迁移。
图1-4 No Agreement Check功能配置组网图
l Device A与对MSTP协议的实现存在私有性差异的第三方厂商设备Device B互连并配置在同一域内;
l Device B作为域根,Device A作为下游设备;
l 在Device A与Device B连接的端口上使能摘要侦听功能,实现设备在MSTP域内的互通。
表1-3 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S5500-SI系列以太网交换机 |
Release 2202 ,Release 2208 |
S5120-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5120-EI-D系列以太网交换机 |
Release 1505 |
S5120-SI系列以太网交换机 |
Release 1101,Release 1505 |
S5120-LI系列以太网交换机 |
Release 1107 |
E552&E528以太网交换机 |
Release 1103 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
S3100V2系列以太网交换机 |
Release 5103 |
E126B以太网交换机 |
Release 5103 |
Device A和Device B物理直连并配置在同一MSTP域内。Device B作为域根,Device A作为下游设备。两台设备均已经完成MSTP基本配置,具体配置过程略。
(1) 配置Device A
# 在Device A的端口GigabitEthernet1/0/1上使能No Agreement Check功能。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] stp no-agreement-check
(2) 检验配置效果
当网络拓扑稳定后,通过使用display stp brief命令可以查看各设备上生成树的简要信息。
l Device A上的配置
#
interface GigabitEthernet1/0/1
stp no-agreement-check
#
请在设备的根端口上进行No Agreement Check功能配置。只有在根端口上配置本功能才会生效。
图1-5 RSTP配置组网图
如图1-5所示,用户局域网内采用分层组网,使用RSTP技术阻断环路,实现链路备份,要求:
(1) Device A为核心层交换机,作为树根
(2) Device B、Device C为汇聚层交换机
l Device C为Device B的备份交换机,当Device B出现故障的时候,由Device C转发数据
l Device C和Device B之间通过两条链路相连,保证在一条链路发生故障的时候,另一条可以正常工作
(3) Device D、Device E、Device F为接入层交换机
l Device D、Device E、Device F下面直接挂接用户的计算机
l Device D、Device E、Device F分别通过一个端口与Device C、Device B相连
l Device A一般是高中端交换机,如S7500E系列交换机。
l Device B、Device C一般为低端交换机中的S5800系列、S5500系列交换机。
l Device D、Device E、Device F一般为低端交换机中的S5120系列、S3610系列等。
l 在后面的配置步骤中仅列出了RSTP相关的配置。
根据用户的需求,需要进行如下配置:
l 配置Device A为树根;
l 配置Device B的Bridge优先级为4096,Device C的Bridge优先级配置为8192,使得Device C充当Device B的备份交换机;
l 在Device A、Device B、Device C的指定端口上启动根保护功能;
l 启动根桥设备Device A的TC防攻击功能;
l 将Device D、E、F直接与用户相连的端口配置为边缘端口,并使能BPDU保护功能。
表1-4 配置适用的产品与软件版本关系
产品 |
软件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列 |
S7600系列以太网交换机 |
Release 6600系列,Release 6610系列 |
S5800&S5820X系列以太网交换机 |
Release 1110,Release 1211 |
CE3000-32F以太网交换机 |
Release 1211 |
S5810系列以太网交换机 |
Release 1102 |
S5500-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5500-EI-D系列以太网交换机 |
Release 2208 |
S5500-SI系列以太网交换机 |
Release 2202 ,Release 2208 |
S5120-EI系列以太网交换机 |
Release 2202,Release 2208 |
S5120-EI-D系列以太网交换机 |
Release 1505 |
S5120-SI系列以太网交换机 |
Release 1101,Release 1505 |
S5120-LI系列以太网交换机 |
Release 1107 |
E552&E528以太网交换机 |
Release 1103 |
S3610&S5510系列以太网交换机 |
Release 5301,Release 5303,Release 5306,Release 5309 |
S3500-EA系列以太网交换机 |
Release 5303,Release 5309 |
S3100V2系列以太网交换机 |
Release 5103 |
E126B以太网交换机 |
Release 5103 |
(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 GigabitEthernet 2/0/1
[DeviceA-GigabitEthernet2/0/1] stp root-protection
[DeviceA-GigabitEthernet2/0/1] quit
[DeviceA] interface GigabitEthernet 2/0/2
[DeviceA-GigabitEthernet2/0/2] stp root-protection
[DeviceA-GigabitEthernet2/0/2] quit
# 启动Device A的TC防攻击功能(可选,该功能缺省情况下处于开启状态)。
[DeviceA] stp tc-protection enable
# 全局启动RSTP功能。
[DeviceA] stp enable
# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出GigabitEthernet 2/0/4)
[DeviceA] interface GigabitEthernet 2/0/4
[DeviceA-GigabitEthernet2/0/4] undo stp enable
[DeviceA-GigabitEthernet2/0/4] quit
(2) 配置Device B
# 配置设备工作在RSTP模式。
<DeviceB> system-view
[DeviceB] stp mode rstp
# 配置Device B的Bridge优先级为4096。
[DeviceB] stp priority 4096
# 在各个指定端口上启动根保护功能
[DeviceB] interface GigabitEthernet 1/0/4
[DeviceB-GigabitEthernet1/0/4] stp root-protection
[DeviceB-GigabitEthernet1/0/4] quit
[DeviceB] interface GigabitEthernet 1/0/5
[DeviceB-GigabitEthernet1/0/5] stp root-protection
[DeviceB-GigabitEthernet1/0/5] quit
[DeviceB] interface GigabitEthernet 1/0/6
[DeviceB-GigabitEthernet1/0/6] stp root-protection
[DeviceB-GigabitEthernet1/0/6] quit
# MSTP的工作模式、时间参数、端口上的参数都采用缺省值。
# 全局启动RSTP功能。
[DeviceB] stp enable
# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出GigabitEthernet 1/0/8)
[DeviceB] interface GigabitEthernet 1/0/8
[DeviceB-GigabitEthernet1/0/8] undo stp enable
[DeviceB-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 GigabitEthernet 1/0/4
[DeviceC-GigabitEthernet1/0/4] stp root-protection
[DeviceC-GigabitEthernet1/0/4] quit
[DeviceC] interface GigabitEthernet 1/0/5
[DeviceC-GigabitEthernet1/0/5] stp root-protection
[DeviceC-GigabitEthernet1/0/5] quit
[DeviceC] interface GigabitEthernet 1/0/6
[DeviceC-GigabitEthernet1/0/6] stp root-protection
[DeviceC-GigabitEthernet1/0/6] quit
# MSTP的工作模式、时间参数、端口上的参数都采用缺省值。
# 全局启动RSTP功能。
[DeviceC] stp enable
# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出GigabitEthernet 1/0/8)
[DeviceC] interface GigabitEthernet 1/0/8
[DeviceC-GigabitEthernet1/0/8] undo stp enable
[DeviceC-GigabitEthernet1/0/8] quit
(4) 配置Device D
# 配置设备工作在RSTP模式。
<DeviceD> system-view
[DeviceD] stp mode rstp
# 将直接与用户相连的端口配置为边缘端口,并使能BPDU保护功能。(此处仅以GigabitEthernet 1/0/4为例)
[DeviceD] interface GigabitEthernet 1/0/4
[DeviceD-GigabitEthernet1/0/4] stp edged-port enable
[DeviceD-GigabitEthernet1/0/4] quit
[DeviceD] stp bpdu-protection
# MSTP的工作模式、时间参数、端口的其他参数都采用缺省值。
# 全局启动RSTP功能。
[DeviceD] stp enable
# 全局启动RSTP功能后,各个端口的RSTP默认为启动状态,在不参与RSTP计算的端口上关闭STP,注意不要将参与RSTP计算的端口STP关闭。(此处仅列举出GigabitEthernet 1/0/3)
[DeviceD] interface GigabitEthernet 1/0/3
[DeviceD-GigabitEthernet1/0/3] undo stp enable
[DeviceD-GigabitEthernet1/0/3] quit
(5) 配置Device E和Device F
# Device E和F的配置同Device D,此处不再赘述。
(6) 检验配置效果
当网络拓扑稳定后,通过使用display stp brief命令可以查看各设备上生成树的简要信息。
l Device A上的配置
#
stp mode rstp
stp instance 0 root primary
stp enable
#
interface GigabitEthernet2/0/1
stp root-portection
#
interface GigabitEthernet2/0/2
stp root-portection
#
interface GigabitEthernet2/0/4
undo stp enable
#
l Device B上的配置
#
stp mode rstp
stp instance 0 priority 4096
stp enable
#
interface GigabitEthernet1/0/4
stp root-portection
#
interface GigabitEthernet1/0/5
stp root-portection
#
interface GigabitEthernet1/0/6
stp root-portection
#
interface GigabitEthernet1/0/8
undo stp enable
#
l Device C上的配置
#
stp mode rstp
stp instance 0 priority 8192
stp enable
#
interface GigabitEthernet1/0/4
stp root-portection
#
interface GigabitEthernet1/0/5
stp root-portection
#
interface GigabitEthernet1/0/6
stp root-portection
#
interface GigabitEthernet1/0/8
undo stp enable
#
l Device D上的配置
#
stp mode rstp
stp bpdu-protection
stp enable
#
interface GigabitEthernet1/0/3
undo stp enable
#
interface GigabitEthernet1/0/4
stp edged-port enable
l stp mode命令用于设置交换机的STP工作模式:STP、RSTP或MSTP。设备缺省工作于MSTP模式。
l 某些产品的某些版本不支持undo stp enable命令,请使用stp disable命令关闭STP功能。
l 本例中假定所有设备的端口路径开销相同。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!