16-生成树快速配置指南
本章节下载 (239.22 KB)
生成树快速配置指南
Copyright © 2024 新华三技术有限公司 版权所有,保留一切权利。
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。
除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。
本文档中的信息可能变动,恕不另行通知。
本案例介绍MSTP(Multiple Spanning Tree Protocol,多生成树协议)的配置方法。
如图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配置组网图
要使所有设备属于同一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域根。形成的多个生成树实例拓扑如1.3 图2所示。
图2 各VLAN对应的生成树实例的拓扑
<DeviceA> system-view
[DeviceA] vlan 11 to 30
[DeviceA] interface range gigabitethernet 1/0/1 to 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
# 保存配置。
[DeviceA] save force
# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。
<DeviceB> system-view
[DeviceB] vlan 11 to 30
[DeviceB] interface range gigabitethernet 1/0/1 to 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
# 保存配置。
[DeviceB] save force
# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。
<DeviceC> system-view
[DeviceC] vlan 11 to 30
[DeviceC] interface range gigabitethernet 1/0/1 to 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
# 保存配置。
[DeviceC] save force
# 创建VLAN 11~30。将设备的各端口配置为Trunk端口并允许VLAN 11~30通过。
<DeviceD> system-view
[DeviceD] vlan 11 to 30
[DeviceD] interface range gigabitethernet 1/0/1 to 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
# 保存配置。
[DeviceD] save force
# 查看Device A上生成树的简要信息。
[DeviceA] display stp brief
MST ID 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/1 DESI FORWARDING NONE
1 GigabitEthernet1/0/2 DESI FORWARDING NONE
1 GigabitEthernet1/0/3 DESI FORWARDING NONE
2 GigabitEthernet1/0/1 ALTE FORWARDING NONE
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/3 ROOT FORWARDING NONE
# 查看Device B上生成树的简要信息。
[DeviceB] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING 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/2 ALTE FORWARDING NONE
1 GigabitEthernet1/0/3 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING NONE
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/3 DESI FORWARDING NONE
# 查看Device C上生成树的简要信息。
[DeviceC] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
1 GigabitEthernet1/0/1 ROOT FORWARDING NONE
1 GigabitEthernet1/0/2 DESI DISCARDING NONE
2 GigabitEthernet1/0/1 DESI DISCARDING NONE
2 GigabitEthernet1/0/2 ROOT FORWARDING NONE
# 查看Device D上生成树的简要信息。
[DeviceD] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 ALTE DISCARDING NONE
1 GigabitEthernet1/0/2 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 ROOT FORWARDING NONE
2 GigabitEthernet1/0/2 ALTE DISCARDING NONE
根据上述显示信息中的Alternate端口(阻塞端口),可以绘出各VLAN所对应MSTI的拓扑,
如1.5 1. 图3所示。
图3 MSTI 0~2的拓扑
可以看到,Device C和Device D的VLAN 11~20报文和VLAN 21~30报文沿不同的上行链路转发;网络中无二层环路。
# 关闭Device C的端口GigabitEthernet1/0/1(这是Device C在MSTI 0~1中的上行链路所在端口)。
[DeviceC] interface gigabitethernet 1/0/1
[DeviceC-GigabitEthernet1/0/1] shutdown
# 查看Device A、B、C、D上生成树的简要信息。
[DeviceA] display stp brief
MST ID Port Role STP State Protection
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 DESI FORWARDING NONE
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/3 ROOT FORWARDING NONE
[DeviceB] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING 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/2 DESI FORWARDING NONE
1 GigabitEthernet1/0/3 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING NONE
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/3 DESI FORWARDING NONE
[DeviceC] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
1 GigabitEthernet1/0/2 ROOT FORWARDING NONE
2 GigabitEthernet1/0/2 ROOT FORWARDING NONE
[DeviceD] display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 ALTE DISCARDING NONE
1 GigabitEthernet1/0/2 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 ROOT FORWARDING NONE
2 GigabitEthernet1/0/2 ALTE DISCARDING NONE
根据上述显示信息中的Alternate端口(阻塞端口),可以绘出各VLAN所对应MSTI的拓扑,
如2. 图4所示。
图4 某链路断开后MSTI 0~2的拓扑
可以看到,Device C在MSTI 0~1中的上行链路所在端口已从原先的GigabitEthernet1/0/1切换为GigabitEthernet1/0/2。
· 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 GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/3
port link-mode bridge
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 GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/3
port link-mode bridge
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 GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/2
port link-mode bridge
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 GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 11 to 30
· 产品配套“二层技术-以太网交换配置指导”中的“生成树”。
· 产品配套“二层技术-以太网交换命令参考”中的“生成树”。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!