配置VBST与Rapid PVST+对接指导
组网需求
某企业进行网络升级,将原网络中的部分交换机替换为华为CloudEngine系列交换机,升级后的组网如图3-10所示,其中SwitchB、SwitchC和SwitchD为华为CloudEngine系列交换机。接入交换机SwitchC和SwitchD分别双归接入到汇聚交换机SwitchA和SwitchB。SwitchC接入VLAN10、VLAN20的业务流量,SwitchD接入VLAN20、VLAN30的业务流量。由于双归接入,在接入层和汇聚层之间形成环形网络。原网络中所有交换机都运行Rapid PVST+协议,企业希望网络升级后,原业务能正常运行,各VLAN内的业务流量正常转发,同时希望不同VLAN内的业务流量能够在链路上负载分担,以提高链路利用率。
配置思路
原网络为环状网络,通过Rapid PVST+协议进行破环以及VLAN10和VLAN20的业务流量的负载分担。替换后,华为交换机需要能与运行Rapid PVST+协议的交换机对接互通,并能实现不同VLAN的业务流量的负载分担,为此可在华为交换机上部署VBST功能使各VLAN内的业务流量正常转发,同时,使不同VLAN内的业务流量能够在链路上负载分担。配置思路如下:
- 配置接入交换机和汇聚交换机的二层转发功能。
在处于环形网络中的交换机(SwitchB~SwitchD)上配置VBST基本功能。为使VBST计算产生如图3-10中所示的VLAN生成树并且保持其他厂商设备的配置不变。配置时:
- 将VLAN10的备份根桥设置为SwitchB;将VLAN20的备份根桥设置为SwitchB;将VLAN30的根桥设置为SwitchB,确保根桥设备的可靠性。
- 将SwitchC的端口10GE1/0/2在VLAN10、VLAN20中设置较大的路径开销值,使其分别在VLAN10、VLAN20的生成树中阻塞;将SwitchD的端口10GE1/0/2在VLAN20、VLAN30中设置较大的路径开销值,使其分别在VLAN20、VLAN30的生成树中阻塞。
- 设置端口路径开销计算方法,使其与对接设备保持一致。
- 配置当前端口使用的快速迁移机制,确保互通成功。
操作步骤
- 配置处于环网中的设备的二层转发功能。
在交换设备SwitchB、SwitchC和SwitchD上创建VLAN10、VLAN20和VLAN30。
# 在SwitchB上创建VLAN10、VLAN20和VLAN30。
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] vlan batch 10 20 30 [*SwitchB] commit
# 在SwitchC上创建VLAN10和VLAN20。
<HUAWEI> system-view [~HUAWEI] sysname SwitchC [*HUAWEI] commit [~SwitchC] vlan batch 10 20 [*SwitchC] commit
# 在SwitchD上创建VLAN20和VLAN30。
<HUAWEI> system-view [~HUAWEI] sysname SwitchD [*HUAWEI] commit [~SwitchD] vlan batch 20 30 [*SwitchD] commit
将交换机上接入环路中的端口加入VLAN。
# 将SwitchB端口10GE1/0/1加入VLAN10、VLAN20和VLAN30。
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] port link-type trunk [*SwitchB-10GE1/0/1] port trunk allow-pass vlan 10 20 30 [*SwitchB-10GE1/0/1] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/1] quit [*SwitchB] commit
# 将SwitchB端口10GE1/0/2加入VLAN10和VLAN20。
[~SwitchB] interface 10ge 1/0/2 [~SwitchB-10GE1/0/2] port link-type trunk [*SwitchB-10GE1/0/2] port trunk allow-pass vlan 10 20 [*SwitchB-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/2] quit [*SwitchB] commit
# 将SwitchB端口10GE1/0/3加入VLAN20和VLAN30。
[~SwitchB] interface 10ge 1/0/3 [~SwitchB-10GE1/0/3] port link-type trunk [*SwitchB-10GE1/0/3] port trunk allow-pass vlan 20 30 [*SwitchB-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/3] quit [*SwitchB] commit
# 将SwitchC端口10GE1/0/2加入VLAN10和VLAN20。
[~SwitchC] interface 10ge 1/0/2 [~SwitchC-10GE1/0/2] port link-type trunk [*SwitchC-10GE1/0/2] port trunk allow-pass vlan 10 20 [*SwitchC-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchC-10GE1/0/2] quit [*SwitchC] commit
# 将SwitchC端口10GE1/0/3加入VLAN10和VLAN20。
[~SwitchC] interface 10ge 1/0/3 [~SwitchC-10GE1/0/3] port link-type trunk [*SwitchC-10GE1/0/3] port trunk allow-pass vlan 10 20 [*SwitchC-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchC-10GE1/0/3] quit [*SwitchC] commit
# 将SwitchC端口10GE1/0/4加入VLAN10,10GE1/0/5加入VLAN20。
[~SwitchC] interface 10ge 1/0/4 [~SwitchC-10GE1/0/4] port link-type access [*SwitchC-10GE1/0/4] port default vlan 10 [*SwitchC-10GE1/0/4] quit [*SwitchC] interface 10ge 1/0/5 [*SwitchC-10GE1/0/5] port link-type access [*SwitchC-10GE1/0/5] port default vlan 20 [*SwitchC-10GE1/0/5] quit [*SwitchC] commit
# 将SwitchD端口10GE1/0/2加入VLAN20和VLAN30。
[~SwitchD] interface 10ge 1/0/2 [~SwitchD-10GE1/0/2] port link-type trunk [*SwitchD-10GE1/0/2] port trunk allow-pass vlan 20 30 [*SwitchD-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchD-10GE1/0/2] quit [*SwitchD] commit
# 将SwitchD端口10GE1/0/3加入VLAN20和VLAN30。
[~SwitchD] interface 10ge 1/0/3 [~SwitchD-10GE1/0/3] port link-type trunk [*SwitchD-10GE1/0/3] port trunk allow-pass vlan 20 30 [*SwitchD-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchD-10GE1/0/3] quit [*SwitchD] commit
# 将SwitchD端口10GE1/0/4加入VLAN20,10GE1/0/5加入VLAN30。
[~SwitchD] interface 10ge 1/0/4 [~SwitchD-10GE1/0/4] port link-type access [*SwitchD-10GE1/0/4] port default vlan 20 [*SwitchD-10GE1/0/4] quit [*SwitchD] interface 10ge 1/0/5 [*SwitchD-10GE1/0/5] port link-type access [*SwitchD-10GE1/0/5] port default vlan 30 [*SwitchD-10GE1/0/5] quit [*SwitchD] commit
- 配置VBST基本功能。
配置根桥和备份根桥设备。
配置VLAN10的备份根桥。
# 配置SwitchB在VLAN10内的桥优先级28672,为VLAN10的备份根桥。
[~SwitchB] stp vlan 10 priority 28672 [*SwitchB] commit
配置VLAN20备份根桥。
# 配置SwitchB在VLAN20内的桥优先级28672,为VLAN20的备份根桥。
[~SwitchB] stp vlan 20 priority 28672 [*SwitchB] commit
配置VLAN30的根桥。
# 配置SwitchB在VLAN30内的桥优先级24576,为VLAN30的根桥。
[~SwitchB] stp vlan 30 priority 24576 [*SwitchB] commit
生成树的根桥、备份根桥可以通过执行命令stp root 来手动配置,但在与其他厂商设备对接时,由于不同厂商设定的根桥、备份根桥优先级不同,通过该方式来配置根桥、备份根桥则可能会出现生成树计算与配置不一致。如果要明确组网中的根桥、备份根桥,建议通过执行命令stp priority 来直接更改桥优先级,设定根桥、备份根桥的选举结果。
配置各VLAN中端口的路径开销值,实现将该端口阻塞。
端口路径开销值取值范围由路径开销计算方法决定。在与其他厂商设备对接时,两端端口路径开销计算方法要确保一致。本例场景中,华为交换机使用缺省的IEEE 802.1t计算方法。
同一网络内所有交换机的端口路径开销应使用相同的计算方法。
为确保阻塞点在图3-10所示位置,设置SwitchC的端口10GE1/0/2和SwitchD的端口10GE1/0/2的路径开销值大于网络中其他端口的路径开销值,本例设置为2000000(其他端口的路径开销值均小于此值)。
# 将SwitchC上的端口10GE1/0/2在VLAN10中的路径开销值配置为2000000,在VLAN20中的路径开销值配置为2000000。
[~SwitchC] interface 10ge 1/0/2 [~SwitchC-10GE1/0/2] stp vlan 10 cost 2000000 [*SwitchC-10GE1/0/2] stp vlan 20 cost 2000000 [*SwitchC-10GE1/0/2] quit [*SwitchC] commit
# 将SwitchD上的端口10GE1/0/2在VLAN20中的路径开销值配置为2000000,在VLAN30中的路径开销值配置为2000000。
[~SwitchD] interface 10ge 1/0/2 [~SwitchD-10GE1/0/2] stp vlan 20 cost 2000000 [*SwitchD-10GE1/0/2] stp vlan 30 cost 2000000 [*SwitchD-10GE1/0/2] quit [*SwitchD] commit
- 配置端口的快速迁移机制,确保与其他厂商设备互通。
需要根据其他厂商设备的Proposal/Agreement机制,选择端口使用增强的快速迁移机制还是普通的快速迁移机制。本例中,其他厂商设备SwitchA使用普通的快速迁移方式。
# 配置SwitchB与其他厂商设备对接的接口10GE1/0/1、10GE1/0/2和10GE1/0/3使用普通的快速迁移方式。
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] stp no-agreement-check [*SwitchB-10GE1/0/1] quit [*SwitchB] interface 10ge 1/0/2 [*SwitchB-10GE1/0/2] stp no-agreement-check [*SwitchB-10GE1/0/2] quit [*SwitchB] interface 10ge 1/0/3 [*SwitchB-10GE1/0/3] stp no-agreement-check [*SwitchB-10GE1/0/3] quit [*SwitchB] commit
# 配置SwitchC与其他厂商设备对接的接口10GE1/0/2和10GE1/0/3使用普通的快速迁移方式。
[~SwitchC] interface 10ge 1/0/2 [~SwitchC-10GE1/0/2] stp no-agreement-check [*SwitchC-10GE1/0/2] quit [*SwitchC] interface 10ge 1/0/3 [*SwitchC-10GE1/0/3] stp no-agreement-check [*SwitchC-10GE1/0/3] quit [*SwitchC] commit
# 配置SwitchD与其他厂商设备对接的接口10GE1/0/2和10GE1/0/3使用普通的快速迁移方式。
[~SwitchD] interface 10ge 1/0/2 [~SwitchD-10GE1/0/2] stp no-agreement-check [*SwitchD-10GE1/0/2] quit [*SwitchD] interface 10ge 1/0/3 [*SwitchD-10GE1/0/3] stp no-agreement-check [*SwitchD-10GE1/0/3] quit [*SwitchD] commit
配置华为交换机的生成树协议工作在VBST模式。
# 配置交换机SwitchB的工作模式为VBST。
[~SwitchB] stp mode vbst [*SwitchB] commit
# 配置交换机SwitchC的工作模式为VBST。
[~SwitchC] stp mode vbst [*SwitchC] commit
# 配置交换机SwitchD的工作模式为VBST。
[~SwitchD] stp mode vbst [*SwitchD] commit
使能VBST,实现破除环路。
全局使能VBST功能。
缺省情况下,全局VBST功能已使能。
为确保全局VBST使能,可执行命令display stp global查看VBST的使能状态。如果未使能,请在系统视图执行命令stp enable全局使能VBST功能。
VLAN使能VBST功能。
缺省情况下,VLAN上的VBST功能处于使能状态。
为确保VLAN的VBST功能使能,可执行命令display stp vlan vlan-id information查看VLAN上的VBST状态。如果提示该VLAN上VBST功能未使能,请在系统视图执行命令undo stp vlan vlan-id disable使能该VLAN的VBST功能。
- 验证配置结果。
经过以上配置,在网络计算稳定后,执行以下操作,验证配置结果。
# 在SwitchB、SwitchC和SwitchD上分别执行display stp vlan information brief命令,查看端口状态,结果如下:
[~SwitchB] display stp vlan information brief -------------------------------------------------------------------------------- VLANID Interface Role STPState Protection Cost Edged -------------------------------------------------------------------------------- 10 10GE1/0/1 ROOT forwarding none 2000 disable 10 10GE1/0/2 DESI forwarding none 2000 disable 20 10GE1/0/1 ROOT forwarding none 2000 disable 20 10GE1/0/2 DESI forwarding none 2000 disable 20 10GE1/0/3 DESI forwarding none 2000 disable 30 10GE1/0/1 DESI forwarding none 2000 disable 30 10GE1/0/3 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
[~SwitchC] display stp vlan information brief ------------------------------------------------------------------------------ VLANID Interface Role STPState Protection Cost Edged ------------------------------------------------------------------------------ 10 10GE1/0/2 ALTE discarding none 2000000 disable 10 10GE1/0/3 ROOT forwarding none 2000 disable 10 10GE1/0/4 DESI forwarding none 2000 disable 20 10GE1/0/2 ALTE discarding none 2000000 disable 20 10GE1/0/3 ROOT forwarding none 2000 disable 20 10GE1/0/5 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
[~SwitchD] display stp vlan information brief ------------------------------------------------------------------------------ VLANID Interface Role STPState Protection Cost Edged ------------------------------------------------------------------------------ 20 10GE1/0/2 ALTE discarding none 2000000 disable 20 10GE1/0/3 ROOT forwarding none 2000 disable 20 10GE1/0/4 DESI forwarding none 2000 disable 30 10GE1/0/2 ALTE discarding none 2000000 disable 30 10GE1/0/3 ROOT forwarding none 2000 disable 30 10GE1/0/5 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
由上述显示信息可以看出,SwitchB参与VLAN10、VLAN20和VLAN30的生成树计算,SwitchC参与VLAN10、VLAN20的生成树计算,SwitchD参与VLAN20、VLAN30的生成树计算,计算完成后,各端口分别选举为不同的角色,实现破除环路。
可见,VLAN10、VLAN20和VLAN30分别形成不同的生成树,VLAN10、VLAN20、VLAN30内的业务流量将沿各自的生成树转发,实现负载分担。
配置文件
SwitchA的配置文件(此处以设备Cisco Nexus9000 C9508 7.0(3)I13为例)
vlan 10,20,30 spanning-tree pathcost method long spanning-tree vlan 10,20 priority 24576 spanning-tree vlan 30 priority 28672 interface Ethernet1/1 switchport mode trunk switchport trunk allowed vlan 10,20,30 no shutdown interface Ethernet1/2 switchport mode trunk switchport trunk allowed vlan 20,30 no shutdown interface Ethernet1/3 switchport mode trunk switchport trunk allowed vlan 10,20 no shutdown
SwitchB的配置文件
# sysname SwitchB # stp vlan 30 priority 24576 stp vlan 10 20 priority 28672 # vlan batch 10 20 30 # stp mode vbst # interface 10GE1/0/1 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 30 stp no-agreement-check # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 stp no-agreement-check # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 stp no-agreement-check # return
SwitchC的配置文件
# sysname SwitchC # vlan batch 10 20 # stp mode vbst # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 stp vlan 10 20 cost 2000000 stp no-agreement-check # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 stp no-agreement-check # interface 10GE1/0/4 port default vlan 10 # interface 10GE1/0/5 port default vlan 20 # return
SwitchD的配置文件
# sysname SwitchD # vlan batch 20 30 # stp mode vbst # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 stp vlan 20 30 cost 2000000 stp no-agreement-check # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 stp no-agreement-check # interface 10GE1/0/4 port default vlan 20 # interface 10GE1/0/5 port default vlan 30 # return