华为配置MSTP的基本功能

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

华为配置MSTP的基本功能
组网需求
交换机SwitchA、SwitchB、SwitchC和SwitchD都支持MSTP,本例中的交换机都使用二层接口运行MSTP。

配置思路
采用如下的思路配置MSTP的基本功能:
将SwitchA和SwitchC配置到一个域内,域名为RG1,创建实例1。

将SwitchB和SwitchD配置到另外一个域,域名为RG2,创建实例1。

配置交换机SwitchA为CIST总根。

在域RG1内,交换机SwitchA为CIST域根,SwitchA为实例1的域根。

在SwitchA的Eth0/0/2和Eth0/0/1上应用根保护功能。

在域RG2内,交换机SwitchB为CIST域根,SwitchD为实例1的域根。

SwitchC和SwitchD的Eth0/0/1与PC机相连,设置为边缘端口,同时在SwitchC和SwitchD 上应用BPDU保护功能。

在SwitchA、SwitchB、SwitchC和SwitchD使用华为私有计算方法计算路径开销。

数据准备
为完成此配置例,需准备如下的数据:
SwitchA和SwitchC的域名为RG1
SwitchB和SwitchD的域名为RG2
各Ethernet端口号如图1所示
VLAN号是1~20
操作步骤
配置交换机SwitchA
# 配置SwitchA的MST域。

<SwitchA> system-view
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 1 to 10# 激活域配置。

