华为配置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的域名为RG1SwitchB和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配置成边缘端口。