【案例分享】配置华为交换机生成树VBST
  bNnMIiHx7Zpw 2023年11月02日 41 0

【微|信|公|众|号:厦门微思网络】

华为HCIA试听课程:超级实用,华为VRP系统文件详解

华为HCIA试听课程:不会传输层协议,HCIA都考不过


组网需求

某企业网如图11-5所示,接入交换机SwitchC和SwitchD分别双归接入到汇聚交换机SwitchA和SwitchB。SwitchC接入VLAN 10、20的业务流量,SwitchD接入VLAN 20、30的业务流量。由于双归接入,在接入层和汇聚层之间形成环形网络。企业希望各VLAN内的业务流量正常转发,同时希望不同VLAN内的业务流量能够在链路上负载分担,以提高链路利用率。

【案例分享】配置华为交换机生成树VBST_工作模式

图11-5 配置VBST功能组网图

配置思路

可通过部署VBST避免接入层与汇聚层间的环路,使各VLAN内的业务流量正常转发,同时,使不同VLAN内的业务流量能够在链路上负载分担。配置思路如下:

配置接入交换机和汇聚交换机的二层转发功能。

在处于环形网络中的交换机(SwitchA~SwitchD)上配置VBST基本功能。为使VBST计算产生如图11-5中所示的VLAN生成树。配置时:

将VLAN 10的根桥设置为SwitchA,备份根桥设置为SwitchB;将VLAN20的根桥设置为SwitchA,备份根桥设置为SwitchB;将VLAN30的根桥设置为SwitchB,备份根桥设置为SwitchA,确保根桥设备的可靠性。

将SwitchC的端口10GE1/0/2在VLAN10、VLAN20中设置较大的路径开销值,使其分别在VLAN 10、20的生成树中阻塞;将SwitchD的端口10GE1/0/2在VLAN20、VLAN30中设置较大的路径开销值,使其分别在VLAN20、VLAN30的生成树中阻塞。

操作步骤

配置处于环网中的设备的二层转发功能。 在交换设备SwitchA、SwitchB、SwitchC和SwitchD上创建VLAN10、VLAN20和VLAN30。

在SwitchA上创建VLAN10、VLAN20和VLAN30。

system-view

[~HUAWEI] sysname SwitchA

[*HUAWEI] commit

[~SwitchA] vlan batch 10 20 30

[*SwitchA] commit

在SwitchB上创建VLAN10、VLAN20和VLAN30。

system-view

[~HUAWEI] sysname SwitchB

[*HUAWEI] commit

[~SwitchB] vlan batch 10 20 30

[*SwitchB] commit

在SwitchC上创建VLAN10和VLAN20。

system-view

[~HUAWEI] sysname SwitchC

[*HUAWEI] commit

[~SwitchC] vlan batch 10 20

[*SwitchC] commit

在SwitchD上创建VLAN20和VLAN30。

system-view

[~HUAWEI] sysname SwitchD

[*HUAWEI] commit

[~SwitchD] vlan batch 20 30

[*SwitchD] commit

将交换机上接入环路中的端口加入VLAN。

将SwitchA端口10GE1/0/1加入VLAN10、VLAN20和VLAN30。

[~SwitchA] interface 10ge 1/0/1

[~SwitchA-10GE1/0/1] port link-type trunk

[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10 20 30

[~SwitchA-10GE1/0/1] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/1] quit

[*SwitchA] commit

将SwitchA端口10GE1/0/2加入VLAN20和VLAN30。

[~SwitchA] interface 10ge 1/0/2

[~SwitchA-10GE1/0/2] port link-type trunk

[*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20 30

[*SwitchA-10GE1/0/2] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/2] quit

[*SwitchA] commit

将SwitchA端口10GE1/0/3加入VLAN10和VLAN20。

[~SwitchA] interface 10ge 1/0/3

[~SwitchA-10GE1/0/3] port link-type trunk

[*SwitchA-10GE1/0/3] port trunk allow-pass vlan 10 20

[*SwitchA-10GE1/0/3] undo port trunk allow-pass vlan 1

[*SwitchA-10GE1/0/3] quit

[*SwitchA] commit

将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基本功能。

配置环网中的交换机的生成树协议工作在VBST模式。

配置SwitchA的工作模式为VBST。

[~SwitchA] stp mode vbst

[*SwitchA] commit

配置交换机SwitchB的工作模式为VBST。

[~SwitchB] stp mode vbst

[*SwitchB] commit

配置交换机SwitchC的工作模式为VBST。

[~SwitchC] stp mode vbst

[*SwitchC] commit

配置交换机SwitchD的工作模式为VBST。

[~SwitchD] stp mode vbst

[*SwitchD] commit

配置根桥和备份根桥设备。

配置VLAN10的根桥和备份根桥。

配置SwitchA为VLAN10的根桥。

[~SwitchA] stp vlan 10 root primary

[*SwitchA] commit

配置SwitchB为VLAN10的备份根桥。

[~SwitchB] stp vlan 10 root secondary

[*SwitchB] commit

配置VLAN20的根桥和备份根桥。

配置SwitchA为VLAN20的根桥。

[~SwitchA] stp vlan 20 root primary

[*SwitchA] commit

配置SwitchB为VLAN20的备份根桥。

[~SwitchB] stp vlan 20 root secondary

[*SwitchB] commit

配置VLAN30的根桥和备份根桥。

配置SwitchB为VLAN30的根桥。

[~SwitchB] stp vlan 30 root primary

[*SwitchB] commit

