配置MSTP功能示例
组网需求
在一个复杂的网络中,网络规划者由于冗余备份的需要,一般都倾向于在设备之间部署多条物理链路,其中一条作主用链路,其他链路作备份。这样就难免会形成环形网络,若网络中存在环路,可能会引起广播风暴和MAC桥表项被破坏。网络规划者规划好网络后,可以在网络中部署MSTP协议预防环路。MSTP可阻塞二层网络中的冗余链路,将网络修剪成树状,达到消除环路的目的。
如图1所示,为实现VLAN2~VLAN10和VLAN11~VLAN20的流量负载分担,MSTP引入了多实例。MSTP可设置VLAN映射表,把VLAN和生成树实例联系起来。图1中RouterA、SwitchA、SwitchB、SwitchC和SwitchD都运行MSTP。
图1 配置MSTP功能组网图

配置思路
采用以下思路配置MSTP功能:
1. 在处于环形网络中的交换设备上配置MSTP基本功能,包括:
a. 配置环网中的设备生成树协议工作在MSTP模式。
b. 配置MST域并创建多实例,实现流量的负载分担。
c. 在MST域内,配置各实例的根桥与备份根桥。
d. 配置各实例中某端口的路径开销值,实现将该端口阻塞。
e. 使能MSTP,实现破除环路,包括:
设备全局使能MSTP。
与终端设备相连的端口,去使能MSTP,或者配置为边缘端口。
除与终端设备相连的端口外,其他端口使能MSTP。
说明:
与PC机相连的端口不用参与MSTP计算,建议将其去使能MSTP,或者配置为边缘端口。
2. 配置保护功能,实现对设备或链路的保护。例如:在各实例的根桥设备指定端口配置根保护功能。
3. 配置设备的二层转发功能。
操作步骤
1. 配置MSTP基本功能
a. 配置环网中的设备生成树协议工作在MSTP模式
# 配置RouterA的MSTP工作模式,MSTP为设备缺省工作模式。
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] stp mode mstp
# 配置交换设备SwitchA,SwitchB,SwitchC和SwitchD的MSTP工作模式。
b. 配置环网中的设备到域名为RG1的域内,创建实例MSTI1映射VLAN2~VLAN10,创建实例MSTI2映射VLAN11~VLAN20
# 配置RouterA的MST域。
[RouterA] stp region-configuration
[RouterA-mst-region] region-name RG1
[RouterA-mst-region] instance 1 vlan 2 to 10
[RouterA-mst-region] instance 2 vlan 11 to 20
[RouterA-mst-region] active region-configuration
[RouterA] quit
# 配置交换设备SwitchA、SwitchB、SwitchC和SwitchD的MST域。域名为RG1,创建实例MSTI1映射VLAN2~VLAN10,创建实例MSTI2映射VLAN11~VLAN20。
c. 在域RG1内,配置MSTI1与MSTI2的根桥与备份根桥
# 配置MSTI1的根桥为RouterA。
[RouterA] stp instance 1 root primary
# 配置MSTI1的备份根桥为SwitchA。
# 配置MSTI2的根桥为RouterA。
[RouterA] stp instance 2 root primary
# 配置MSTI2的备份根桥为SwitchB。
d. 配置实例MSTI1和MSTI2中需被阻塞的端口的路径开销值大于缺省值,实现将该端口阻塞
说明:
· 端口路径开销值取值范围由路径开销计算方法决定,这里选择使用华为私有计算方法为例,配置将被阻塞的端口的路径开销值为200000。
· 如实际场景中的交换机设备为非华为设备,请遵循“同一网络内所有交换设备的端口路径开销应使用相同计算方法”的原则进行配置。配置其他计算方法,请查阅STP路径开销列表。
# 配置RouterA的端口路径开销缺省值的计算方法为华为私有计算方法。
[RouterA] stp pathcost-standard legacy
# 配置SwitchA、SwitchB、SwitchC和SwitchD的端口路径开销缺省值的计算方法为华为的私有计算方法。
# 如图1,配置SwitchC的端口Eth0/0/4在实例1中的路径开销值为200000。
# 如图1,配置SwitchD的端口Eth0/0/4在实例2中的路径开销值为200000。
e. 使能MSTP,实现破除环路
将与PC终端相连的端口去使能MSTP
# 如图1,配置交换机设备SwitchC的端口,Eth0/0/2和Eth0/0/3,去使能MSTP或者配置为边缘端口。
# 如图1,配置交换机设备SwitchD的端口,Eth0/0/2和Eth0/0/3,去使能MSTP或者配置为边缘端口。

