【华为】MSTP多生成配置案例
发布作者:微思网络 发布时间:2024-10-31 浏览量:0次
微思推荐课程:
华为HCIA课程介绍
华为HCIP课程介绍
华为HCIE课程介绍
在一个复杂的网络中,由于冗余备份的需要,网络规划者一般都倾向于在设备之间部署多条物理链路,其中一条作为主用链路,其他作为备份链路。这样就难免会形成环路,若网络中存在环路,可能会引起广播风暴和MAC表项被破坏。为此,可以在网络中部署MSTP协议预防环路。MSTP可阻塞二层网络中的冗余链路,将网络修剪成树状,达到消除环路的目的。 如图9-20所示,SwitchA、SwitchB、SwitchC和SwitchD都运行MSTP。为实现VLAN2~VLAN10和VLAN11~VLAN20的流量负载分担,MSTP引入了多实例。MSTP可设置VLAN映射表,把VLAN和生成树实例相关联。 图9-20 配置MSTP功能组网图 采用以下思路配置MSTP功能: 在处于环形网络中的交换设备上配置MSTP基本功能。 配置保护功能,实现对设备或链路的保护。例如:在各实例的根桥设备指定端口配置根保护功能。 配置设备的二层转发功能。 配置MSTP基本功能 配置SwitchA、SwitchB、SwitchC和SwitchD到域名为RG1的域内,创建实例MSTI1和实例MSTI2 当两台交换设备的以下配置都相同时,这两台交换设备属于同一个MST域。 MST域的域名。 多生成树实例和VLAN的映射关系。 不能将同一个VLAN映射到多个不同的实例上。如果将一个已经和实例建立映射关系的VLAN又映射到另一个实例上,原来的映射关系将被取消。 MST域的修订级别。 # 配置SwitchA的MST域。 <HUAWEI> system-view # 配置SwitchB的MST域。 <HUAWEI> system-view # 配置SwitchC的MST域。 <HUAWEI> system-view # 配置SwitchD的MST域。 <HUAWEI> system-view 在域RG1内,配置MSTI1与MSTI2的根桥与备份根桥 配置MSTI1的根桥与备份根桥 # 配置SwitchA为MSTI1的根桥。 [~SwitchA] stp instance 1 root primary # 配置SwitchB为MSTI1的备份根桥。 [~SwitchB] stp instance 1 root secondary 配置MSTI2的根桥与备份根桥 # 配置SwitchB为MSTI2的根桥。 [~SwitchB] stp instance 2 root primary # 配置SwitchA为MSTI2的备份根桥。 [~SwitchA] stp instance 2 root secondary 配置实例MSTI1和MSTI2中将要被阻塞端口的路径开销值大于缺省值 # 配置SwitchA的端口路径开销值的计算方法为华为计算方法。 [~SwitchA] stp pathcost-standard legacy # 配置SwitchB的端口路径开销计算方法为华为计算方法。 [~SwitchB] stp pathcost-standard legacy # 配置SwitchC的端口路径开销计算方法为华为计算方法,将端口10GE1/0/2在实例MSTI2中的路径开销值配置为20000。 [~SwitchC] stp pathcost-standard legacy # 配置SwitchD的端口路径开销计算方法为华为计算方法,将端口10GE1/0/2在实例MSTI1中的路径开销值配置为20000。 [~SwitchD] stp pathcost-standard legacy 使能MSTP,实现破除环路 设备全局使能MSTP # 在SwitchA上启动MSTP。 [~SwitchA] stp enable # 在SwitchB上启动MSTP。 [~SwitchB] stp enable # 在SwitchC上启动MSTP。 [~SwitchC] stp enable # 在SwitchD上启动MSTP。 [~SwitchD] stp enable 将与终端相连的端口去使能MSTP # 配置SwitchC端口10GE1/0/1的STP去使能。 [~SwitchC] interface 10ge 1/0/1 # 配置SwitchD端口10GE1/0/1的STP去使能。 [~SwitchD] interface 10ge 1/0/1 配置保护功能,如在各实例的根桥设备的指定端口配置根保护功能 # 在SwitchA端口10GE1/0/1上启动根保护。 [~SwitchA] interface 10ge 1/0/1 # 在SwitchB端口10GE1/0/1上启动根保护。 [~SwitchB] interface 10ge 1/0/1 配置处于环网中的设备的二层转发功能 在交换设备SwitchA、SwitchB、SwitchC和SwitchD上创建VLAN2~20 # 在SwitchA上创建VLAN2~20。 [~SwitchA] vlan batch 2 to 20 # 在SwitchB上创建VLAN2~20。 [~SwitchB] vlan batch 2 to 20 # 在SwitchC上创建VLAN2~20。 [~SwitchC] vlan batch 2 to 20 # 在SwitchD上创建VLAN2~20。 [~SwitchD] vlan batch 2 to 20 将交换设备上接入环路中的端口加入VLAN # 将SwitchA端口10GE1/0/1加入VLAN。 [~SwitchA] interface 10ge 1/0/1 # 将SwitchA端口10GE1/0/2加入VLAN。 [~SwitchA] interface 10ge 1/0/2 # 将SwitchB端口10GE1/0/1加入VLAN。 [~SwitchB] interface 10ge 1/0/1 # 将SwitchB端口10GE1/0/2加入VLAN。 [~SwitchB] interface 10ge 1/0/2 # 将SwitchC端口10GE1/0/1加入VLAN。 [~SwitchC] interface 10ge 1/0/1 # 将SwitchC端口10GE1/0/2加入VLAN。 [~SwitchC] interface 10ge 1/0/2 # 将SwitchC端口10GE1/0/3加入VLAN。 [~SwitchC] interface 10ge 1/0/3 # 将SwitchD端口10GE1/0/1加入VLAN。 [~SwitchD] interface 10ge 1/0/1 # 将SwitchD端口10GE1/0/2加入VLAN。 [~SwitchD] interface 10ge 1/0/2 # 将SwitchD端口10GE1/0/3加入VLAN。 [~SwitchD] interface 10ge 1/0/3 验证配置结果 在网络计算稳定后,执行以下操作,验证配置结果。 # 在SwitchA上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下: [~SwitchA] display stp brief 在MSTI1中,由于SwitchA是根桥,SwitchA的端口10GE1/0/2和10GE1/0/1成为指定端口。在MSTI2中,SwitchA的端口10GE1/0/1成为指定端口,端口10GE1/0/2成为根端口。 # 在SwitchB上执行display stp brief命令,结果如下: [~SwitchB] display stp brief 在MSTI2中,由于SwitchB是根桥,端口10GE1/0/1和10GE1/0/2在MSTI2中成为指定端口。在MSTI1中,SwitchB的端口10GE1/0/1成为指定端口,端口10GE1/0/2成为根端口。 # 在SwitchC上执行display stp interface brief命令,结果如下: [~SwitchC] display stp interface 10ge 1/0/3 brief [~SwitchC] display stp interface 10ge 1/0/2 brief SwitchC的端口10GE1/0/3在MSTI1和MSTI2中为根端口。SwitchC的另一个端口10GE1/0/2,在MSTI2中被阻塞,在MSTI1中被计算为指定端口。 # 在SwitchD上执行display stp interface brief命令,结果如下: [~SwitchD] display stp interface 10ge 1/0/3 brief [~SwitchD] display stp interface 10ge 1/0/2 brief SwitchD的端口10GE1/0/3在MSTI1和MSTI2中为根端口。SwitchD的另一个端口10GE1/0/2,在MSTI1中被阻塞,在MSTI2中被计算为指定端口。操作步骤
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] stp region-configuration
[~SwitchA-mst-region] region-name RG1
[*SwitchA-mst-region] instance 1 vlan 2 to 10
[*SwitchA-mst-region] instance 2 vlan 11 to 20
[*SwitchA-mst-region] commit
[~SwitchA-mst-region] quit
[~HUAWEI] sysname SwitchB
[*HUAWEI] commit
[~SwitchB] stp region-configuration
[~SwitchB-mst-region] region-name RG1
[*SwitchB-mst-region] instance 1 vlan 2 to 10
[*SwitchB-mst-region] instance 2 vlan 11 to 20
[*SwitchB-mst-region] commit
[~SwitchB-mst-region] quit
[~HUAWEI] sysname SwitchC
[*HUAWEI] commit
[~SwitchC] stp region-configuration
[~SwitchC-mst-region] region-name RG1
[*SwitchC-mst-region] instance 1 vlan 2 to 10
[*SwitchC-mst-region] instance 2 vlan 11 to 20
[*SwitchC-mst-region] commit
[~SwitchC-mst-region] quit
[~HUAWEI] sysname SwitchD
[*HUAWEI] commit
[~SwitchD] stp region-configuration
[~SwitchD-mst-region] region-name RG1
[*SwitchD-mst-region] instance 1 vlan 2 to 10
[*SwitchD-mst-region] instance 2 vlan 11 to 20
[*SwitchD-mst-region] commit
[~SwitchD-mst-region] quit
[*SwitchA] commit
[*SwitchB] commit
[*SwitchB] commit
[*SwitchA] commit
[*SwitchA] commit
[*SwitchB] commit
[*SwitchC] interface 10ge 1/0/2
[*SwitchC-10GE1/0/2] stp instance 2 cost 20000
[*SwitchC-10GE1/0/2] commit
[~SwitchC-10GE1/0/2] quit
[*SwitchD] interface 10ge 1/0/2
[*SwitchD-10GE1/0/2] stp instance 1 cost 20000
[*SwitchD-10GE1/0/2] commit
[~SwitchD-10GE1/0/2] quit
[*SwitchA] commit
[*SwitchB] commit
[*SwitchC] commit
[*SwitchD] commit
[~SwitchC-10GE1/0/1] stp disable
[*SwitchC-10GE1/0/1] commit
[~SwitchC-10GE1/0/1] quit
[~SwitchD-10GE1/0/1] stp disable
[*SwitchD-10GE1/0/1] commit
[~SwitchD-10GE1/0/1] quit
[~SwitchA-10GE1/0/1] stp root-protection
[*SwitchA-10GE1/0/1] commit
[~SwitchA-10GE1/0/1] quit
[~SwitchB-10GE1/0/1] stp root-protection
[*SwitchB-10GE1/0/1] commit
[~SwitchB-10GE1/0/1] quit
[*SwitchA] commit
[*SwitchB] commit
[*SwitchC] commit
[*SwitchD] commit
[~SwitchA-10GE1/0/1] port link-type trunk
[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 2 to 20
[*SwitchA-10GE1/0/1] commit
[~SwitchA-10GE1/0/1] quit
[~SwitchA-10GE1/0/2] port link-type trunk
[*SwitchA-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[*SwitchA-10GE1/0/2] commit
[~SwitchA-10GE1/0/2] quit
[~SwitchB-10GE1/0/1] port link-type trunk
[*SwitchB-10GE1/0/1] port trunk allow-pass vlan 2 to 20
[*SwitchB-10GE1/0/1] commit
[~SwitchB-10GE1/0/1] quit
[~SwitchB-10GE1/0/2] port link-type trunk
[*SwitchB-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[*SwitchB-10GE1/0/2] commit
[~SwitchB-10GE1/0/2] quit
[~SwitchC-10GE1/0/1] port link-type access
[*SwitchC-10GE1/0/1] port default vlan 2
[*SwitchC-10GE1/0/1] commit
[~SwitchC-10GE1/0/1] quit
[~SwitchC-10GE1/0/2] port link-type trunk
[*SwitchC-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[*SwitchC-10GE1/0/2] commit
[~SwitchC-10GE1/0/2] quit
[~SwitchC-10GE1/0/3] port link-type trunk
[*SwitchC-10GE1/0/3] port trunk allow-pass vlan 2 to 20
[*SwitchC-10GE1/0/3] commit
[~SwitchC-10GE1/0/3] quit
[~SwitchD-10GE1/0/1] port link-type access
[*SwitchD-10GE1/0/1] port default vlan 11
[*SwitchD-10GE1/0/1] commit
[~SwitchD-10GE1/0/1] quit
[~SwitchD-10GE1/0/2] port link-type trunk
[*SwitchD-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[*SwitchD-10GE1/0/2] commit
[~SwitchD-10GE1/0/2] quit
[~SwitchD-10GE1/0/3] port link-type trunk
[*SwitchD-10GE1/0/3] port trunk allow-pass vlan 2 to 20
[*SwitchD-10GE1/0/3] commit
[~SwitchD-10GE1/0/3] quit
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding root 2 disable
0 10GE1/0/2 DESI forwarding none 2 disable
1 10GE1/0/1 DESI forwarding root 2 disable
1 10GE1/0/2 DESI forwarding none 2 disable
2 10GE1/0/1 DESI forwarding root 2 disable
2 10GE1/0/2 ROOT forwarding none 2 disable
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding root 2 disable
0 10GE1/0/2 ROOT forwarding none 2 disable
1 10GE1/0/1 DESI forwarding root 2 disable
1 10GE1/0/2 ROOT forwarding none 2 disable
2 10GE1/0/1 DESI forwarding root 2 disable
2 10GE1/0/2 DESI forwarding none 2 disable
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/3 ROOT forwarding none 2 disable
1 10GE1/0/3 ROOT forwarding none 2 disable
2 10GE1/0/3 ROOT forwarding none 2 disable
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/2 DESI forwarding none 2 disable
1 10GE1/0/2 DESI forwarding none 2 disable
2 10GE1/0/2 ALTE discarding none 20000 disable
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/3 ALTE discarding none 2 disable
1 10GE1/0/3 ROOT forwarding none 2 disable
2 10GE1/0/3 ROOT forwarding none 2 disable
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/2 ROOT forwarding none 2 disable
1 10GE1/0/2 ALTE discarding none 20000 disable
2 10GE1/0/2 DESI forwarding none 2 disable
点击查看相关文章:
华为设备二层交换技术——MSTP协议详解
【技术分享】MSTP配置
【案例分享】多生成树MSTP配置