配置SwitchA为VLAN30的备份根桥。

[~SwitchA] stp vlan 30 root secondary

[*SwitchA] commit

配置各VLAN中端口的路径开销值,实现将该端口阻塞

将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

使能VBST,实现破除环路。

全局使能VBST功能。

缺省情况下,全局VBST功能已使能。

为确保全局VBST使能,可执行命令display stp vlan information查看VBST的使能状态。如果未使能,请在系统视图执行命令undo stp vlan disable全局使能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功能。

验证配置结果。 经过以上配置,在网络计算稳定后,执行以下操作,验证配置结果。

在SwitchA上执行display stp vlan bridge local命令,查看STP工作模式,结果如下:

[~SwitchA] display stp vlan bridge local

VLANID BridgeID HelloTime MaxAge ForwardDelay Protocol

10 32869.ac94-8400-df01 2 20 15 VBST 20 32970.ac94-8400-df01 2 20 15 VBST 30 33071.ac94-8400-df01 2 20 15 VBST

由上述显示信息可以看出,STP工作在VBST模式。

在SwitchA上执行display stp vlan information brief命令,查看端口状态,结果如下:

[~SwitchA] display stp vlan information brief

VLANID Interface Role STPState Protection Cost Edged

10 10GE1/0/1 DESI forwarding none 20000 disable
10 10GE1/0/3 DESI forwarding none 2000 disable
20 10GE1/0/1 DESI forwarding none 20000 disable
20 10GE1/0/2 DESI forwarding none 2000 disable
20 10GE1/0/3 DESI forwarding none 2000 disable
30 10GE1/0/1 ALTE discarding none 20000 disable
30 10GE1/0/2 ROOT forwarding none 2000 disable

由上述显示信息可以看出,SwitchA分别参加VLAN10、VLAN20和VLAN30的生成树计算。例如,SwitchA在VLAN10和VLAN20中都是根桥,所以在VLAN10中10GE1/0/1和10GE1/0/3都被选举为指定端口;在VLAN20中10GE1/0/1、10GE1/0/2和10GE1/0/3都被选举为指定端口。SwitchA在VLAN30中是备份根桥,所以VLAN30中10GE1/0/1被选举为指定端口,10GE1/0/2被选举为根端口。

在SwitchA上执行display stp vlan 10 information命令,查看VLAN10的详细信息,结果如下:

[~SwitchA] display stp vlan 10 information VLAN 10 information:

Global information: Protocol Status : Enabled Bpdu-filter Default : Disabled Bpdu-protection : Disabled Tc-protection : Disabled Tc-protection Threshold : 1 Tc-protection Interval(s) : 10 Edged Port Default : Disabled Path Cost Standard : Dot1T Timer Factor : 3 Transit Limit : 6

Bridge ID : 10.ac94-8400-df01
Config Times : Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times : Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Root ID/RPC : 10.ac94-8400-df01 / 0
RootPortId(InterfaceName) : 0.0 (This bridge is the root)
Root Type : Primary

Port information: Port ID : 5 Interface : 10GE1/0/1 STP State : Forwarding Port Role : Designated Port Port Priority : 128 Path Cost Standard : Dot1T Port Cost(Config/Active) : 0 / 20000 Desg. Bridge/Port : 10.ac94-8400-df01 / 128.5 Port Edged(Config/Active) : Default / Disabled Point-to-point(Config/Active) : Auto / True Transit Limit : 6 packets/hello Protection Type : None Port ID : 8 Interface : 10GE1/0/3 STP State : Forwarding Port Role : Designated Port Port Priority : 128 Path Cost Standard : Dot1T Port Cost(Config/Active) : 0 / 2000 Desg. Bridge/Port : 10.ac94-8400-df01 / 128.8 Port Edged(Config/Active) : Default / Disabled Point-to-point(Config/Active) : Auto / True Transit Limit : 6 packets/hello Protection Type : None

由上述显示信息可以看出,在VLAN10中,SwitchA被选举为根桥,两个端口10GE1/0/1和10GE1/0/3都被选举为指定端口,且处于FORWARDING状态。

同理,在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 ALTE discarding none 20000 disable
10 10GE1/0/2 ROOT forwarding none 2000 disable
20 10GE1/0/1 ALTE discarding none 20000 disable
20 10GE1/0/2 ROOT forwarding none 2000 disable
20 10GE1/0/3 DESI forwarding none 2000 disable
30 10GE1/0/1 DESI forwarding none 20000 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 ROOT forwarding none 2000 disable
10 10GE1/0/3 DESI forwarding none 2000000 disable
10 10GE1/0/4 DESI forwarding none 2000 disable
20 10GE1/0/2 ROOT forwarding none 2000 disable
20 10GE1/0/3 DESI forwarding none 2000000 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 DESI forwarding 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的生成树计算,计算完成后,各端口分别选举为不同的角色,实现破除环路。

可见,VLAN 10、VLAN 20和VLAN 30分别形成不同的生成树,VLAN 10、VLAN 20、VLAN 30内的业务流量将沿各自的生成树转发,实现负载分担。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  4i8hCvzXKbg6   2023年11月20日   24   0   0 链路
  4i8hCvzXKbg6   2023年12月06日   26   0   0 链路ip地址子网掩码
  4i8hCvzXKbg6   2023年12月06日   69   0   0 链路优先级Database
  4i8hCvzXKbg6   2023年12月06日   26   0   0 链路DatabaseNetwork
  4i8hCvzXKbg6   2023年12月07日   29   0   0 链路校验和Database