1.设备全局使能MSTP
# 设备RouterA全局使能MSTP。
[RouterA] stp enable
# 为交换机设备SwitchA,SwitchB,SwitchC和SwitchD全局使能MSTP。
除与PC终端相连的端口外,端口使能MSTP
# 设备RouterA端口Eth2/0/0和Eth2/0/1使能MSTP。
[RouterA] interface ethernet 2/0/0
[RouterA-Ethernet2/0/0] stp enable
[RouterA-Ethernet2/0/0] quit
[RouterA] interface ethernet 2/0/1
[RouterA-Ethernet2/0/1] stp enable
[RouterA-Ethernet2/0/1] quit
# 如图1,交换机设备SwitchA,SwitchB,SwitchC和SwitchD除与PC终端相连的端口外,其他端口使能MSTP。
2. 配置保护功能
# 在根桥RouterA的端口Eth2/0/0和Eth2/0/1上启动根保护。
[RouterA] interface ethernet 2/0/0
[RouterA-Ethernet2/0/0] stp root-protection
[RouterA-Ethernet2/0/0] quit
[RouterA] interface ethernet 2/0/1
[RouterA-Ethernet2/0/1] stp root-protection
[RouterA-Ethernet2/0/1] quit
3. 配置处于环网中的设备的二层转发功能
在交换设备RouterA、SwitchA、SwitchB、SwitchC和SwitchD上创建VLAN
# 在RouterA上创建VLAN2~VLAN20。
[RouterA] vlan batch 2 to 20
# 在交换机SwitchA和SwitchB上创建VLAN2~VLAN20。
# 在交换机SwitchC上创建VLAN2~VLAN10。
# 在交换机SwitchD上创建VLAN11~VLAN20。
将交换设备上接入环路中的端口加入VLAN
# 将RouterA的端口Eth2/0/0和Eth2/0/1加入VLAN2~VLAN20。
[RouterA] interface ethernet 2/0/0
[RouterA-Ethernet2/0/0] port link-type trunk
[RouterA-Ethernet2/0/0] port trunk allow-pass vlan 2 to 20
[RouterA-Ethernet2/0/0] quit
[RouterA] interface ethernet 2/0/1
[RouterA-Ethernet2/0/1] port link-type trunk
[RouterA-Ethernet2/0/1] port trunk allow-pass vlan 2 to 20
[RouterA-Ethernet2/0/1] quit
# 将SwitchA的端口Eth0/0/1、Eth0/0/2和Eth0/0/3加入VLAN2~VLAN20。
# 将SwitchB的端口Eth0/0/1、Eth0/0/2和Eth0/0/3加入VLAN2~VLAN20。
# 将SwitchC的端口Eth0/0/1、Eth0/0/2、Eth0/0/3、Eth0/0/4加入VLAN2~VLAN10。
# 将SwitchD的端口Eth0/0/1、Eth0/0/2、Eth0/0/3、Eth0/0/4加入VLAN11~VLAN20。
4. 验证配置结果
经过以上配置,在网络计算稳定后,执行以下操作,验证配置结果。
# 在RouterA上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下:
[RouterA] display stp brief
MSTID Port Role STP State Protection
0 Ethernet2/0/0 DESI FORWARDING NONE
0 Ethernet2/0/1 DESI FORWARDING NONE
1 Ethernet2/0/0 DESI FORWARDING ROOT
1 Ethernet2/0/1 DESI FORWARDING ROOT
2 Ethernet2/0/0 DESI FORWARDING ROOT
2 Ethernet2/0/1 DESI FORWARDING ROOT
在MSTI1中,由于RouterA是根桥,RouterA的端口Eth2/0/0和Eth2/0/1成为指定端口。在MSTI2中,RouterA同样是根桥,RouterA的端口Eth2/0/0和Eth2/0/1是指定端口。
# 在SwitchA查看端口状态和端口的保护类型。在MSTI1中,端口Eth0/0/1成为根端口,端口Eth0/0/2和端口Eth0/0/3成为指定端口。在MSTI2中,端口Eth0/0/1成为根端口,端口Eth0/0/2和端口Eth0/0/3成为指定端口。
# 在SwitchB查看端口状态和端口的保护类型。在MSTI1中,端口Eth0/0/1成为根端口,端口Eth0/0/2和端口Eth0/0/3成为指定端口。在MSTI2中,端口Eth0/0/1成为根端口,端口Eth0/0/2和端口Eth0/0/3成为指定端口。
# 在SwitchC查看端口状态和端口的保护类型。在MSTI1中,端口Eth0/0/1成为根端口,端口Eth0/0/4被阻塞。在MSTI2中,端口Eth0/0/1成为根端口,端口Eth0/0/4成为指定端口。
# 在SwitchD查看端口状态和端口的保护类型。在MSTI1中,端口Eth0/0/1成为根端口,端口Eth0/0/4成为指定端口。在MSTI2中,端口Eth0/0/1成为根端口,端口Eth0/0/4被阻塞。
配置文件
RouterA的配置文件
#
sysname RouterA
#
vlan batch 2 to 20
#
stp instance 1 root primary
stp instance 2 root primary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Ethernet2/0/0
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface Ethernet2/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
return
SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 2 to 20
#
stp instance 1 root secondary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
SwitchB的配置文件
#
sysname SwitchB
#
vlan batch 2 to 20
#
stp instance 2 root secondary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
SwitchC的配置文件
#
sysname SwitchC
#
vlan batch 2 to 10
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 10
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp disable
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp disable
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 10
stp instance 1 cost 200000
#
return
SwitchD的配置文件
#
sysname SwitchD
#
vlan batch 11 to 20
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 11 to 20
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp disable
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp disable
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 11 to 20
stp instance 2 cost 200000
#
return
配置MSTP功能示例的更多相关文章
- springcloud(七):配置中心svn示例和refresh
上一篇springcloud(六):配置中心git示例留了一个小问题,当重新修改配置文件提交后,客户端获取的仍然是修改前的信息,这个问题我们先放下,待会再讲.国内很多公司都使用的svn来做代码的版本控 ...
- 分布式大数据多维分析(OLAP)引擎Apache Kylin安装配置及使用示例【转】
Kylin 麒麟官网:http://kylin.apache.org/cn/download/ 关键字:olap.Kylin Apache Kylin是一个开源的分布式分析引擎,提供Hadoop之上的 ...
- 企业网络拓扑MSTP功能实例(二)
组网图形 MSTP简介 以太网交换网络中为了进行链路备份,提高网络可靠性,通常会使用冗余链路.但是使用冗余链路会在交换网络上产生环路,引发广播风暴以及MAC地址表不稳定等故障现象,从而导致用户通信质量 ...
- 【java】org.apache.commons.lang3功能示例
org.apache.commons.lang3功能示例 package com.simple.test; import java.util.Date; import java.util.Iterat ...
- Linux下Apache配置HTTPS功能
Apache配置HTTPS功能 转 https://www.cnblogs.com/liaojiafa/p/6028816.html 一.yum 安装openssl和openssl-devel,ht ...
- 利用JavaScriptSOAPClient直接调用webService --完整的前后台配置与调用示例
JavaScriptSoapClient下载地址:https://archive.codeplex.com/?p=javascriptsoapclient JavaScriptSoapClient的D ...
- linux之vim配置及使用示例
作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7056193.html linux之vim配置及使用示例 vi的三种模式: 一 ...
- 5G RRC——为NAS层提供连接管理,消息传递等服务; 对接入网的底层协议实体提供参数配置的功能; 负责UE移动性管理相关的测量、控制等功能
from:http://www.cnblogs.com/kkdd-2013/p/3868676.html 1 RRC协议功能 为NAS层提供连接管理,消息传递等服务: 对接入网的底层协议实体提供参数配 ...
- Django-中间件-csrf扩展请求伪造拦截中间件-Django Auth模块使用-效仿 django 中间件配置实现功能插拔式效果-09
目录 昨日补充:将自己写的 login_auth 装饰装在 CBV 上 django 中间件 django 请求生命周期 ***** 默认中间件及其大概方法组成 中间件的执行顺序 自定义中间件探究不同 ...
- drf框架安装配置及其功能概述
0902自我总结 drf框架安装配置及其功能概述 一.安装 pip3 install djangorestframework 二.配置 # 注册drf app NSTALLED_APPS = [ # ...
随机推荐
- 【设计模式】Java设计模式 - 动态代理
[设计模式]Java设计模式 - 动态代理 不断学习才是王道 继续踏上学习之路,学之分享笔记 总有一天我也能像各位大佬一样 一个有梦有戏的人 @怒放吧德德 最近工作比较忙,没啥时间学习 目录 [设计模 ...
- v-if和v-for的优先级是什么?
一.作用 v-if 指令用于条件性地渲染一块内容.这块内容只会在指令的表达式返回 true值的时候被渲染 v-for 指令基于一个数组来渲染一个列表.v-for 指令需要使用 item in item ...
- C#:winform窗体 实现类似QQ的窗体在桌面边缘停靠和隐藏
设计思路:1.使用定时器(Timer)来监控鼠标位置和窗体位置,并实现窗体的停靠和隐藏2.当鼠标拖动窗体时,窗体才有可能根据自身位置决定是否停靠3.如果窗体四周没有接触到屏幕边缘则不会停靠4.如果窗体 ...
- 《Java基础——继承》
Java基础--继承 一.类的继承: 规则: 1.一个子类只能有一个父类,但一个父类可以有多个子类,每个子类都可以作为父类使用. 2.若一个类没有声明父类,则默认其父类为Object. 3.父 ...
- Python数据科学手册-Pandas:层级索引
一维数据 和 二维数据 分别使用Series 和 DataFrame 对象存储. 多维数据:数据索引 超过一俩个 键. Pandas提供了Panel 和 Panel4D对象 解决三维数据和四维数据. ...
- Latex中也能展示动态图?
技术背景 在学术领域,很多文档是用Latex做的,甚至有很多人用Latex Beamer来做PPT演示文稿.虽然在易用性和美观等角度来说,Latex Beamer很大程度上不如PowerPoint,但 ...
- Logstash: 启动监控及集中管理-总结
Logstash: 启动监控 配置文件:logstash.yml xpack.monitoring.enabled: true xpack.monitoring.elasticsearch.usern ...
- Java对象或String转JSON对象
Java String转JSON对象 用阿里的fastjson里的一个方法,导入fastjson包JSONObject jsonObject1 =JSONObject.parseObject(Stri ...
- C++自学笔记 面向对象程序设计OOP(Object Oriented Programming)
什么是对象? Objects = Attributes + Services Data : The properties or status Operations: the fuctions C语言中 ...
- PAT (Basic Level) Practice 1008 数组元素循环右移问题 分数 20
一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A0A1⋯AN−1)变换为(AN−M⋯AN−1A0A1⋯AN ...