[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit# 配置SwitchA在实例0中的优先级为0,保证SwitchA作为CIST的总根。

[SwitchA] stp instance 0 priority 0# 配置SwitchA在实例1中的优先级为0,保证SwitchA 作为实例1的域根。

[SwitchA] stp instance 1 priority 0# 配置端口路径开销的计算方法为华为私有计算方法。

[SwitchA] stp pathcost-standard legacy# 创建VLAN 2到20。

[SwitchA] vlan batch 2 to 20# 将Eth0/0/2加入VLAN。

[SwitchA] interface ethernet 0/0/2
[SwitchA-Ethernet0/0/2] port link-type trunk
[SwitchA-Ethernet0/0/2] port trunk allow-pass vlan 1 to 20
[SwitchA-Ethernet0/0/2] bpdu enable
[SwitchA-Ethernet0/0/2] quit# 将Eth0/0/1加入VLAN。

[SwitchA] interface ethernet 0/0/1
[SwitchA-Ethernet0/0/1] port link-type trunk
[SwitchA-Ethernet0/0/1] port trunk allow-pass vlan 1 to 20
[SwitchA-Ethernet0/0/1] bpdu enable
[SwitchA-Ethernet0/0/1] quit# 在Eth0/0/1上启动根保护。

[SwitchA] interface ethernet 0/0/1
[SwitchA-Ethernet0/0/1] stp root-protection
[SwitchA-Ethernet0/0/1] quit# 在Eth0/0/2上启动根保护。

[SwitchA] interface ethernet 0/0/2
[SwitchA-Ethernet0/0/2] stp root-protection
[SwitchA-Ethernet0/0/2] quit# 启动MSTP。

[SwitchA] stp enable
配置交换机SwitchB
# 配置SwitchB的MST域。

[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG2
[SwitchB-mst-region] instance 1 vlan 1 to 10# 激活域配置。

[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit# 配置SwitchB在实例0中的优先级为4096,保证SwitchB作为CIST的域根。

[SwitchB] stp instance 0 priority 4096# 配置端口路径的开销计算方法为华为私有计算方法。

[SwitchB] stp pathcost-standard legacy# 创建VLAN 2到20。

[SwitchB] vlan batch 2 to 20# 将Eth0/0/1加入VLAN。

[SwitchB] interface ethernet 0/0/1
[SwitchB-Ethernet0/0/1] port link-type trunk
[SwitchB-Ethernet0/0/1] port trunk allow-pass vlan 1 to 20
[SwitchB-Ethernet0/0/1] bpdu enable
[SwitchB-Ethernet0/0/1] quit# 将Eth0/0/2加入VLAN。

[SwitchB] interface ethernet 0/0/2
[SwitchB-Ethernet0/0/2] port link-type trunk
[SwitchB-Ethernet0/0/2] port trunk allow-pass vlan 1 to 20
[SwitchB-Ethernet0/0/2] bpdu enable
[SwitchB-Ethernet0/0/2] quit# 启动MSTP。

[SwitchB] stp enable
配置SwitchC
# 配置SwitchC的MST域。

[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 1 to 10# 激活域配置。

[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit# 配置端口路径开销的计算方法为华为私有计算方法。

[SwitchC] stp pathcost-standard legacy# 启动BPDU保护功能
[SwitchC] stp bpdu-protection# 创建VLAN 2到20。

[SwitchC] vlan batch 2 to 20# 将Eth0/0/2加入VLAN。

[SwitchC] interface ethernet 0/0/2
[SwitchC-Ethernet0/0/2] port link-type trunk
[SwitchC-Ethernet0/0/2] port trunk allow-pass vlan 1 to 20
[SwitchC-Ethernet0/0/2] bpdu enable
[SwitchC-Ethernet0/0/2] quit# 将Eth0/0/3加入VLAN。

[SwitchC] interface ethernet 0/0/3
[SwitchC-Ethernet0/0/3] port link-type trunk
[SwitchC-Ethernet0/0/3] port trunk allow-pass vlan 1 to 20
[SwitchC-Ethernet0/0/3] bpdu enable
[SwitchC-Ethernet0/0/3] quit# 将Eth0/0/1配置成边缘端口。

[SwitchC] interface ethernet 0/0/1
[SwitchC-Ethernet0/0/1] stp edged-port enable
[SwitchC-Ethernet0/0/1] port hybrid pvid vlan 20
[SwitchC-Ethernet0/0/1] port hybrid untagged vlan 20
[SwitchC-Ethernet0/0/1] quit# 启动MSTP。

[SwitchC] stp enable
配置SwitchD
# 配置SwitchD的MST域。

[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name RG2
[SwitchD-mst-region] instance 1 vlan 1 to 10# 激活域配置。

[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit# 配置SwitchD在实例1中的优先级为0,保证SwitchD作为实例1的域根。

[SwitchD] stp instance 1 priority 0# 配置端口路径开销的计算方法为华为私有计算方
法。

[SwitchD] stp pathcost-standard legacy# 启动BPDU保护功能。

[SwitchD] stp bpdu-protection# 创建VLAN 2到20。

[SwitchD] vlan batch 2 to 20# 将Eth0/0/2加入VLAN。

[SwitchD] interface ethernet 0/0/2
[SwitchD-Ethernet0/0/2] port link-type trunk
[SwitchD-Ethernet0/0/2] port trunk allow-pass vlan 1 to 20
[SwitchD-Ethernet0/0/2] bpdu enable
[SwitchD-Ethernet0/0/2] quit# 将Eth0/0/3加入VLAN。

[SwitchD] interface ethernet 0/0/3
[SwitchD-Ethernet0/0/3] port link-type trunk
[SwitchD-Ethernet0/0/3] port trunk allow-pass vlan 1 to 20
[SwitchD-Ethernet0/0/3] bpdu enable
[SwitchD-Ethernet0/0/3] quit# 将Eth0/0/1配置成边缘端口。

[SwitchD] interface ethernet 0/0/1
[SwitchD-Ethernet0/0/1] stp edged-port enable
[SwitchD-Ethernet0/0/1] port hybrid pvid vlan 10
[SwitchD-Ethernet0/0/1] port hybrid untagged vlan 10
[SwitchD-Ethernet0/0/1] quit# 启动MSTP。

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

# 在SwitchA上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下:
<SwitchA> display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/2 DESI FORWARDING ROOT
0 Ethernet0/0/1 DESI FORWARDING ROOT
1 Ethernet0/0/
2 DESI FORWARDING ROOT
1 Ethernet0/0/1 DESI FORWARDING ROOT 由于交换机SwitchA在CIST内优先级最高,所以SwitchA被选择为CIST总根,同时它也是RG1的域根。

SwitchA的Eth0/0/2和Eth0/0/1在CIST上都是指定端口。

交换机SwitchA实例1上的优先级在域RG1内最高,所以SwitchA被选择为实例1的域根。

Eth0/0/2和Eth0/0/1在实例1上都被计算为指定端口。

# 在SwitchC上执行display stp interface brief命令,结果如下:
<SwitchC> display stp interface ethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 Ethernet0/0/3 ROOT FORWARDING NONE
1 Ethernet0/0/3 ROOT FORWARDING NONE
< SwitchC> display stp interface ethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 Ethernet0/0/2 DESI FORWARDING NONE
1 Ethernet0/0/
2 DESI FORWARDING NONESwitchC的Eth0/0/3在CIST和实例1中为根端口。

SwitchC的另一个Eth0/0/2,在CIST和实例1中都是指定端口。

# 在交换机SwitchB上执行display stp brief命令,结果如下:
<SwitchB> display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/2 ROOT FORWARDING NONE
0 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/
2 MAST FORWARDING NONE
1 Ethernet0/0/1 ROOT FORWARDING NONE交换机SwitchB在CIST上的优先级低于SwitchA,Eth0/0/2在CIST被计算为根端口。

同时因为SwitchA和SwitchB不属于同一个域,所以Eth0/0/2在实例1上被计算为Master端口。

在实例1中,SwitchB的优先级低于SwitchD,所以Eth0/0/1被计算为根端口。

SwitchB在CIST中的优先级高于SwitchD,Eth0/0/1在CIST 被计算为指定端口。

# 在SwitchD上执行display stp interface brief命令,结果如下:
<SwitchD> display stp interface ethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 Ethernet0/0/3 ROOT FORWARDING NONE
1 Ethernet0/0/3 DESI FORWARDING NONE
< SwitchD> display stp interface ethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 Ethernet0/0/2 ALTE DISCARDING NONE
1 Ethernet0/0/
2 ALTE DISCARDING NONE因为SwitchD的Eth0/0/2在CIST上为Alternate 端口,又因为SwitchD与SwitchC不在同一个域,所以Eth0/0/2在实例1中的也被选择为Alternate端口。

Eth0/0/3在CIST为根端口,因为SwitchD在实例1中的优先级比SwitchB高,所以Eth0/0/3在实例1上被作为指定端口。

配置文件
SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 2 to 20
#
stp instance 0 priority 0
stp instance 1 priority 0
stp pathcost-standard legacy
stp enable
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
active region-configuration
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 1 to 20 stp root-protection
bpdu enable
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 1 to 20 stp root-protection
bpdu enable
#
returnSwitchB的配置文件
#
sysname SwitchB
#
vlan batch 2 to 20
#
stp instance 0 priority 4096
stp pathcost-standard legacy
stp enable
stp region-configuration
region-name RG2
instance 1 vlan 1 to 10
active region-configuration
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
returnSwitchC的配置文件
#
sysname SwitchC
#
vlan batch 2 to 20
#
stp bpdu-protection
stp pathcost-standard legacy
stp enable
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
active region-configuration
#
interface Ethernet0/0/1
port hybrid pvid vlan 20
port hybrid untagged vlan 20
stp edged-port enable
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
returnSwitchD的配置文件
#
sysname SwitchD
#
vlan batch 2 to 20
#
stp instance 1 priority 0
stp bpdu-protection
stp pathcost-standard legacy
stp enable
stp region-configuration
region-name RG2
instance 1 vlan 1 to 10
active region-configuration
#
interface Ethernet0/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10
stp edged-port enable
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 1 to 20 bpdu enable
#
Return。

相关文档
最新文档