You are on page 1of 103

S2300&S5300&S6320 Series Ethernet Switches

Configuration Guide - Ethernet Switching 14 MSTP Configuration

14 MSTP Configuration

About This Chapter

This chapter describes how to configure the Multiple Spanning Tree Protocol (MSTP).

14.1 Overview of MSTP


14.2 Understanding MSTP
14.3 Application Scenarios for MSTP
14.4 Summary of MSTP Configuration Tasks
14.5 Licensing Requirements and Limitations for MSTP
14.6 Default Settings for MSTP
14.7 Configuring MSTP
14.8 Configuring MSTP Multi-Process
14.9 Configuring MSTP Parameters on an Interface
14.10 Configuring MSTP Protection Functions
14.11 Configuring MSTP Interoperability Between Huawei and Non-Huawei Devices
14.12 Maintaining MSTP
14.13 Configuration Examples for MSTP
14.14 FAQ About MSTP
14.15 References for MSTP

14.1 Overview of MSTP

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 642


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Definition
The Multiple Spanning Tree Protocol (MSTP) enables multiple VLAN instances to be
mapped to the same spanning tree without creating loops. MSTP is a Layer 2 protocol that
was first defined in IEEE 802.1s.

Purpose
MSTP generates multiple spanning trees that are used independently of each other to forward
traffic in different VLANs, which allows load balancing to be implemented without the risk of
broadcast storms.

14.2 Understanding MSTP

14.2.1 MSTP Background

STP/RSTP Defect
Both STP and RSTP (which is an evolution of STP and allows for fast network topology
convergence) suffer from a significant limitation: neither can implement VLAN-based load
balancing because all VLANs on a LAN use one spanning tree. When a link is blocked, it no
longer transmits traffic, which wastes bandwidth and prevents certain VLAN packets from
being forwarded.
Figure 14-1 provides an example scenario where STP or RSTP is enabled on a LAN. In
Figure 14-1, the broken line shows the spanning tree.

Figure 14-1 Limitation of STP/RSTP


S1 S4
VLAN 3 VLAN 2 VLAN 3 VLAN 2

HostC HostA
VLAN 3 VLAN 2
(VLAN 3) (VLAN 2)

VLAN 2 VLAN 3
S2 S5

HostB VLAN 2 VLAN 2 HostD


(VLAN 2) VLAN 3 VLAN 3 (VLAN 3)
VLAN 3
VLAN 2 VLAN 3

S3 S6
spanning tree(root bridge:S6)

In Figure 14-1, S6 is the root switch. The links between S2 and S5 and between S1 and S4
are blocked. VLAN packets are transmitted through "VLAN 2" or "VLAN 3" links.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 643


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Because the link between S2 and S5 is blocked and the link between S3 and S6 denies packets
from VLAN 2, HostA and HostB cannot communicate with each other despite both belonging
to VLAN 2.

MSTP Improvements
Because the link between S2 and S5 is blocked and the link between S3 and S6 denies packets
from VLAN 2, HostA and HostB cannot communicate with each other despite both belonging
to VLAN 2.

To address the limitation of STP and RSTP, MSTP allows fast convergence and provides
multiple paths to load balance VLAN traffic.

MSTP divides a switching network into multiple regions, each of which has multiple
spanning trees that are independent of each other. Each spanning tree is called a Multiple
Spanning Tree Instance (MSTI) and each region is called a Multiple Spanning Tree (MST)
region. Figure 14-2 shows an example of an MST region.

NOTE

An MSTI is a collection of VLANs. Binding multiple VLANs to a single MSTI reduces communication
costs and resource usage. The topology of each MSTI is calculated independently, and traffic can be
balanced among MSTIs. Multiple VLANs with the same topology can be mapped to a single MSTI. The
forwarding state of the VLANs for a port is determined by the port state in the MSTI.

Figure 14-2 Multiple spanning trees in an MST region

S1 S4
VLAN 3 VLAN 2 VLAN 3 VLAN 2

HostC HostA
VLAN 3 VLAN 2
(VLAN 3) (VLAN 2)
VLAN 2
S2 S5

HostB VLAN 2 VLAN 2 HostD


(VLAN 2) VLAN 3 VLAN 3 (VLAN 3)
VLAN 3
VLAN 2 VLAN 3

S3 S6
spanning tree(root bridge:S4)
spanning tree(root bridge:S6)

In Figure 14-2, MSTP maps VLANs to MSTIs in the VLAN mapping table. Each VLAN can
be mapped to only one MSTI. This means that traffic of a VLAN can be transmitted in only
one MSTI. An MSTI, however, can correspond to multiple VLANs.

Two MSTIs are calculated:


l MSTI 1 uses S4 as the root switch to forward packets of VLAN 2.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 644


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

l MSTI 2 uses S6 as the root switch to forward packets of VLAN 3.

In this situation, devices within the same VLAN can communicate with each other. Packets of
different VLANs are load balanced along different paths.

14.2.2 Basic Concepts of MSTP

MSTP Network Hierarchy


An MSTP network consists of one or more MST regions, each of which contains one or more
MSTIs. An MSTI is a tree network that consists of switches running MSTP. Figure 14-3
provides an example of an MSTP network.

Figure 14-3 MSTP network hierarchy

MSTP Network

MST Region 1 MST Region 2


VLAN 1 -> MSTI 1 VLAN 1 -> MSTI 1
VLAN 2 -> MSTI 2 VLAN 2 -> MSTI 2
other VLAN S -> MSTI 3 other VLAN S -> MSTI 3

S1

VLAN 1 -> MSTI 1 VLAN 1 -> MSTI 1


VLAN 2 -> MSTI 2 VLAN 2 -> MSTI 2
other VLAN S -> MSTI 3 other VLAN S -> MSTI 3

MST Region 3 MST Region 4

CST
IST

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 645


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

MST Region
An MST region contains multiple network segments, each of which contains one or more
switches. The switches in one MST region all share the following characteristics:
l MSTP-enabled
l Same region name
l Same VLAN-MSTI mappings
l Same MSTP revision level
Multiple switches can be grouped into an MST region by using MSTP configuration
commands.
In Figure 14-4, MST region 4 contains SwitchA, SwitchB, SwitchC, and SwitchD, and has
three MSTIs.

Figure 14-4 MST region with four switches and three MSTIs

A D A D

B C B C
MSTI 1 MSTI 2
S3
A D
Root
VLAN 1 -> MSTI 1 bridge
VLAN 2 -> MSTI 2
other VLAN S -> MSTI 3 B C MSTI
MST Region 4 MSTI 3
MSTI topology in MST region 4

VLAN Mapping Table


Each MST region has a VLAN mapping table. The VLAN mapping table maps VLANs to
MSTIs.
In Figure 14-4, the mappings in MST region 4 are as follows:
l VLAN 1 is mapped to MSTI 1.
l VLAN 2 is mapped to MSTI 2.
l Other VLANs are mapped to MSTI 3.

CST
A Common Spanning Tree (CST) connects all MST regions on a switching network.
The CST is calculated using STP or RSTP, with each MST region being considered as a
single node.
In Figure 14-3, the regions that are connected through blue lines form a CST.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 646


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

IST
An Internal Spanning Tree (IST) resides within an MST region.

An IST is a special MSTI with an MSTI ID of 0.

An IST is a segment of the CIST in an MST region.

In Figure 14-3, the switches that are connected through dark blue lines in an MST region
form an IST.

SST
A Single Spanning Tree (SST) is formed in either of the following situations:
l A switch running STP or RSTP belongs to only one spanning tree.
l An MST region has only one switch.

CIST
A Common and Internal Spanning Tree (CIST) connects all the switches on a switching
network and is calculated using STP or RSTP.

In Figure 14-3, all ISTs and the CST form a CIST.

Regional Root
Regional roots are classified into Internal Spanning Tree (IST) and MSTI regional roots.

In Figure 14-3, the switches that are closest to the CIST root are IST regional roots.

An MST region can contain multiple spanning trees, each of which is called an MSTI. An
MSTI regional root is the root of the MSTI. In Figure 14-4, each MSTI has its own regional
root.

CIST Root
In Figure 14-3, the CIST root is the root bridge of the CIST. The CIST root is a device in S1.

Master Bridge
The master bridge is the switch closest to the CIST root in a region, for example, S1 in Figure
14-3.

If the CIST root is in an MST region, the CIST root is the master bridge of the region.

Port Roles
MSTP adds two extra port roles to those defined in RSTP. Table 14-1 describes the port roles
included in MSTP.

NOTE

Except edge ports, all ports participate in MSTP calculation.


A port can play different roles in different spanning tree instances.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 647


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Table 14-1 Port roles


Port Description
Role

Root port A root port sends data to a root bridge and is the port closest to the root bridge.
Root bridges do not have root ports.
Root ports are responsible for sending data to root bridges.
In Figure 14-5, S1 is the root; CP1 is the root port on S3; BP1 is the root port
on S2.

Designate The designated port on a switch forwards BPDUs to a downstream switch.


d port In Figure 14-5, AP2 and AP3 are designated ports on S1; CP2 is a designated
port on S3.

Alternate l Alternate ports provide an alternate path to the root bridge. This path is
port different from the path through the root port.
l An alternate port is blocked from sending BPDUs after a BPDU sent by
another bridge is received.
In Figure 14-5, BP2 is an alternate port.

Backup l Backup ports provide a backup path to a segment already connected by a


port designated port.
l Backup ports are blocked from sending BPDUs after a BPDU sent by itself
is received.
In Figure 14-5, CP3 is a backup port.

Master A master port is on the shortest path connecting MST regions to the CIST root.
port BPDUs of an MST region are sent to the CIST root through the master port.
Master ports are special regional edge ports, functioning as root ports on ISTs
or CISTs and master ports in instances.
In Figure 14-6, S1, S2, S3, and S4 form an MST region. AP1 on S1 is the
master port because it is the closest port in the region to the CIST root.

Regional A regional edge port is located at the edge of an MST region and connects to
edge port another MST region or an SST.
In Figure 14-6, AP1, DP1, and DP2 in an MST region are directly connected
to other regions. This means that they are all regional edge ports of the MST
region.

Edge port An edge port is located at the edge of an MST region and does not connect to
any switching device.
Generally, edge ports are directly connected to terminals.
After MSTP is enabled on a port, edge port detection is started automatically.
If the port fails to receive BPDU packets within (2 x Hello Timer + 1) seconds,
the port is set to an edge port. Otherwise, the port is set to a non-edge port.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 648


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-5 MSTP port roles


S1

Root
AP2 AP3

CP1 BP1
S3 S2

CP2 CP3 BP2

root port
designated port
Alternate port
Backup port

Figure 14-6 Master port and regional edge port


Connect to the
CIST root

AP1
Master
S1

S2 S3

S4

DP1 DP2 MST Region

Blocked port

MSTP Port States


Table 14-2 describes the MSTP port states, which are the same as those used in RSTP.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 649


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Table 14-2 Port states


Port Description
State

Forwardi A port in this state can send and receive BPDUs. It can also forward user
ng traffic.

Learning A port in this state learns MAC addresses from user traffic to construct a MAC
address table.
In Learning state, the port can send and receive BPDUs, but cannot forward
user traffic.

Discardin A port in this state can only receive BPDUs.


g

NOTE

Root, master, designated, and regional edge ports support all three port states. Alternate and backup ports
support only the Discarding state.

14.2.3 MST BPDUs


MSTP calculates spanning trees based on Multiple Spanning Tree Bridge Protocol Data Units
(MST BPDUs). Switches on an MSTP network transmit MST BPDUs to calculate spanning
tree topologies, maintain network topologies, and communicate topology changes.
Table 14-3 describes differences between TCN BPDUs, configuration BPDUs defined by
STP, RST BPDUs defined by RSTP, and MST BPDUs defined by MSTP.

Table 14-3 Differences between BPDUs


Version Type Name

0 0x00 Configuration BPDU

0 0x80 TCN BPDU

2 0x02 RST BPDU

3 0x02 MST BPDU

Format of an MST BPDU


Figure 14-7 shows the format of an MST BPDU.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 650


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-7 MST BPDU format

NOTE

The first 36 bytes of an MST BPDU are the same as those of an RST BPDU.
Fields from the 37th byte of an MST BPDU are MSTP-specific. The MSTI Configuration Messages field
consists of configuration messages of multiple MSTIs.

Table 14-4 describes the fields in an MST BPDU.

Table 14-4 Fields in an MST BPDU


Field Length Description
(Bytes)

Protocol 2 Identifies a protocol.


Identifier

Protocol 1 Indicates the protocol version identifier:


Version l 0: STP
Identifier
l 2: RSTP
l 3: MSTP

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 651


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Field Length Description


(Bytes)

BPDU Type 1 Indicates the BPDU type:


l 0x00: Configuration BPDU for STP
l 0x80: TCN BPDU for STP
l 0x02: RST BPDU or MST BPDU

CIST Flags 1 Identifies the CIST.

CIST Root 8 Indicates the ID of the CIST root switch.


Identifier

CIST External 4 Indicates the total path cost from the MST region
Path Cost where the switch resides to the MST region where the
CIST root switch resides. This value is calculated based
on link bandwidth.

CIST Regional 8 Indicates the ID of the regional root switch on the


Root Identifier CIST. If the root is in this region, the CIST Regional
Root Identifier is the same as the CIST Root Identifier.

CIST Port 2 Indicates the ID of the designated port in the IST.


Identifier

Message Age 2 Indicates the lifecycle of the BPDU.

Max Age 2 Indicates the maximum lifecycle of the BPDU. If the


Max Age timer expires, the link to the root is
considered faulty.

Hello Time 2 Indicates the Hello timer value. The default value is 2
seconds.

Forward Delay 2 Indicates the forwarding delay timer. The default value
is 15 seconds.

Version 1 1 Indicates the BPDUv1 length, which has a fixed value


Length of 0.

Version 3 2 Indicates the BPDUv3 length.


Length

MST 51 Indicates the MST configuration identifier, which has


Configuration four fields.
Identifier

CIST Internal 4 Indicates the total path costs from the local port to the
Root Path Cost IST master. This value is calculated based on link
bandwidth.

CIST Bridge 8 Indicates the ID of the designated switch on the CIST.


Identifier

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 652


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Field Length Description


(Bytes)

CIST 1 Indicates the number of remaining hops of the BPDU


Remaining in the CIST.
Hops

MSTI 16 Indicates an MSTI configuration message. Each MSTI


Configuration configuration message occupies 16 bytes. If there are n
Messages(may MSTIs, MSTI configuration messages are n*16 bytes
be absent) long.

Configurable Format of MST BPDUs


There are two formats of MST BPDUs:

l dot1s: BPDU format defined in IEEE 802.1s


l legacy: private BPDU format

Remote devices must transmit and receive the same MST BPDU format. If MST BPDU
formats are different, loops may occur.

To configure ports on a Huawei switch to automatically adopt the BPDU format of the remote
device, use the stp compliance command. The following modes can be set on Huawei
switches:

l auto
l dot1s
l legacy

In auto mode, a port uses the dot1s BPDU format by default, but switches format if legacy
BDPUs are received from the remote end.

Maximum Number of BPDUs Sent by a Port at a Hello Interval


The maximum number of BPDUs sent by a port during a Hello interval can be configured on
Huawei switches.

The number of BPDUs sent during a Hello interval increases as the Hello Time value is
increased. Setting the Hello Time to a smaller value limits the number of BPDUs sent by a
port during a Hello interval, which helps prevent network topology flapping and excessive use
of bandwidth resources by BPDUs.

14.2.4 MSTP Topology Calculation


MSTP can divide the entire Layer 2 network into multiple MST regions. The CST is
generated through calculation. In an MST region, multiple spanning trees are calculated, each
of which is called an MSTI. Among these MSTIs, MSTI 0 is also known as the internal
spanning tree (IST). Like STP, MSTP uses configuration messages to calculate spanning
trees. These configuration messages, however, are MSTP-specific.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 653


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Vectors
Both MSTIs and the CIST are calculated based on vectors, carried in MST BPDUs.

There are seven types of vectors used to calculate MSTIs and the CIST. Each vector carries a
priority value. For each vector, smaller priority values indicate higher priorities.

If the priority of a vector carried in the configuration message of a BPDU received by a port is
higher than the priority of the vector in the configuration message saved on the port, the port
replaces the saved configuration message with the received message and updates the global
configuration message saved on the device.

If the priority of a vector carried in the configuration message of a BPDU received on a port is
equal to or lower than that saved on the port, the port discards the BPDU. Table 14-5
describes each vector.

Table 14-5 Vector description

Vector Name Description

Root ID Identifies the root switch for the CIST. The root identifier consists of
the priority value (16 bits) and MAC address (48 bits).
The priority value is the priority of MSTI 0.

External root path Indicates the path cost from a CIST regional root to the root. ERPCs
cost (ERPC) are the same on all switches in an MST region. If the CIST root is in
an MST region, all ERPCs in that MST region are set to 0.

Regional root ID Identifies the MSTI regional root and consists of the priority value
(16 bits) and MAC address (48 bits).
The priority value is the priority of MSTI 0.

Internal root path Indicates the path cost from the local bridge to the regional root. The
cost (IRPC) IRPC saved on a regional edge port must be greater than the IRPC
saved on a non-regional edge port.

Designated Identifies the nearest upstream bridge on the path from the local
switching device bridge to the regional root. If the local bridge is the root or the
ID regional root, this ID is the same as the local bridge ID.

Designated port ID Identifies the port on the designated switch connected to the root port
on the local bridge. The designated port ID consists of the priority
value (4 bits) and port number (12 bits). The priority value must be a
multiple of 16.

Receiving port ID Identifies the port receiving the BPDU. The receiving port ID
consists of the priority value (4 bits) and port number (12 bits). The
priority value must be a multiple of 16.

The following vectors are used in CIST calculation:

l Root ID
l External root path cost

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 654


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

l Regional root ID
l Internal root path cost
l Designated switch ID
l Designated port ID
l Receiving port ID
The following vectors are used in MSTI calculation:
l Regional root ID
l Internal root path cost
l Designated switch ID
l Designated port ID
l Receiving port ID
NOTE

The preceding vectors are listed in descending order of priority.

Vectors are compared in the following sequence:


l Root IDs
l ERPCs
l Regional root IDs
l IRPCs
l Designated switch IDs
l Designated port IDs
l Receiving port IDs
If the vectors being compared are the same, the next vector in the list is compared. If the
vectors being compared are different, the remaining vectors are not compared

CIST Calculation
After comparing the vectors, the switch with the highest priority on the entire network is
selected as the CIST root. MSTP calculates an IST for each MST region, and calculates a
CST to interconnect MST regions. The CST and ISTs form a CIST for the entire network.

MSTI Calculation
In an MST region, MSTP independently calculates an MSTI for each VLAN based on
mappings between VLANs and MSTIs. The calculation process is similar to that used by STP
to calculate a spanning tree. For details, see 13.2.4 STP Topology Calculation.
MSTIs have the following characteristics:
l The spanning tree is calculated independently for each MSTI. Spanning trees of MSTIs
are independent of each other.
l Spanning trees of MSTIs can have different roots and topologies.
l Each MSTI sends BPDUs in its spanning tree.
l The topology of each MSTI is configured by using commands.
l A port can be configured with different parameters for different MSTIs.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 655


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

l A port can play different roles or have different status in different MSTIs.
On an MSTP-aware network, a VLAN packet is forwarded along the following paths:
l MSTI in an MST region
l CST among MST regions

MSTP Responding to Topology Changes


MSTP topology changes are processed in a similar manner to how RSTP topology changes
are processed. For details, see 13.2.6 RSTP Technology Details.

14.2.5 MSTP Fast Convergence


MSTP supports both ordinary and enhanced Proposal/Agreement (P/A) mechanisms:
l Ordinary P/A
Ordinary P/A mechanism supported by MSTP is implemented in the same manner as
that supported by RSTP. For details, see 13.2.6 RSTP Technology Details.
l Enhanced P/A

Figure 14-8 Enhanced P/A mechanism


Upstream Downstream
device device

Send a proposal so
that the port can
rapidly enter the
Forwarding state Configure the root port
and block non-edge ports
Send an agreement
The root port
The designated enters the
port enters the Send an agreement Forwarding state
Forwarding state
Root port
Designated port

Enhanced P/A works as follows:


a. The upstream device sends a proposal to the downstream device, indicating that the
port connecting to the downstream device wants to enter the Forwarding state. After
receiving this BPDU, the downstream device sets its port connected to the upstream
device as the root port, and blocks all non-edge ports.
b. The upstream device sends an agreement BPDU. After receiving this BPDU, the
root port enters the Forwarding state.
c. The downstream device replies with an agreement BPDU. After receiving this
BPDU, the upstream device sets its port connected to the downstream device as the
designated port, and the port enters the Forwarding state.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 656


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

By default, Huawei switches use fast transition in enhanced P/A. To enable a Huawei switch
to communicate with a third-party device that uses fast transition in common P/A, configure
the Huawei switch to use ordinary P/A.

14.2.6 MSTP Multi-Process


Background
MSTP multi-process is an enhancement to MSTP and allows ports on switching devices to be
bound to different processes. A process controls a ring composed of switches, which means
that only the ports bound to a process can participate in MSTP calculation for this process.
With MSTP multi-process, spanning trees of different processes are calculated independently
and do not affect each other.
The network shown in Figure 14-9 can be divided into multiple MSTP processes by using
MSTP multi-process. In Figure 14-9:
l User-facing Provider Edges (UPEs) are deployed at the aggregation layer, running
MSTP.
l UPE1 and UPE2 are connected by a Layer 2 link.
l Multiple rings are connected to UPE1 and UPE2 through different ports.
l Switching devices on the rings reside at the access layer, running STP or RSTP. Because
UPE1 and UPE2 work for different carriers, they reside on different spanning trees so
that their topology changes do not affect each other.

Figure 14-9 Application of both MSTP and STP/RSTP

MPLS/IP Core
Core

UPE4 UPE3
Aggregation

MSTP

UPE1 UPE2

STP/RSTP

S1
Access

S4

S2 S3

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 657


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

NOTE

MSTP multi-process is applicable to MSTP, RSTP, and STP.

Purpose
MSTP multi-process provides the following benefits:
l Greatly improves the applicability of STP to different networking conditions.
On a network running different spanning tree protocols, devices that run different
spanning tree protocols can be bound to different processes, allowing every process to
calculate a separate, independent spanning tree.
l Improves networking reliability.
Network topology is calculated for each process so that, if a device fails, only the
topology corresponding to the process that the device belongs to is affected. On a
network with many Layer 2 access devices, MSTP multi-process reduces the adverse
effect of a single node failure on the entire network.
l Reduces the network administrator workload during network expansion.
To expand a network, a network administrator must configure new processes, connect
the processes to the existing network, and keep the existing MSTP processes unchanged.
If device expansion is performed in a process, only this process needs to be modified.
l Implements separate Layer 2 port management
An MSPT process manages separate port functions on a device. Layer 2 ports on a
device are separately managed by multiple MSTP processes.

Additional Concepts
l Public link status
In Figure 14-9, the public link between UPE1 and UPE2 is a Layer 2 link running
MSTP. This public link is different from the links that connect switching devices to
UPEs. The ports on the public link need to participate in the calculation for multiple
access rings and MSTP processes. Therefore, the UPEs must identify the process from
which MST BPDUs are sent.
In addition, a port on the public link participates in the calculation for multiple MSTP
processes, and obtains different status. As a result, the port cannot determine its status.
To prevent this situation, the port always adopts its status in MSTP process 0 when
participating in the calculation for multiple MSTP processes.
NOTE

By default, MSTP process 0 is created when a device starts, and MSTP configurations in the
system view and interface view belong to this process.
l Reliability
On the network shown in Figure 14-10, after the topology of a ring changes, the MSTP
multi-process mechanism helps UPEs flood a TC BPDU to all devices on the ring and
prevent the TC BPDU from being flooded to devices on the other ring. UPE1 and UPE2
update MAC and ARP entries on the ports corresponding to the changed spanning tree.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 658


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-10 MSTP multi-process topology change

Core
MPLS/IP Core

UPE4 UPE3

Aggregation
MSTP

UPE1 UPE2

STP/RSTP

S1

Access
S4

S3
S2

Topology change

Flood STP/RSTP TC BPDUs at the access layer

Flood STP/RSTP TC BPDUs at the aggregation layer

On the network shown in Figure 14-11, if the public link between UPE1 and UPE2 fails,
multiple switching devices that are connected to the UPEs will unblock their blocked
ports.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 659


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-11 Public link fault

MPLS/IP Core

Core
UPE4 UPE3

Aggregation
MSTP

UPE1 UPE2

STP/RSTP

Access
S2 S4

S1 S3

UPE1 is configured with the highest priority, UPE2 with the second highest priority, and
all other switches with default or lower priorities. After the link between UPE1 and
UPE2 fails, the blocked ports (replacing the root ports) on switching devices no longer
receive packets with higher priorities, triggering state machine calculation. If the
calculation changes the blocked ports to designated ports, a permanent loop forms, as
shown in Figure 14-12.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 660


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-12 Loop between access rings

Core
MPLS/IP Core

UPE4 UPE3

Aggregation
MSTP
UPE1 UPE2

STP/RSTP

Access
S2 S4

S1 S3

Flood MSTP TC BPDUs at the aggregation layer

Flood STP/RSTP TC BPDUs at the access layer

l Loop prevention solutions


To prevent a loop from occurring between access rings, use either of the following
solutions:
– Configure an inter-board Eth-Trunk link between UPE1 and UPE2.
An inter-board Eth-Trunk link can be used as the public link between UPE1 and
UPE2 to improve link reliability, as shown in Figure 14-13.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 661


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-13 inter-board Eth-Trunk link

Core
MPLS/IP Core

UPE4 UPE3

Aggregation
MSTP

UPE1 UPE2
Eth-Trunk

STP/RSTP

Access
S2 S4

S1 S3

– Configure root protection between UPE1 and UPE2.


If all physical links between UPE1 and UPE2 fail, configuring an inter-board Eth-
Trunk link cannot prevent the loop. Root protection can be configured to prevent
the loop, as shown in Figure 14-12.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 662


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-14 MSTP multi-process with root protection

Core
MPLS/IP Core

UPE4 UPE3

Aggregation
MSTP

UPE1 UPE2

Root
protection
S2
S4

Access
STP/RSTP

S1 S3

The blue ring in Figure 14-14 is used as an example. UPE1 is configured with the
highest priority, UPE2 with the second highest priority, and switching devices on
the blue ring with default or lower priorities. Root protection is enabled on UPE2.
If a port on S1 is blocked, when the public link between UPE1 and UPE2 fails, the
blocked port on S1 starts to perform state machine calculation. After calculation,
the blocked port becomes the designated port and performs P/A negotiation with the
downstream device.
After S1 sends BPDUs of higher priorities to the UPE2 port enabled with root
protection, the port is blocked. The port remains blocked because it continues to
receive BPDUs of higher priorities, which prevents loops from occurring.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 663


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.3 Application Scenarios for MSTP


Application of MSTP

Figure 14-15 Network of a typical MSTP application

MST Region
S1 S2
all VLAN

VLAN
VLAN VLAN
10&20 VLAN
20&30 20&30
10&20

VLAN
S3 20&40 S4

MSTP allows packets in different VLANs to be forwarded by using different spanning tree
instances. An example of a network using MSTP is shown in Figure 14-15. The network is
configured in the following ways:

l All devices on the network belong to the same MST region.


l VLAN 10 packets are forwarded within MSTI 1.
l VLAN 30 packets are forwarded within MSTI 3.
l VLAN 40 packets are forwarded within MSTI 4.
l VLAN 20 packets are forwarded within MSTI 0.

In Figure 14-15, S1 and S2 are devices at the aggregation layer, and S3 and S4 are devices at
the access layer. Traffic from VLAN 10 and VLAN 30 is terminated by aggregation devices,
and traffic from VLAN 40 is terminated by the access device. Therefore, S1 and S2 can be
configured as the roots of MSTI 1 and MSTI 3, and S3 can be configured as the root of MSTI
4.

Application of MSTP Multi-process


In Figure 14-16, the UPEs are connected to each other through Layer 2 links and enabled
with MSTP. The rings connected to the UPEs must be independent of each other. The devices
on the rings connected to the UPEs support only RSTP, not MSTP.

After MSTP multi-process is enabled, each MSTP process corresponds to a ring connected to
the UPE. STP on each ring calculates a tree independently.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 664


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Figure 14-16 Application of both MSTP and STP/RSTP

MPLS/IP Core

Core
UPE4 UPE3

Aggregation
MSTP

UPE1 UPE2

STP/RSTP

S1

Access
S4

S2 S3

14.4 Summary of MSTP Configuration Tasks


Table 14-6 lists the configuration task summary of MSTP.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 665


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Table 14-6 MSTP configuration tasks


Task Description Reference

Configure basic MSTP MSTP is commonly 14.7 Configuring MSTP


functions. configured on switches to
trim a ring network to a
loop-free network. Devices
start spanning tree
calculation after the working
mode is set and MSTP is
enabled. Use any of the
following methods if you
need to intervene in the
spanning tree calculation:
l Manually configure the
root bridge and
secondary root bridge.
l Set a priority for a switch
in an MSTI.
l Set a path cost for a port
in an MSTI.
l Set a priority for a port in
an MSTI.

Configure MSTP multi- On a network deployed with 14.8 Configuring MSTP


process. Layer 2 single-access rings Multi-Process
and multi-access rings,
configure multiple MSTP
processes so that spanning
trees of different processes
are calculated independently
and do not affect each other.

Configure MSTP parameters Setting optimal MSTP 14.9 Configuring MSTP


on an interface. parameters achieve rapid Parameters on an
convergence. Interface

Configure MSTP protection You can configure one or 14.10 Configuring MSTP
functions. more functions. Protection Functions

Configure MSTP To communicate with a non- 14.11 Configuring MSTP


interoperability between Huawei device, set proper Interoperability Between
Huawei devices and non- parameters on the MSTP- Huawei and Non-Huawei
Huawei devices. enabled Huawei device. Devices

14.5 Licensing Requirements and Limitations for MSTP

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 666


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Involved Network Elements


Other network elements also need to support MSTP.

Licensing Requirements
MSTP is a basic feature of a switch and is not under license control.

Version Requirements

Table 14-7 Products and versions supporting MSTP


Product Product Software Version
Model

S2300 S2300SI V100R005C01, V100R006(C00&C01&C03&C05)

S2300EI V100R005C01, V100R006(C00&C01&C03&C05)

S2350EI V200R003C00, V200R005C00SPC300, V200R006C00,


V200R007C00, V200R008C00, V200R009C00,
V200R010C00, V200R011C10

S2320EI V200R011C10

S3300 S3300SI V100R005C01, V100R006(C00&C01&C03&C05)

S3300EI V100R005C01, V100R006(C00&C01&C03&C05)

S3300HI V100R006(C00&C01), V200R001C00

S5300 S5300LI V200R001C00, V200R002C00, V200R003(C00&C02),


V200R005C00SPC300, V200R006C00, V200R007C00,
V200R008(C00&C10), V200R009C00, V200R010C00,
V200R011C10

S5300SI V100R005C01, V100R006(C00&C01), V200R001C00,


V200R002C00, V200R003C00, V200R005(C00&C02)

S5300EI V100R005C01, V100R006(C00&C01), V200R001C00,


V200R002C00, V200R003C00,
V200R005(C00&C01&C02)

S5310EI V200R002C00, V200R003C00, V200R005(C00&C02)

S5300HI V100R006(C00&C01), V200R001(C00&C01),


V200R002C00, V200R003C00,
V200R005(C00&C01&C02)

S5306LI V100R006(C00&C01), V200R001C00, V200R002C00,


V200R003C00, V200R005C00

S5320EI V200R007C00, V200R008C00, V200R009C00,


V200R010C00, V200R011C10

S5320SI V200R008(C00&C10), V200R009C00, V200R010C00,


V200R011C10

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 667


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Product Product Software Version


Model

S5320HI V200R009C00, V200R010C00, V200R011C10

S5320LI V200R010C00, V200R011C10

S5330SI V200R011C10

S6300 S6300EI V100R006C00, V200R001(C00&C01), V200R002C00,


V200R003C00, V200R005(C00&C01&C02)

S6320EI V200R008C00, V200R009C00, V200R010C00,


V200R011C10

S6320SI V200R011C10

NOTE
To know details about software mappings, see Hardware Query Tool.

Feature Limitations
l Table 14-8 lists the specification of MSTP.

Table 14-8 Specification of MSTP


Item Specification

Maximum number of instances on the 65


entire system

l MSTP BPDUs may be discarded in a scenario wherein there are many MSTIs and MSTP
multi-process is configured. This is due to the default CIR of STP being insufficient.
(The default CIR of STP is insufficient because the length of MSTP BPDUs increases as
the number of MSTIs increases, and the number of outgoing MSTP BPDUs increases
when MSTP multi-process is configured.) To avoid this situation, increase the CIR of
STP.
If the CPCAR values are adjusted improperly, network services are affected. To adjust
the CPCAR values of STP BPDUs, contact technical support personnel.
l Enabling MSTP on a ring network immediately triggers spanning tree calculation. If
basic configurations are not performed on switches and interfaces before MSTP is
enabled, network flapping may occur upon changes to parameters such as device priority
and interface priority.

14.6 Default Settings for MSTP

Parameter Default Setting

Working mode MSTP

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 668


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Parameter Default Setting

MSTP status MSTP is disabled globally and enabled on an interface.

Switching device priority 32768

Port priority 128

Algorithm used to calculate the dot1t, IEEE 802.1t


path cost

Forward Delay Time 1500 centiseconds

Hello Time 200 centiseconds

Max Age Time 2000 centiseconds

14.7 Configuring MSTP

Context
MSTP based on the basic STP/RSTP function divides a switching network into multiple
regions, each of which has multiple spanning trees that are independent of each other. MSTP
isolates different VLANs' traffic, and load-balances VLAN traffic. MSTP is configured on
switches to trim a ring network to a loop-free network. Devices start spanning tree calculation
after the working mode is set and MSTP is enabled. To intervene in the spanning tree
calculation, use any of the following methods:

l Manually configure the root bridge and secondary root bridge.


l Set a priority for a switch in an MSTI. The lower the numerical value, the higher the
priority of the switch and the more likely the switch becomes a root bridge.
l Set a path cost for a port in an MSTI. The lower the numerical value, the smaller the cost
of the path from the port to the root bridge and the more likely the port becomes a root
port (assuming the same calculation method is used).
l Set a priority for a port in an MSTI. The lower the numerical value, the more likely the
port becomes a designated port.

14.7.1 Configuring the MSTP Mode

Context
Before configuring basic MSTP functions, set the working mode of a switch to MSTP. MSTP
is compatible with STP and RSTP.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 669


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Step 2 Run:
stp mode mstp

The working mode of the switch is set to MSTP. By default, the working mode is MSTP.
MSTP can recognize RSTP BPDUs and, conversely, RSTP can recognize MSTP BPDUs.
However, MSTP and STP cannot recognize each other's BPDUs. To enable devices running
different spanning tree protocols to interwork with each other, interfaces of an MSTP-enabled
switch connected to devices running STP automatically transition to STP mode; other
interfaces continue to work in MSTP mode.

----End

14.7.2 Configuring and Activating an MST Region


Context
An MST region contains multiple switches and network segments. These switches are directly
connected and, after MSTP is enabled, have the same region name, VLAN-to-MSTI mapping,
and configuration revision number. One switching network can have multiple MST regions.
Running MSTP commands allows you to group multiple switches into one MST region.

NOTE

Two switches belong to the same MST region when they have the same:
l Name of the MST region
l Mapping between VLANs and MSTIs
l Revision level of the MST region

Perform the following steps on a switch that needs to join an MST region.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
stp region-configuration

The MST region view is displayed.


Step 3 Run:
region-name name

The name of an MST region is configured.


By default, the MST region name is the MAC address of the bridge MAC of the switch.
Step 4 Perform either of the following steps to configure VLAN-to-instance mappings.
l Run the instance instance-id vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> command to
configure VLAN-to-instance mappings.
l Run the vlan-mapping modulo modulo command to enable VLAN-to-instance mapping
assignment based on a default algorithm.
By default, all VLANs in an MST region are mapped to MSTI 0.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 670


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

l The VLAN-to-instance mappings generated using the vlan-mapping modulo modulo


commands cannot meet network requirements. It is recommended that you run the
instance instance-id vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> command to configure
VLAN-to-instance mappings.
l The vlan-mapping modulo specifies the formula (VLAN ID-1)%modulo+1. In the
formula, (VLAN ID-1)%modulo means the remainder of (VLAN ID-1) divided by the
value of modulo. This formula is used to map a VLAN to the corresponding MSTI. The
calculation result of the formula is the ID of the mapping MSTI.
l To configure the mapping between a spanning tree instance and a MUX VLAN, you are
advised to configure the principal VLAN, subordinate group VLANs, and subordinate
separate VLANs of the MUX VLAN in the same protected instance. Otherwise, loops
may occur.
Step 5 (Optional) Run:
revision-level level

The MSTP revision number is set.


By default, the MSTP revision number is 0.
MSTP is a standard protocol; therefore, the MSTP revision level of a device is 0 by default. If
the revision level of some devices from a specified manufacturer is not 0, you must change
the value to 0 to facilitate tree calculation in an MST region.

NOTE

Changing MST region configurations (especially changes in the VLAN mapping table) triggers
spanning tree recalculation and may cause route flapping. Therefore:
l After configuring an MST region name, VLAN-to-MSTI mappings, and an MSTP revision number,
run the check region-configuration command in the MST region view to verify the configuration.
After confirming the region configurations, run the active region-configuration command to
activate MST region configurations.
l You are advised not to modify MST region parameters after the MST region is activated.

Step 6 Run:
active region-configuration

MST region configurations are activated so that the configured region name, VLAN-to-MSTI
mappings, and revision number can take effect.
The preceding configurations do not take effect until this command is run.
If MST region configurations on the switch change after MSTP starts, the active region-
configuration command must be run before the changes take effect.
Before using the active region-configuration command to activate the modified MST region
parameters, run the check region-configuration command to check whether parameters are
correct. After the active region-configuration command is run, if a message that indicates an
activation failure is displayed, reconfigure MSTP parameters.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 671


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.7.3 (Optional) Configuring the Root Bridge and Secondary


Root Bridge

Context
MSTP can calculate the root bridge or you can manually configure the root bridge or
secondary root bridge. Manually configuring the root bridge and secondary root bridge is
recommended.

A switch can function as a root bridge or a secondary root bridge in a spanning tree. It can
also function as the root bridge or secondary root bridge of another spanning tree. In a
spanning tree:
l Only one root bridge takes effect. If two or more root bridges are specified in a spanning
tree, the device with the smallest MAC address is used.
l Multiple secondary root bridges can be specified. If the root bridge fails or is powered
off and no new root bridge is specified, the secondary root bridge with smallest MAC
address will become the root bridge of the spanning tree.

Procedure
l Perform the following operations on the device to be used as the root bridge.
a. Run:
system-view

The system view is displayed.


b. Run:
stp [ instance instance-id ] root primary

The device is configured as the root bridge.

By default, a switch does not function as the root bridge. After the configuration is
complete, the priority value of the device is 0 (this value cannot be modified).

If instance is not specified, the device in MSTI 0 is a root bridge.


l Perform the following operations on the device to be used as the secondary root bridge.
a. Run:
system-view

The system view is displayed.


b. Run:
stp [ instance instance-id ] root secondary

The device is configured as the secondary root bridge.

By default, a switch does not function as the secondary root bridge. After the
configuration is complete, the priority value of the device is 4096 (this value cannot
be modified).

If instance is not specified, the device in MSTI 0 is a secondary root bridge.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 672


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.7.4 (Optional) Configuring a Priority for a Switch in an MSTI

Context
In an MSTI, there can be only one root bridge, which is the logical center of the MSTI. The
root bridge should be a high-performance switch; however, the priority of such a device may
not be the highest on the network. To ensure that such a device is selected as the root bridge,
set a low priority for low-performance switches, and set a high priority for high-performance
switches. A smaller priority value indicates a higher priority.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
stp [ instance instance-id ] priority priority

A priority is set for the switch in an MSTI.

The default priority value of the switch is 32768.

If instance-id is not specified, a priority is set for the switch in MSTI 0.

NOTE

If the stp [ instance instance-id ] root primary or stp [ instance instance-id ] root secondary
command has been executed to configure the device as the root bridge or secondary root bridge, to
change the device priority, run the undo stp [ instance instance-id ] root command to disable the root
bridge or secondary root bridge function and run the stp [ instance instance-id ] priority priority
command to set a priority.

----End

14.7.5 (Optional) Configuring a Path Cost of a Port in an MSTI

Context
A path cost is port-specific and is used by MSTP to select a link.

Path costs of ports are an important metric used in spanning tree calculation and determine
root port selection in an MSTI. The port with the lowest path cost to the root bridge is
selected as the root port. Setting different path costs for a port in different MSTIs allows
VLAN traffic to be transmitted along different physical links for load balancing.

If loops occur on a network, it is recommended that you set a large path cost for ports with
low link rates.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 673


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Step 2 Run:
stp pathcost-standard { dot1d-1998 | dot1t | legacy }

A path cost calculation method is configured.

By default, the IEEE 802.1t standard (dot1t) is used to calculate the path cost.

All switches on a network must use the same path cost calculation method.

Step 3 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.

Step 4 Run:
stp instance instance-id cost cost

A path cost is set for the port in the current MSTI.

l When the Huawei calculation method is used, cost ranges from 1 to 200000.
l When the IEEE 802.1d standard method is used, cost ranges from 1 to 65535.
l When the IEEE 802.1t standard method is used, cost ranges from 1 to 200000000.

----End

14.7.6 (Optional) Configuring a Port Priority in an MSTI

Context
During spanning tree calculation, port priorities in MSTIs determine which ports are selected
as designated ports.

To block a port in an MSTI to eliminate loops, set the port priority to a value larger than the
default value. This port will be blocked during designated port selection.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.

Step 3 Run:
stp instance instance-id port priority priority

A port priority is set in an MSTI.

By default, the port priority is 128.

The priority value ranges from 0 to 240, in increments of 16.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 674


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.7.7 Enabling MSTP

Context
Enabling MSTP on a ring network immediately triggers spanning tree calculation. If basic
configurations are not performed on switches and interfaces before MSTP is enabled, network
flapping may occur upon changes to parameters such as device priority and interface priority.

Procedure
Step 1 Run:
system-view

The system view is displayed.

STP/RSTP-enabled devices calculate spanning trees by exchanging BPDUs. Therefore, all the
interfaces participating in spanning tree calculation must be enabled to send BPDUs to the
CPU for processing. By default, an interface is enabled to send BPDUs to the CPU. You can
run the bpdu enable command in interface view to enable an interface to send BPDUs to the
CPU. The S5320EI, S5320HI, and S6320EI do not support the bpdu command.

Step 2 Run:
stp enable

MSTP is enabled on the switch.

By default, the MSTP function is disabled on the device.

NOTE

If the management network interface for an MSTP-enabled device is a VLANIF interface of a VLAN,
run the ethernet-loop-protection ignored-vlan command to specify this VLAN as an ignored VLAN.
During MSTP calculation, the interface on which the ignored VLAN is configured remains in
forwarding state. Therefore, services are not interrupted.
After MSTP is enabled on a port, edge port detection is started automatically. If the port fails to receive
BPDU packets within (2 x Hello Timer + 1) seconds, the port is set to an edge port. Otherwise, the port
is set to a non-edge port.

NOTE

For the S2350EI and S5300LI, a maximum of 64 STP-enabled ports in Up state are recommended. If there
are more than 64 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol flapping
may occur.
For the S2320EI, S5320LI, S5330SI, S6320SI, and S5320SI, a maximum of 128 STP-enabled ports in Up
state are recommended. If there are more than 128 STP-enabled ports in Up state, the CPU may be affected
and faults such as protocol flapping may occur.
For the S5320EI, a maximum of 200 STP-enabled ports in Up state are recommended. If there are more than
200 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol flapping may occur.
For the S5320HI and S6320EI, a maximum of 256 STP-enabled ports in Up state are recommended. If there
are more than 256 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol
flapping may occur.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 675


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Follow-up Procedure
If the topology of a spanning tree changes, the forwarding paths to associated VLANs are
changed. On the switch, therefore, the ARP entries corresponding to these VLANs need to be
updated. MSTP processes ARP entries in either fast or normal mode.
l In fast mode, ARP entries to be updated are directly deleted.
l In normal mode, ARP entries to be updated are rapidly aged.
The remaining lifetime of ARP entries to be updated is set to 0. The switch rapidly
processes these aged entries. If the number of ARP aging probe attempts is not set to 0,
ARP implements aging probe for these ARP entries.
To specify which mode is used for STP/RSTP convergence, run the stp converge { fast |
normal } command in the system view.
By default, the normal MSTP convergence mode is used.

NOTE

If fast mode is used, ARP entries are frequently deleted. This causes high CPU usage on the device
(reaching 100%) and results in frequent network flapping. Therefore, using normal mode is
recommended.

14.7.8 Verifying the Basic MSTP Configuration


Procedure
l Run the display stp [ instance instance-id ] [ interface interface-type interface-number |
slot slot-id ] [ brief ] command to view spanning-tree status and statistics.
l Run the display stp region-configuration command to view configurations of activated
MST regions.
l Run the display stp region-configuration digest command to view the digest
configurations of activated MST regions.
----End

14.8 Configuring MSTP Multi-Process

Pre-configuration Tasks
MSTP ensures that spanning trees in rings are calculated independently. After MSTP multi-
process is enabled, each MSTP process can manage certain ports on a device. Each Layer 2
interface can be managed by multiple MSTP processes.
Before configuring MSTP multi-process, complete and activate the MST region
configuration.

14.8.1 Creating an MSTP Process


Context
A process ID uniquely identifies an MSTP process. After the ports on an MSTP-enabled
device are bound to different processes, the switch performs MSTP calculation based on

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 676


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

processes, with only relevant ports in each process taking part in MSTP calculation. To create
an MSTP process, perform the following procedure on the devices connected to access rings.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
stp process process-id

An MSTP process is created and the MSTP process view is displayed.


Step 3 Run:
stp mode mstp

A working mode is configured for the MSTP process.


The default mode is MSTP.

NOTE

l A default MSTP process with the ID 0 is established when a device starts. MSTP configurations in
the system view and interface view belong to this process. The default working mode of this process
is MSTP.
l To add an interface to an MSTP process whose ID is not 0, run the stp process command followed
by the stp binding process command.

----End

14.8.2 Adding a Port to an MSTP Process


Context
After being added to MSTP processes, interfaces can participate in MSTP calculation. The
links connecting MSTP-enabled devices and access rings are called access links, and the link
shared by multiple access rings is called a shared link. Interfaces on this shared link
participate in MSTP calculation in multiple access rings and MSTP processes.

Procedure
l Adding a port on an access link to an MSTP process
a. Run:
system-view

The system view is displayed.


b. Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


The interface specified in this command must be the interface that connects the
device and the access ring.
c. Run:
stp binding process process-id

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 677


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

The port is added to the specified MSTP process.

NOTE

On the S5320EI, S5320HI, and S6320EI, if an interface joining the MSTP process has sub-
interfaces configured with other features such as VPLS, run the stp vpls-subinterface
enable command. The main interface can then notify its sub-interfaces to update MAC
address entries and ARP entries after receiving a TC-BPDU. This prevents service
interruption. In addition, root protection needs to be configured on the main interface.
l Adding a port on a shared link to an MSTP process
a. Run:
system-view

The system view is displayed.


b. Run:
interface interface-type interface-number

The view of the Ethernet interface that participates in spanning tree calculation is
displayed.

The interface specified in this command must be an interface on the shared link
between the devices configured with MSTP multi-process. It cannot be an interface
that connects an access ring and device.
c. Run:
stp binding process process-id1 [ to process-id2 ] link-share

The port is added to multiple MSTP processes to complete MSTP calculation.

NOTE

In an MSTP process where there are multiple shared links, run the stp enable command in
the MSTP multi-instance view. On an interface that is added to an MSTP process, run the
stp enable command in the interface view.

----End

14.8.3 (Optional) Configuring the Root Bridge and Secondary


Root Bridge

Context
MSTP can calculate the root bridge or you can manually configure the root bridge or
secondary root bridge. Manually configuring the root bridge and secondary root bridge is
recommended.

A switch can function as a root bridge or a secondary root bridge in a spanning tree. It can
also function as the root bridge or secondary root bridge of another spanning tree. In a
spanning tree:

l Only one root bridge takes effect. If two or more root bridges are specified in a spanning
tree, the device with the smallest MAC address is used.
l Multiple secondary root bridges can be specified. If the root bridge fails or is powered
off and no new root bridge is specified, the secondary root bridge with smallest MAC
address will become the root bridge of the spanning tree.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 678


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
l Perform the following operations on the device to be used as the root bridge.
a. Run:
system-view

The system view is displayed.


b. Run:
stp process process-id

The MSTP process view is displayed.


c. Run:
stp [ instance instance-id ] root primary

The device is configured as the root bridge.


By default, a switch does not function as the root bridge. After the configuration is
complete, the priority value of the device is 0 (this value cannot be modified).
If instance is not specified, the device in MSTI 0 is a root bridge.
l Perform the following operations on the device to be used as the secondary root bridge.
a. Run:
system-view

The system view is displayed.


b. Run:
stp process process-id

The MSTP process view is displayed.


c. Run:
stp [ instance instance-id ] root secondary

The device is configured as the secondary root bridge.


By default, a switch does not function as the secondary root bridge. After the
configuration is complete, the priority value of the device is 4096 (this value cannot
be modified).
If instance is not specified, the device in MSTI 0 is a secondary root bridge.
----End

14.8.4 (Optional) Configuring a Priority for a Switch in an MSTI


Context
In an MSTI, there can be only one root bridge, which is the logical center of the MSTI. The
root bridge should be a high-performance switch; however, the priority of such a device may
not be the highest on the network. To ensure that such a device is selected as the root bridge,
set a low priority for low-performance switches, and set a high priority for high-performance
switches. A smaller priority value indicates a higher priority.

Procedure
Step 1 Run:

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 679


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

system-view

The system view is displayed.


Step 2 Run:
stp process process-id

The MSTP process view is displayed.


Step 3 Run:
stp [ instance instance-id ] priority priority

A priority is set for the switch in an MSTI.


The default priority value of the switch is 32768.
If instance-id is not specified, a priority is set for the switch in MSTI 0.

NOTE

l To configure a switch as the primary root bridge, run the stp [ instance instance-id ] root primary
command directly. The priority value of this switch is 0.
l To configure a switch as the secondary root bridge, run the stp [ instance instance-id ] root
secondary command. The priority value of this switch is 4096.
In an MSTI, a switch cannot act as the primary root bridge and secondary root bridge at the same
time.
l If the stp [ instance instance-id ] root primary or stp [ instance instance-id ] root secondary
command has been executed to configure the device as the root bridge or secondary root bridge, to
change the device priority, run the undo stp [ instance instance-id ] root command to disable the
root bridge or secondary root bridge function and run the stp [ instance instance-id ] priority
priority command to set a priority.

----End

14.8.5 (Optional) Configuring a Path Cost of a Port in an MSTI


Context
A path cost is port-specific and is used by MSTP to select a link.
Path costs of ports are an important metric used in spanning tree calculation and determine
root port selection in an MSTI. The port with the lowest path cost to the root bridge is
selected as the root port. Setting different path costs for a port in different MSTIs allows
VLAN traffic to be transmitted along different physical links for load balancing.
If loops occur on a network, it is recommended that you set a large path cost for ports with
low link rates. MSTP then blocks these ports.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
stp pathcost-standard { dot1d-1998 | dot1t | legacy }

A path cost calculation method is configured.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 680


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

By default, the IEEE 802.1t standard (dot1t) is used to calculate the path cost.
All switches on a network must use the same path cost calculation method.
Step 3 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 4 Run:
stp binding process process-id

The port is bound to an MSTP process.


Step 5 Run:
stp [ process process-id ] instance instance-id cost cost

A path cost is set for the port in the current MSTI.


l When the Huawei calculation method is used, cost ranges from 1 to 200000.
l When the IEEE 802.1d standard method is used, cost ranges from 1 to 65535.
l When the IEEE 802.1t standard method is used, cost ranges from 1 to 200000000.

----End

14.8.6 (Optional) Configuring a Port Priority in an MSTI

Context
During spanning tree calculation, port priorities in MSTIs determine which ports are selected
as designated ports.
To block a port in an MSTI to eliminate loops, set the port priority to a value larger than the
default value. This port will be blocked during designated port selection.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 3 Run:
stp binding process process-id

The port is bound to an MSTP process.


Step 4 Run:
stp [ process process-id ] instance instance-id port priority priority

A port priority is set in an MSTI.


By default, the port priority is 128.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 681


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

The priority value ranges from 0 to 240, in increments of 16.

----End

14.8.7 Configuring TC Notification in MSTP Multi-process


Context
After the TC notification function is configured for MSTP multi-process, an MSTP process
can notify the MSTIs in other specified MSTP processes to refresh MAC address entries and
ARP entries after receiving a TC-BPDU. This ensures service continuity. To configure the TC
notification function for MSTP multi-process, perform the following procedure on the devices
connected to access rings.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
stp process process-id

The view of the created MSTP process is displayed.


Step 3 Run:
stp tc-notify process 0

TC notification is enabled in the MSTP process.


After the stp tc-notify process 0 command is run, the current MSTP process notifies the
MSTIs in MSTP process 0 to update MAC entries and ARP entries after receiving a TC-
BPDU. This prevents services from being interrupted.

----End

14.8.8 Enabling MSTP


Context
After MSTP multi-process is enabled on the switch, you must enable MSTP in the MSTP
process view so that the MSTP configuration can take effect in the MSTP process.
Enabling MSTP on a ring network immediately triggers spanning tree calculation on the
network. On the switch, configurations such as the switch priority and port priority affect
spanning tree calculation. Any change to these configurations may cause network flapping.
Therefore, to ensure rapid and stable spanning tree calculation, perform basic configurations
on the switch and its ports and enable MSTP.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 682


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Step 2 Run:
stp process process-id

The view of the created MSTP process is displayed.

Step 3 Run:
stp enable

MSTP is enabled on the MSTP process of the device.

By default, the MSTP function is disabled on the device.

NOTE

For the S2350EI and S5300LI, a maximum of 64 STP-enabled ports in Up state are recommended. If there
are more than 64 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol flapping
may occur.
For the S2320EI, S5320LI, S5330SI, S6320SI, and S5320SI, a maximum of 128 STP-enabled ports in Up
state are recommended. If there are more than 128 STP-enabled ports in Up state, the CPU may be affected
and faults such as protocol flapping may occur.
For the S5320EI, a maximum of 200 STP-enabled ports in Up state are recommended. If there are more than
200 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol flapping may occur.
For the S5320HI and S6320EI, a maximum of 256 STP-enabled ports in Up state are recommended. If there
are more than 256 STP-enabled ports in Up state, the CPU may be affected and faults such as protocol
flapping may occur.

----End

Follow-up Procedure
If the topology of a spanning tree changes, the forwarding paths to associated VLANs are
changed. On the switch, therefore, the ARP entries corresponding to these VLANs need to be
updated. MSTP processes ARP entries in either fast or normal mode.

l In fast mode, ARP entries to be updated are directly deleted.


l In normal mode, ARP entries to be updated are rapidly aged.
The remaining lifetime of ARP entries to be updated is set to 0. The switch rapidly
processes these aged entries. If the number of ARP aging probe attempts is not set to 0,
ARP implements aging probe for these ARP entries.
In either fast or normal mode, MAC entries are directly deleted.

To specify which mode is used for STP/RSTP convergence, run the stp converge { fast |
normal } command in the system view.

By default, the normal MSTP convergence mode is used.

NOTICE
If fast mode is used, ARP entries are frequently deleted. This causes high CPU usage on the
device (reaching 100%) and results in frequent network flapping. Therefore, using normal
mode is recommended.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 683


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.8.9 Verifying the MSTP Multi-Process Configuration


Procedure
l Run the display stp process process-id [ instance instance-id ] [ interface interface-
type interface-number | slot slot-id ] [ brief ] command to view spanning-tree status and
statistics.
----End

14.9 Configuring MSTP Parameters on an Interface

Pre-configuration Tasks
Before configuring MSTP parameters that affect route convergence, configure MSTP or
MSTP multi-process.

14.9.1 Setting the MSTP Network Diameter


Context
Any two terminals on a switching network are connected through a specific path along
multiple devices. The network diameter is the maximum number of devices between any two
terminals. A larger network diameter indicates a larger network scale.
An improper network diameter may cause slow network convergence and affect
communication. Run the stp bridge-diameter command to set an appropriate network
diameter based on the network scale, which helps speed up convergence.
It is recommended that all devices be configured with the same network diameter.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 (Optional) Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp bridge-diameter diameter

The network diameter is configured.


By default, the network diameter is 7.
The switch calculates the optimal Forward Delay period, Hello timer value, and Max Age
timer value based on the specified network diameter.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 684


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

NOTE
RSTP uses a single spanning tree instance on the entire network, meaning that performance deterioration
cannot be prevented when the network scale increases. Therefore, the network diameter cannot be larger than
7.

----End

14.9.2 Setting the MSTP Timeout Interval


Context
If a device does not receive any BPDUs from the upstream device within the timeout interval,
the device considers the upstream device to have failed and recalculates the spanning tree.
Sometimes, a device cannot receive the BPDU from the upstream device within the timeout
interval because the upstream device is busy. In this case, recalculating the spanning tree will
cause a waste of network resources. To avoid wasting network resources, set a long timeout
interval on a stable network.
If a switching device does not receive any BPDUs from the upstream device within the
timeout interval, spanning tree recalculation is performed. The timeout interval is calculated
as follows:
Timeout interval = Hello time x 3 x Timer Factor

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 (Optional) Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp timer-factor factor

The timeout interval is set, specifying how long the upstream device waits for BPDUs.
By default, the timeout interval is 9 times the Hello timer value.

----End

14.9.3 Setting the Values of MSTP Timers


Context
The following timers are used in spanning tree calculation:
l Forward Delay: specifies the delay before a state transition. After the topology of a ring
network changes, it takes some time to spread the new configuration BPDU throughout

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 685


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

the entire network. As a result, the original blocked port may be unblocked before a new
port is blocked. When this occurs, a loop exists on the network. You can set the Forward
Delay timer to prevent loops. When the topology changes, all ports will be temporarily
blocked during the Forward Delay.
l Hello Time: specifies the interval at which hello packets are sent. A switching device
sends configuration BPDUs at the specified interval to detect link failures. If the
switching device does not receive any BPDUs within an interval of Hello Time, the
switching device recalculates the spanning tree.
l Max Age: determines whether BPDUs expire. A switching device determines that a
received configuration BPDU times out when the Max Age expires.
Devices on a ring network must use the same values of Forward Delay, Hello Time, and Max
Age.
You are not advised to directly change the preceding three timers. The three parameters are
relevant to the network scale; therefore, it is recommended that you set the network diameter
so that the spanning tree protocol automatically adjusts these timers. When the default
network diameter is used, the three timers also retain their default values.

NOTICE
To prevent frequent network flapping, make sure that the Hello Time, Forward Delay, and
Max Age timer values conform to the following formulas:
l 2 x (Forward Delay - 1.0 second) ≥ Max Age
l Max Age ≥ 2 x (Hello Time + 1.0 second)

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 (Optional) Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Set Forward Delay, Hello Time, and Max Age.


1. Run:
stp timer forward-delay forward-delay

The value of Forward Delay of the switch is set.


By default, the value of Forward Delay of the switch is 1500 centiseconds.
2. Run:
stp timer hello hello-time

The value of Hello Time of the switch is set.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 686


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

By default, the value of Hello Time of the switch is 200 centiseconds.


3. Run:
stp timer max-age max-age

The value of Max Age of the switch is set.


By default, the value of Max Age of the switch is 2000 centiseconds.

----End

14.9.4 Setting the Maximum Number of Connections in an Eth-


Trunk that Affects Spanning Tree Calculation
Context
The path costs affect spanning tree calculation. Changes of path costs trigger spanning tree
recalculation. The path cost of an interface is affected by its bandwidth, so you can change the
interface bandwidth to affect spanning tree calculation.
As shown in Figure 14-17, deviceA and deviceB are connected through two Eth-Trunk links.
Eth-Trunk 1 has three member interfaces in Up state and Eth-Trunk 2 has two member
interfaces in Up state. Each member link has the same bandwidth, and deviceA is selected as
the root bridge.
l Eth-Trunk 1 has higher bandwidth than Eth-Trunk 2. After STP calculation, Eth-Trunk 1
on deviceB is selected as the root port and Eth-Trunk 2 is selected as the alternate port.
l If the maximum number of connections affecting bandwidth of Eth-Trunk 1 is set to 1,
the path cost of Eth-Trunk 1 is larger than the path cost of Eth-Trunk 2. Therefore, the
two devices perform spanning tree recalculation. Then Eth-Trunk 1 on deviceB becomes
the alternate port and Eth-Trunk 2 becomes the root port.

Figure 14-17 Setting the maximum number of connections in an Eth-Trunk


SwitchA SwitchB
Before Eth-Trunk1
configuration Eth-Trunk2
Root Bridge

SwitchA SwitchB
Eth-Trunk1
After
configuration Eth-Trunk2

Root Bridge
Alternate port
Root port
Designated port

The maximum number of connections affects only the path cost of an Eth-Trunk interface
participating in spanning tree calculation, and does not affect the actual bandwidth of the Eth-
Trunk link. The actual bandwidth for an Eth-Trunk link depends on the number of active
member interfaces in the Eth-Trunk.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 687


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface eth-trunk trunk-id

The Eth-Trunk interface view is displayed.

Step 3 Run:
max bandwidth-affected-linknumber link-number

The maximum number of connections affecting the Eth-Trunk bandwidth is set.

By default, the maximum number of connections affecting the bandwidth of an Eth-Trunk is


8.

----End

14.9.5 Setting the Link Type for a Port

Context
It is easy to implement rapid convergence on a P2P link. If the two ports connected to a P2P
link are root or designated ports, the ports can transit to the forwarding state quickly by
sending Proposal and Agreement packets. This reduces the forwarding delay.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The view of the Ethernet interface participating in STP calculation is displayed.

Step 3 Run:
stp point-to-point { auto | force-false | force-true }

The link type is configured for the interface.

By default, an interface automatically determines whether to connect to a P2P link. The P2P
link supports rapid network convergence.

l If the Ethernet port works in full-duplex mode, it is connected to a P2P link. In this case,
specify force-true to implement rapid network convergence.
l If the Ethernet port works in half-duplex mode, specify force-true to forcibly set the link
type to P2P.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 688


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.9.6 Setting the Maximum Transmission Rate of an Interface


Context
A larger value of packet-number indicates more BPDUs sent in a hello interval and therefore
more system resources occupied. Setting the proper value of packet-number prevents excess
bandwidth usage when route flapping occurs.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The view of the Ethernet interface participating in STP calculation is displayed.


Step 3 Run:
stp transmit-limit packet-number

The maximum number of BPDUs sent by a port in a specified period is set.


By default, the maximum number of BPDUs that a port sends is 6 per second.

----End

14.9.7 Switching to the MSTP Mode


Context
If an interface on an MSTP-enabled device is connected to an STP-enabled device, the
interface switches to the STP-compatible mode.
If the STP-enabled device is switched to MSTP mode, or if it is powered off or disconnected
from the MSTP-enabled device, the interface cannot switch to MSTP mode. In this case, use
the stp mcheck command to switch the interface to MSTP mode.

Procedure
l Switch to the MSTP mode in the interface view.
a. Run:
system-view

The system view is displayed.


b. Run:
interface interface-type interface-number

The view of the Ethernet interface that participates in spanning tree calculation is
displayed.
c. Run:
stp mcheck

The device is switched to the MSTP mode.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 689


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

l Switch to the MSTP mode in the system view.


a. Run:
system-view

The system view is displayed.


b. (Optional) Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.


c. Run:
stp mcheck

The device is switched to the MSTP mode.


----End

14.9.8 Configuring a Port as an Edge Port and BPDU Filter Port


Context
If a designated port is located at the edge of a network and is directly connected to terminal
devices, this port is called edge port.
An edge port does not receive or process configuration BPDUs and does not participate in
MSTP calculation. It can transition from Disabled to Forwarding without any delay.
After a designated port is configured as an edge port, the port can still send BPDUs. The
BPDUs are sent to other networks, which causes flapping on other networks. To prevent a
port from processing and sending BPDUs, configure the port as an edge port and BPDU filter
port.

NOTICE
After all ports are configured as edge ports and BPDU filter ports in the system view, the
ports do not send BPDUs or negotiate the STP status with directly connected ports on the peer
device. All ports are in the Forwarding state, which may cause loops on the network and lead
to broadcast storms. Exercise caution when you configure a port as an edge port and BPDU
filter port.
After a port is configured as an edge port and BPDU filter port in the interface view, the port
does not process or send BPDUs. The port cannot negotiate the STP status with the directly
connected port on the peer device. Exercise caution when you configure a port as an edge port
and BPDU filter port.

Procedure
l Configuring all ports as edge ports and BPDU filter ports in the system view
a. Run:
system-view

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 690


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

The system view is displayed.


b. Run:
stp edged-port default

All ports are configured as edge ports.


By default, all ports are non-edge ports.
c. Run:
stp bpdu-filter default

All ports are configured as BPDU filter ports.


By default, a port is a non-BPDU filter port.
l Configuring a port as an edge port and BPDU filter port in the interface view
a. Run:
system-view

The system view is displayed.


b. Run:
interface interface-type interface-number

The view of the Ethernet interface that participates in spanning tree calculation is
displayed.
c. (Optional) Run:
stp edged-port enable

The port is configured as an edge port.


By default, all ports are non-edge ports.
d. Run:
stp bpdu-filter enable

The port is configured as a BPDU filter port.


By default, a port is a non-BPDU filter port.
----End

14.9.9 Setting the Maximum Number of Hops in an MST Region


Context
To communicate with each other on a Layer 2 network running MSTP, switches exchange
MST BPDUs. MST BPDUs have a field that indicates the number of remaining hops.
l The number of remaining hops in a BPDU sent by the root bridge equals the maximum
number of hops.
l The number of remaining hops in a BPDU sent by a non-root bridge equals the
maximum number of hops minus the number of hops from the non-root bridge to the
root bridge.
l If a switch receives a BPDU in which the number of remaining hops is 0, the switch will
discard the BPDU.
The maximum number of hops of a spanning tree in an MST region determines the network
scale. The stp max-hops command can be used to set the maximum number of hops in an
MST domain so that the network scale of a spanning tree can be controlled.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 691


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 (Optional) Run:


stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp max-hops hop

The maximum number of hops in an MST region is set.

By default, the maximum number of hops of the spanning tree in an MST region is 20.

----End

14.9.10 Verifying the Configuration of MSTP Parameters on an


Interface

Procedure
l Run the display stp [ process process-id ] [ instance instance-id ] [ interface interface-
type interface-number | slot slot-id ] [ brief ] command to view spanning-tree status and
statistics.

----End

14.10 Configuring MSTP Protection Functions

Pre-configuration Tasks
Before configuring MSTP protection functions, configure MSTP or MSTP multi-process.

14.10.1 Configuring BPDU Protection on a Switch

Context
Edge ports are directly connected to user terminals and will not receive BPDUs. Attackers
may send pseudo BPDUs to attack the switch. If the edge ports receive the BPDUs, the switch
configures the edge ports as non-edge ports and triggers a new spanning tree calculation.
Network flapping then occurs. BPDU protection can be used to protect switches against
malicious attacks.

Perform the following procedure on all switches that have edge ports.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 692


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 (Optional) Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp bpdu-protection

BPDU protection is enabled on the switch.


By default, BPDU protection is disabled on the switch.

----End

Follow-up Procedure
If you want an edge port to automatically recover from the error-down state, run the error-
down auto-recovery cause bpdu-protection interval interval-value command in the system
view to configure the auto recovery function and set a recovery delay on the port. Then a port
in error-down state can automatically go Up after the delay expires. Note the following when
setting the recovery delay:
l By default, the auto recovery function is disabled; therefore, the recovery delay
parameter does not have a default value. When you enable the auto recovery function,
you must set a recovery delay.
l A smaller value of interval-value indicates a shorter time taken for an edge port to go
Up, and a higher frequency of Up/Down state transitions on the port.
l A larger value of interval-value indicates a longer time taken for the edge port to go Up,
and a longer service interruption time.
l The auto recovery function takes effect only for the interfaces that transition to the error-
down state after the error-down auto-recovery command is executed.

14.10.2 Configuring TC Protection on a Switch


Context
If attackers forge TC-BPDUs to attack the switch, the switch receives a large number of TC
BPDUs within a short period. If MAC address entries and ARP entries are deleted frequently,
the switch is heavily burdened, causing potential risks to the network.
TC protection is used to suppress TC BPDUs. The number of TC BPDUs processed by a
switch within a given period is configurable. If the number of TC BPDUs received by a
switch exceeds the specified threshold within a given period, the switch handles only the
specified number of TC BPDUs. The processing of excess TC BPDUs is delayed until after
the specified period expires. This protects the switch from becoming overburdened with
frequently deleting MAC entries and ARP entries.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 693


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 (Optional) Run:


stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp tc-protection interval interval-value

The time taken by the device to process the maximum number of TC BPDUs is set.

By default, the device processes the maximum number of TC BPDUs at an interval of the
Hello time.

Step 4 Run:
stp tc-protection threshold threshold

The number of times the MSTP process handles the received TC BPDUs and updates
forwarding entries within a given time is set.

NOTE

Within the time specified by stp tc-protection interval, the switch processes the number of TC BPDUs
specified by stp tc-protection threshold. Packets that exceed this threshold are delayed, so spanning
tree convergence may be affected. For example, if the period is set to 10s and the threshold is set to 5,
the device processes five TC BPDUs within 10s. After 10s, the device processes subsequent TC BPDUs.

----End

14.10.3 Configuring Root Protection on an Interface

Context
Due to incorrect configurations or malicious attacks on the network, a root bridge may receive
BPDUs with a higher priority. Consequently, the legitimate root bridge is no longer able to
serve as the root bridge and the network topology is changed, triggering spanning tree
recalculation. This may also result in traffic that should be transmitted over high-speed links
being transmitted over low-speed links, leading to network congestion. The root protection
function on a switch preserves the role of the designated port in order to protect the root
bridge.

NOTE

Root protection takes effect only on designated ports.

Perform the following steps on the root bridge in an MST region.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 694


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The view of the Ethernet interface participating in STP calculation is displayed.


Step 3 (Optional) Run:
stp binding process process-id

The port is bound to an MSTP process.

NOTE

Skip this step if the interface belongs to process 0.

Step 4 Run:
stp root-protection

Root protection is configured on the switch.


By default, root protection is disabled.

----End

14.10.4 Configuring Loop Protection on an Interface


Context
To maintain the root port status and status of blocked ports on a network running MSTP, a
switch receives BPDUs from an upstream switch. If the switch cannot receive these BPDUs
because of link congestion or unidirectional-link failure, the switch re-selects a root port. The
original root port becomes a designated port and the original blocked ports change to the
Forwarding state. This may cause network loops. To mitigate this issue, configure loop
protection.
If the root port or alternate port does not receive BPDUs from the upstream device for a long
period, the switch enabled with loop protection sends a notification to the NMS. If the root
port is used, the root port enters the Discarding state and becomes the designated port. If the
alternate port is used, the alternate port remains blocked and becomes the designated port. In
this case, loops will not occur. After the link congestion subsides or unidirectional link
failures are rectified, the port receives BPDUs for negotiation and restores its original role and
status.

NOTE
An alternate port is a backup port for a root port. If a switch has an alternate port, configure loop
protection on both the root port and the alternate port.

Perform the following steps on the root port and alternate port on a switch in an MST region.

Procedure
Step 1 Run:

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 695


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 3 (Optional) Run:
stp binding process process-id

The port is bound to an MSTP process.

NOTE

Skip this step if the interface belongs to process 0.

Step 4 Run:
stp loop-protection

Loop protection for the root port is configured on the switch.


By default, loop protection is disabled.
Root protection and loop protection cannot be configured simultaneously.

----End

14.10.5 Configuring Shared-Link Protection on a Switch


Context
Shared-link protection is used in scenarios where a switch is dual homed to a network.
If a shared link fails, shared-link protection forcibly changes the working mode of a local
switch to RSTP. This function can be used together with root protection to avoid network
loops.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
stp process process-id

The MSTP process view is displayed.

NOTE

Skip this step if you perform configurations in the MSTP process 0.

Step 3 Run:
stp link-share-protection

Shared-link protection is enabled.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 696


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.10.6 Verifying the MSTP Protection Function Configuration

Procedure
l Run the display stp [ process process-id ] [ instance instance-id ] [ interface interface-
type interface-number | slot slot-id ] [ brief ] command to view spanning-tree status and
statistics.

----End

14.11 Configuring MSTP Interoperability Between


Huawei and Non-Huawei Devices

14.11.1 Configuring a Proposal/Agreement Mechanism

Context
The rapid transition mechanism is also called the Proposal/Agreement mechanism. All
switches support the following modes:

l Enhanced mode: The current interface includes the root port calculation when it
computes the synchronization flag bit.
– An upstream device sends a Proposal message to a downstream device, requesting
rapid status transition. After receiving the message, the downstream device sets the
port connected to the upstream device as a root port and blocks all non-edge ports.
– The upstream device then sends an Agreement message to the downstream device.
After the downstream device receives the message, the root port transitions to the
Forwarding state.
– The downstream device responds to the Proposal message with an Agreement
message. After receiving the message, the upstream device sets the port connected
to the downstream device as a designated port, and the designated port transitions to
the Forwarding state.
l Common mode: The current interface ignores the root port when it computes the
synchronization flag bit.
– An upstream device sends a Proposal message to a downstream device, requesting
rapid status transition. After receiving the message, the downstream device sets the
port connected to the upstream device as a root port and blocks all non-edge ports.
The root port then transitions to the Forwarding state.
– The downstream device responds to the Proposal message with an Agreement
message. After receiving the message, the upstream device sets the port connected
to the downstream device as a designated port. The designated port then transitions
to the Forwarding state.

When Huawei devices are connected to non-Huawei devices, select the same mode as that
used on non-Huawei devices.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 697


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 3 Run:
stp no-agreement-check

The common rapid transition mechanism is configured.


By default, the interface uses the enhanced rapid transition mechanism.

----End

14.11.2 Configuring the MSTP Protocol Packet Format on an


Interface

Context
MSTP protocol packets have two formats: dot1s (IEEE 802.1s standard packets) and legacy
(proprietary protocol packets).
You can specify the packet format or use the auto mode. In auto mode, the switch switches the
MSTP protocol packet format based on the received MSTP protocol packet format so that the
switch can communicate with the peer device.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 3 Run:
stp compliance { auto | dot1s | legacy }

The MSTP protocol packet format is configured on the interface.


The auto mode is used by default.

NOTE

The negotiation will fail if the format of MSTP packets is set to dot1s at one end and legacy at the other
end.

----End

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 698


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.11.3 Enabling the Digest Snooping Function


Context
Interconnected Huawei and non-Huawei devices cannot communicate with each other if they
have the same region name, revision number, and VLAN-to-instance mappings but different
BPDU keys. To address this problem, enable the digest snooping function on the Huawei
device.
Perform the following steps on a switch in an MST region to enable the digest snooping
function.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The Ethernet interface view is displayed.


Step 3 Run:
stp config-digest-snoop

The digest snooping function is enabled.

----End

14.11.4 Verifying the Configuration of MSTP Interoperability


Between Huawei and Non-Huawei Devices
Procedure
l Run the display stp [ process process-id ] [ instance instance-id ] [ interface interface-
type interface-number | slot slot-id ] [ brief ] command to view spanning-tree status and
statistics.
----End

14.12 Maintaining MSTP

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 699


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.12.1 Clearing MSTP Statistics


Context

NOTICE
MSTP statistics cannot be restored after being cleared.

Procedure
l Run the reset stp [ interface interface-type interface-number ] statistics command to
clear spanning-tree statistics.
l Run the reset stp error packet statistics to clear the statistics of error STP packets.
----End

14.12.2 Monitoring the Statistics on MSTP Topology Changes


Procedure
l Run the display stp [ process process-id ] [ instance instance-id ] topology-change
command to view the statistics about MSTP topology changes.
In the case of a non-zero process, the stp process process-id command must be used to
create a process before the display stp [ process process-id ] [ instance instance-id ]
topology-change command is used.
l Run the display stp [ process process-id ] [ instance instance-id ] [ interface interface-
type interface-number | slot slot-id ] tc-bpdu statistics command to view the statistics
about TC/TCN packets.
In the case of a non-zero process, the stp process process-id command must be used to
create a process before the display stp [ process process-id ] [ instance instance-id ]
[ interface interface-type interface-number | slot slot-id ] tc-bpdu statistics command is
used.
----End

14.13 Configuration Examples for MSTP

14.13.1 Example for Configuring MSTP


Networking Requirements
To implement redundancy on a complex network, network designers tend to deploy multiple
physical links between two devices, one of which is the master and the others are the backup.
Loops occur, causing broadcast storms or damaging MAC addresses. After the network is
planned, deploy MSTP on the network to prevent loops. MSTP blocks redundant links and
prunes a network into a tree topology free from loops.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 700


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

As shown in Figure 14-18, SwitchA, SwitchB, SwitchC, and SwitchD run MSTP. To load
balance traffic from VLANs 2 to 10 and VLANs 11 to 20, use MSTP multi-instance. You can
configure a VLAN mapping table to associate VLANs with MSTIs.

Figure 14-18 Networking diagram of MSTP configuration

Network

RG1
SwitchA Eth-Trunk1 SwitchB

GE0/0/1 Eth-Trunk1
GE0/0/1

GE0/0/3 GE0/0/3
GE0/0/2
SwitchC SwitchD
GE0/0/2
GE0/0/1 GE0/0/1

VLAN 2~10 MSTI 1


VLAN 11~20 MSTI 2

MSTI 1:

Root Switch:SwitchA
Blocked port

MSTI 2:

Root Switch:SwitchB
Blocked port

Configuration Roadmap
The configuration roadmap is as follows:

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 701


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

1. Configure basic MSTP functions on the switch on the ring network. Because ports
connected to the PCs do not participate in MSTP calculation, configure these ports as
edge ports.
2. Configure protection functions to protect devices or links. You can configure root
protection on the designated port of the root bridge.
NOTE

When the link between the root bridge and secondary root bridge goes Down, the port enabled with root
protection becomes Discarding because root protection takes effect.
To improve the reliability, you are advised to bind the link between the root bridge and secondary root
bridge to an Eth-Trunk.
3. Configure Layer 2 forwarding.

Procedure
Step 1 Configure basic MSTP functions.
1. Configure SwitchA, SwitchB, SwitchC, and SwitchD in the same MST region named
RG1 and create MSTI 1 and MSTI 2.
NOTE

Two switches belong to the same MST region when they have the same:
– Name of the MST region
– Mapping between VLANs and MSTIs
– Revision level of the MST region
# Configure an MST region on SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[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] active region-configuration
[SwitchA-mst-region] quit

# Configure an MST region on SwitchB.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[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] active region-configuration
[SwitchB-mst-region] quit

# Configure an MST region on SwitchC.


<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[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] active region-configuration
[SwitchC-mst-region] quit

# Configure an MST region on SwitchD.


<HUAWEI> system-view
[HUAWEI] sysname SwitchD
[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name RG1

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 702


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchD-mst-region] instance 1 vlan 2 to 10


[SwitchD-mst-region] instance 2 vlan 11 to 20
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit

2. In the MST region RG1, configure the root bridge and secondary root bridge in MSTI 1
and MSTI 2.
– Configure the root bridge and secondary root bridge in MSTI 1.
# Configure SwitchA as the root bridge in MSTI 1.
[SwitchA] stp instance 1 root primary

# Configure SwitchB as the secondary root bridge in MSTI 1.


[SwitchB] stp instance 1 root secondary

– Configure the root bridge and secondary root bridge in MSTI 2.


# Configure SwitchB as the root bridge in MSTI 2.
[SwitchB] stp instance 2 root primary

# Configure SwitchA as the secondary root bridge in MSTI 2.


[SwitchA] stp instance 2 root secondary

3. Set the path costs of the ports to be blocked in MSTI 1 and MSTI 2 to be greater than the
default value.
NOTE

– The path cost values depend on path cost calculation methods. This example uses the Huawei
calculation method as an example to set the path cost to 20000 for the ports to be blocked.
– All switches on a network must use the same path cost calculation method.
# Configure SwitchA to use Huawei calculation method to calculate the path cost.
[SwitchA] stp pathcost-standard legacy

# Configure SwitchB to use Huawei calculation method to calculate the path cost.
[SwitchB] stp pathcost-standard legacy

# Configure SwitchC to use Huawei calculation method to calculate the path cost, and
set the path cost of GE0/0/2 in MSTI 2 to 20000.
[SwitchC] stp pathcost-standard legacy
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] stp instance 2 cost 20000
[SwitchC-GigabitEthernet0/0/2] quit

# Configure SwitchD to use Huawei calculation method to calculate the path cost, and
set the path cost of GE0/0/2 in MSTI 1 to 20000.
[SwitchD] stp pathcost-standard legacy
[SwitchD] interface gigabitethernet 0/0/2
[SwitchD-GigabitEthernet0/0/2] stp instance 1 cost 20000
[SwitchD-GigabitEthernet0/0/2] quit

4. Enable MSTP to eliminate loops.


– Enable MSTP globally.
# Enable MSTP on SwitchA.
[SwitchA] stp enable

# Enable MSTP on SwitchB.


[SwitchB] stp enable

# Enable MSTP on SwitchC.


[SwitchC] stp enable

# Enable MSTP on SwitchD.


[SwitchD] stp enable

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 703


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

– Configure the ports connected to the terminal as edge ports.


# Configure GE0/0/1 of SwitchC as an edge port.
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] stp edged-port enable
[SwitchC-GigabitEthernet0/0/1] quit

(Optional) Configure BPDU protection on SwitchC.


[SwitchC] stp bpdu-protection

# Configure GE0/0/1 of SwitchD as an edge port.


[SwitchD] interface gigabitethernet 0/0/1
[SwitchD-GigabitEthernet0/0/1] stp edged-port enable
[SwitchD-GigabitEthernet0/0/1] quit

(Optional) Configure BPDU protection on SwitchD.


[SwitchD] stp bpdu-protection

NOTE
If edge ports are connected to network devices that have STP enabled and BPDU protection
is enabled, the edge ports will be shut down and their attributes remain unchanged after they
receive BPDUs.

Step 2 Configure root protection on the designated port of the root bridge.
# Enable root protection on GE0/0/1 of SwitchA.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] stp root-protection
[SwitchA-GigabitEthernet0/0/1] quit

# Enable root protection on GE0/0/1 of SwitchB.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] stp root-protection
[SwitchB-GigabitEthernet0/0/1] quit

Step 3 Configure Layer 2 forwarding on devices on the ring network.


l Create VLANs 2 to 20 on SwitchA, SwitchB, SwitchC, and SwitchD.
# Create VLANs 2 to 20 on SwitchA.
[SwitchA] vlan batch 2 to 20

# Create VLANs 2 to 20 on SwitchB.


[SwitchB] vlan batch 2 to 20

# Create VLANs 2 to 20 on SwitchC.


[SwitchC] vlan batch 2 to 20

# Create VLANs 2 to 20 on SwitchD.


[SwitchD] vlan batch 2 to 20

l Add ports on switches to VLANs.


# Add GE0/0/1 on SwitchA to a VLAN.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet0/0/1] quit

# Add Eth-Trunk1 on SwitchA to a VLAN.


[SwitchA] interface Eth-Trunk 1
[SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/2
[SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/3
[SwitchA-Eth-Trunk1] port link-type trunk
[SwitchA-Eth-Trunk1] port trunk allow-pass vlan 2 to 20
[SwitchA-Eth-Trunk1] quit

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 704


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

# Add GE0/0/1 on SwitchB to a VLAN.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 20
[SwitchB-GigabitEthernet0/0/1] quit

# Add Eth-Trunk1 on SwitchB to a VLAN.


[SwitchB] interface Eth-Trunk 1
[SwitchB-Eth-Trunk1] trunkport gigabitethernet 0/0/2
[SwitchB-Eth-Trunk1] trunkport gigabitethernet 0/0/3
[SwitchB-Eth-Trunk1] port link-type trunk
[SwitchB-Eth-Trunk1] port trunk allow-pass vlan 2 to 20
[SwitchB-Eth-Trunk1] quit

# Add GE0/0/1 on SwitchC to a VLAN.


[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type access
[SwitchC-GigabitEthernet0/0/1] port default vlan 2
[SwitchC-GigabitEthernet0/0/1] quit

# Add GE0/0/2 on SwitchC to a VLAN.


[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type trunk
[SwitchC-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet0/0/2] quit

# Add GE0/0/3 on SwitchC to a VLAN.


[SwitchC] interface gigabitethernet 0/0/3
[SwitchC-GigabitEthernet0/0/3] port link-type trunk
[SwitchC-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet0/0/3] quit

# Add GE0/0/1 on SwitchD to a VLAN.


[SwitchD] interface gigabitethernet 0/0/1
[SwitchD-GigabitEthernet0/0/1] port link-type access
[SwitchD-GigabitEthernet0/0/1] port default vlan 11
[SwitchD-GigabitEthernet0/0/1] quit

# Add GE0/0/2 on SwitchD to a VLAN.


[SwitchD] interface gigabitethernet 0/0/2
[SwitchD-GigabitEthernet0/0/2] port link-type trunk
[SwitchD-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet0/0/2] quit

# Add GE0/0/3 on SwitchD to a VLAN.


[SwitchD] interface gigabitethernet 0/0/3
[SwitchD-GigabitEthernet0/0/3] port link-type trunk
[SwitchD-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet0/0/3] quit

Step 4 Verify the configuration.


After the preceding configurations are complete and the network topology becomes stable,
perform the following operations to verify the configuration.

NOTE

MSTI 1 and MSTI 2 are used as examples. You do not need to check the interface status in MSTI 0.

# Run the display stp brief command on SwitchA to view the status and protection mode on
the ports. Output similar to the following is displayed:
[SwitchA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 Eth-Trunk1 DESI FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 705


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

1 Eth-Trunk1 DESI FORWARDING NONE


2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 Eth-Trunk1 ROOT FORWARDING NONE

In MSTI 1, GE0/0/1 and Eth-Trunk1 are designated ports because SwitchA is the root bridge.
In MSTI 2, GE0/0/1 on SwitchA is the designated port and Eth-Trunk1 is the root port.
# Run the display stp brief command on SwitchB. Output similar to the following is
displayed:
[SwitchB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 Eth-Trunk1 ROOT FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 Eth-Trunk1 ROOT FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 Eth-Trunk1 DESI FORWARDING NONE

In MSTI 2, GE0/0/1 and Eth-Trunk1 are designated ports because SwitchB is the root bridge.
In MSTI 1, GE0/0/1 on SwitchB is the designated port and Eth-Trunk1 is the root port.
# Run the display stp interface brief commands on SwitchC. Output similar to the following
is displayed:
[SwitchC] display stp interface gigabitethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ROOT FORWARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE
[SwitchC] display stp interface gigabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/2 ALTE DISCARDING NONE

GE0/0/3 on SwitchC is the root port in MSTI 1 and MSTI 2. GE0/0/2 on SwitchC is the
designated port in MSTI 1 but is blocked in MSTI 2.
# Run the display stp interface brief commands on SwitchD. Output similar to the following
is displayed:
[SwitchD] display stp interface gigabitethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ROOT FORWARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE
[SwitchD] display stp interface gigabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
1 GigabitEthernet0/0/2 ALTE DISCARDING NONE
2 GigabitEthernet0/0/2 DESI FORWARDING NONE

GE0/0/3 on SwitchD is the root port in MSTI 1 and MSTI 2. GE0/0/2 on SwitchD is the
blocked port in MSTI 1 and is the designated port in MSTI 2.

----End

Configuration Files
l SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 20
#

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 706


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

stp instance 1 root primary


stp instance 2 root secondary
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface GigabitEthernet0/0/2
eth-trunk 1
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
return
l SwitchB configuration file
#
sysname SwitchB
#
vlan batch 2 to 20
#
stp instance 1 root secondary
stp instance 2 root primary
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface GigabitEthernet0/0/2
eth-trunk 1
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
return
l SwitchC configuration file
#
sysname SwitchC
#
vlan batch 2 to 20
#
stp bpdu-protection
stp pathcost-standard legacy

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 707


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
stp edged-port enable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 2 cost 20000
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
l SwitchD configuration file
#
sysname SwitchD
#
vlan batch 2 to 20
#
stp bpdu-protection
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 11
stp edged-port enable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 1 cost 20000
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return

14.13.2 Example for Configuring MSTP + VRRP Network


Networking Requirements
NOTE

Only the S5320SI, S5320EI, S5320HI, S5330SI, S6320SI, and S6320EI and support this example.

In Figure 14-19, hosts connect to Switch C, and Switch C connects to the Internet through
Switch A and Switch B. To improve access reliability, the user configures redundant links.
The redundant links cause a network loop, which leads to broadcast storms and MAC address
damaging.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 708


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

It is required that the network loop be prevented when redundant links are deployed, traffic be
switched to another link when one link fails, and network bandwidth be effectively used.

MSTP can be configured on the network to prevent loops. MSTP blocks redundant links and
prunes a network into a tree topology free from loops. In addition, VRRP needs to be
configured on Switch A and Switch B. Host A connects to the Internet by using Switch A as
the default gateway and Switch B as the secondary gateway. Host B connects to the Internet
by using Switch B as the default gateway and Switch A as the secondary gateway. This allows
traffic to be load balanced and communication reliability improved.

Figure 14-19 MSTP + VRRP network

VRRP VRID 1 SwitchA


Virtual IP Address: VRID 1:Master
HostA 10.1.2.100 VRID 2:Backup
VLAN2 /1
10.1.2.101/24 E0/0 GE
0/0
G /3 RouterA
GE

GE0/0/2
0/0 1
/2 0 /0/
GE
SwitchC MSTP
GE0/0/2 Internet
GE
3
0/0/SwitchC 0/0/4
G E
HostB GE RouterB
0/0 /0/3
VLAN3 /1 GE0
10.1.3.101/24 SwitchB
VRID 1:Backup
VRRP VRID 2 VRID 2:Master
Virtual IP Address:
10.1.3.100

VLAN2 MSTI1 VLAN3 MSTI2

MSTI1: MSTI2:

Root Switch:SwitchA Root Switch:SwitchB


Blocked port Blocked port

Device Interface VLANIF Interface IP Address

SwitchA GE0/0/1 and VLANIF 2 10.1.2.102/24


GE0/0/2

GE0/0/1 and VLANIF 3 10.1.3.102/24


GE0/0/2

GE0/0/3 VLANIF 4 10.1.4.102/24

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 709


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Device Interface VLANIF Interface IP Address

SwitchB GE0/0/1 and VLANIF 2 10.1.2.103/24


GE0/0/2

GE0/0/1 and VLANIF 3 10.1.3.103/24


GE0/0/2

GE0/0/3 VLANIF 5 10.1.5.103/24

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic MSTP on the switches, including:
a. Configure MST and create multi-instance, map VLAN 2 to MSTI 1, and map
VLAN 3 to MSTI 2 to load balance traffic.
b. Configure the root bridge and backup bridge in the MST region.
c. Configure the path cost on an interface so that the interface can be blocked.
d. Enable MSTP to prevent loops:
n Enable MSTP globally.
n Enable MSTP on all interfaces except the interfaces connecting to hosts.
NOTE

Because the interfaces connecting to hosts do not participate in MSTP calculation, configure
these ports as edge ports.
2. Enable the protection function to protect devices or links. For example, enable the
protection function on the root bridge of each instance to protect roots.
3. Configure Layer 2 forwarding.
4. Assign an IP address to each interface and configure the routing protocol on each device
to ensure network connectivity.
NOTE
SwitchA and SwitchB must support VRRP and OSPF. For details about models supporting VRRP
and OSPF, see relevant documentation.
5. Create VRRP group 1 and VRRP group 2 on Switch A and Switch B. Configure Switch
A as the master device and Switch B as the backup device of VRRP group 1. Configure
Switch B as the master device and Switch A as the backup device of VRRP group 2.

Procedure
Step 1 Configure basic MSTP functions.
1. Add Switch A, Switch B, and Switch C to region RG1, and create instances MSTI 1 and
MSTI 2.
# Configure an MST region on Switch A.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 710


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchA-mst-region] instance 2 vlan 3


[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit

# Configure an MST region on Switch B.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2
[SwitchB-mst-region] instance 2 vlan 3
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit

# Configure an MST region on Switch C.


<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 2
[SwitchC-mst-region] instance 2 vlan 3
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit

2. Configure the root bridges and backup bridges for MSTI 1 and MSTI 2 in RG1.
– Configure the root bridge and backup bridge for MSTI 1.
# Set Switch A as the root bridge of MSTI 1.
[SwitchA] stp instance 1 root primary

# Set Switch B as the backup bridge of MSTI 1.


[SwitchB] stp instance 1 root secondary

– Configure the root bridge and backup bridge for MSTI 2.


# Set Switch B as the root bridge of MSTI 2.
[SwitchB] stp instance 2 root primary

# Set Switch A as the backup bridge of MSTI 2.


[SwitchA] stp instance 2 root secondary

3. Set the path costs of the interfaces that you want to block on MSTI 1 and MSTI 2 to be
greater than the default value.
NOTE

– The path cost range is determined by the calculation method. The Huawei calculation method
is used as an example. Set the path costs of the interfaces to 20000.
– The switches on the same network must use the same calculation method to calculate path
costs.
# Set the path cost calculation method on Switch A to Huawei calculation method.
[SwitchA] stp pathcost-standard legacy

# Set the path cost calculation method on Switch B to Huawei calculation method.
[SwitchB] stp pathcost-standard legacy

# Set the path cost calculation method on Switch C to Huawei calculation method. Set
the path cost of GE0/0/1 in MSTI 2 to 20000; set the path cost of GE0/0/4 in MSTI 1 to
20000.
[SwitchC] stp pathcost-standard legacy
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] stp instance 2 cost 20000
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchC] interface gigabitethernet 0/0/4
[SwitchC-GigabitEthernet0/0/4] stp instance 1 cost 20000
[SwitchC-GigabitEthernet0/0/4] quit

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 711


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

4. Enable MSTP to prevent loops.


– Enable MSTP globally.
# Enable MSTP on Switch A.
[SwitchA] stp enable

# Enable MSTP on Switch B.


[SwitchB] stp enable

# Enable MSTP on Switch C.


[SwitchC] stp enable

– Configure the ports connected to hosts as edge ports.


# Configure GE0/0/2 and GE0/0/3 of Switch C as an edge port.
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] stp edged-port enable
[SwitchC-GigabitEthernet0/0/2] quit
[SwitchC] interface gigabitethernet 0/0/3
[SwitchC-GigabitEthernet0/0/3] stp edged-port enable
[SwitchC-GigabitEthernet0/0/3] quit

(Optional) Configure BPDU protection on SwitchC.


[SwitchC] stp bpdu-protection

– Configure the ports connected to Router as edge ports.


# Configure GE0/0/3 of Switch A as an edge port.
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] stp edged-port enable
[SwitchA-GigabitEthernet0/0/3] quit

(Optional) Configure BPDU protection on SwitchA.


[SwitchA] stp bpdu-protection

# Disable STP on GE0/0/3 of Switch B as an edge port.


[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] stp edged-port enable
[SwitchB-GigabitEthernet0/0/3] quit

(Optional) Configure BPDU protection on SwitchB.


[SwitchB] stp bpdu-protection

NOTE
If edge ports are connected to network devices that have STP enabled and BPDU protection
is enabled, the edge ports will be shut down and their attributes remain unchanged after they
receive BPDUs.

Step 2 Enable the protection function on the designated interfaces of each root bridge.
# Enable root protection on GE0/0/1 of Switch A.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] stp root-protection
[SwitchA-GigabitEthernet0/0/1] quit

# Enable root protection on GE0/0/1 of Switch B.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] stp root-protection
[SwitchB-GigabitEthernet0/0/1] quit

Step 3 Configure Layer 2 forwarding on the switches in the ring.


l Create VLANs 2 and 3 on Switch A, Switch B, and Switch C.
# Create VLANs 2 and 3 on Switch A.
[SwitchA] vlan batch 2 to 3

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 712


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

# Create VLANs 2 and 3 on Switch B.


[SwitchB] vlan batch 2 to 3

# Create VLANs 2 and 3 on Switch C.


[SwitchC] vlan batch 2 to 3

l Add the interfaces connecting to the loops to VLANs.


# Add GE0/0/1 of Switch A to VLANs.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 3
[SwitchA-GigabitEthernet0/0/1] quit

# Add GE0/0/2 of Switch A to VLANs.


[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 3
[SwitchA-GigabitEthernet0/0/2] quit

# Add GE0/0/1 of Switch B to VLANs.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 3
[SwitchB-GigabitEthernet0/0/1] quit

# Add GE0/0/2 of Switch B to VLANs.


[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 3
[SwitchB-GigabitEthernet0/0/2] quit

# Add GE0/0/1 of Switch C to VLANs.


[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type trunk
[SwitchC-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 3
[SwitchC-GigabitEthernet0/0/1] quit

# Add GE0/0/2 of Switch C to VLAN 2.


[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type access
[SwitchC-GigabitEthernet0/0/2] port default vlan 2
[SwitchC-GigabitEthernet0/0/2] quit

# Add GE0/0/3 of Switch C to VLAN 3.


[SwitchC] interface gigabitethernet 0/0/3
[SwitchC-GigabitEthernet0/0/3] port link-type access
[SwitchC-GigabitEthernet0/0/3] port default vlan 3
[SwitchC-GigabitEthernet0/0/3] quit

# Add GE0/0/4 of Switch C to VLANs.


[SwitchC] interface gigabitethernet 0/0/4
[SwitchC-GigabitEthernet0/0/4] port link-type trunk
[SwitchC-GigabitEthernet0/0/4] port trunk allow-pass vlan 2 to 3
[SwitchC-GigabitEthernet0/0/4] quit

Step 4 Verify the configuration.


After the preceding configurations are complete and the network topology becomes stable,
perform the following operations to verify the configuration.

NOTE

MSTI 1 and MSTI 2 are used as examples. You do not need to check the interface status in MSTI 0.

# Run the display stp brief command on Switch A to view the status and protection mode on
ports. Output similar to the following is displayed:

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 713


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchA] display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 ROOT FORWARDING NONE

In MSTI 1, GE0/0/2 and GE0/0/1 of Switch A are set as designated interfaces because Switch
A is the root bridge of MSTI 1. In MSTI 2, GE0/0/1 of Switch A is set as the designated
interface and GE0/0/2 is set as the root interface.

# Run the display stp brief command on Switch B. Output similar to the following is
displayed:
[SwitchB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 ROOT FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 DESI FORWARDING NONE

In MSTI 2, GE0/0/1 and GE0/0/2 of Switch B are set as designated interfaces because Switch
B is the root bridge of MSTI 2. In MSTI 1, GE0/0/1 of Switch B is set as the designated
interface and GE0/0/2 is set as the root interface.

# Run the display stp interface brief command on Switch C. Output similar to the following
is displayed:
[SwitchC] display stp interface gigabitethernet 0/0/1 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
1 GigabitEthernet0/0/1 ROOT FORWARDING NONE
2 GigabitEthernet0/0/1 ALTE DISCARDING NONE
[SwitchC] display stp interface gigabitethernet 0/0/4 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/4 ALTE DISCARDING NONE
1 GigabitEthernet0/0/4 ALTE DISCARDING NONE
2 GigabitEthernet0/0/4 ROOT FORWARDING NONE

GE0/0/1 of Switch C is the root interface of MSTI 1, and is blocked in MSTI 2. GE0/0/4 of
Switch C is the root interface of MSTI 2, and is blocked in MSTI 1.

Step 5 Connect devices.

# Assign an IP address to each interface, for example, the interfaces on SwitchA. The
configuration on SwitchB is similar to the configuration on SwitchA. For details, see the
configuration files.
[SwitchA] vlan batch 4
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 4
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface vlanif 2
[SwitchA-Vlanif2] ip address 10.1.2.102 24
[SwitchA-Vlanif2] quit
[SwitchA] interface vlanif 3
[SwitchA-Vlanif3] ip address 10.1.3.102 24
[SwitchA-Vlanif3] quit
[SwitchA] interface vlanif 4
[SwitchA-Vlanif4] ip address 10.1.4.102 24
[SwitchA-Vlanif4] quit

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 714


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

# Run OSPF on SwitchA, SwitchB, and routers. The configuration on SwitchA is used as an
example. The configuration on SwitchB is similar to the configuration on SwitchA. For
details, see the configuration files.
[SwitchA] ospf 1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit

Step 6 Configure VRRP groups.


# Create VRRP group 1 on SwitchA and SwitchB. Set SwitchA as the master device, priority
to 120, and preemption delay to 20 seconds. Set SwitchB as the backup device and retain the
default priority.
[SwitchA] interface vlanif 2
[SwitchA-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100
[SwitchA-Vlanif2] vrrp vrid 1 priority 120
[SwitchA-Vlanif2] vrrp vrid 1 preempt-mode timer delay 20
[SwitchA-Vlanif2] quit
[SwitchB] interface vlanif 2
[SwitchB-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100
[SwitchB-Vlanif2] quit

# Create VRRP group 2 on SwitchA and SwitchB. Set SwitchB as the master device, priority
to 120, and preemption delay to 20 seconds. Set SwitchA as the backup device and retain the
default priority.
[SwitchB] interface vlanif 3
[SwitchB-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[SwitchB-Vlanif3] vrrp vrid 2 priority 120
[SwitchB-Vlanif3] vrrp vrid 2 preempt-mode timer delay 20
[SwitchB-Vlanif3] quit
[SwitchA] interface vlanif 3
[SwitchA-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[SwitchA-Vlanif3] quit

# Set the virtual IP address 10.1.2.100 of VRRP group 1 as the default gateway of Host A,
and the virtual IP address 10.1.3.100 of VRRP group 2 as the default gateway of Host B.
Step 7 Verify the configuration.
# After completing the preceding configurations, run the display vrrp command on SwitchA.
SwitchA's VRRP status is master in VRRP group 1 and backup in VRRP group 2.
[SwitchA] display vrrp
Vlanif2 | Virtual Router 1
State : Master
Virtual IP : 10.1.2.100
Master IP : 10.1.2.102
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 11:39:18
Last change time : 2012-05-26 11:38:58

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 715


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Vlanif3 | Virtual Router 2


State : Backup
Virtual IP : 10.1.3.100
Master IP : 10.1.3.103
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 11:40:18
Last change time : 2012-05-26 11:48:58

# Run the display vrrp command on SwitchB. SwitchB's VRRP status is backup in VRRP
group 1 and master in VRRP group 2.
[SwitchB] display vrrp
Vlanif2 | Virtual Router 1
State : Backup
Virtual IP : 10.1.2.100
Master IP : 10.1.2.102
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 11:39:18
Last change time : 2012-05-26 11:38:58

Vlanif3 | Virtual Router 2


State : Master
Virtual IP : 10.1.3.100
Master IP : 10.1.3.103
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 11:40:18
Last change time : 2012-05-26 11:48:58

----End

Configuration Files
l SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 4
#

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 716


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

stp bpdu-protection
stp instance 1 root primary
stp instance 2 root secondary
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
#
interface Vlanif2
ip address 10.1.2.102 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.2.100
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
#
interface Vlanif3
ip address 10.1.3.102 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.3.100
#
interface Vlanif4
ip address 10.1.4.102 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp root-protection
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 4
stp edged-port enable
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.4.0 0.0.0.255
#
return
l SwitchB configuration file
#
sysname SwitchB
#
vlan batch 2 to 3 5
#
stp instance 1 root secondary
stp instance 2 root primary
stp bpdu-protection
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
#
interface Vlanif2
ip address 10.1.2.103 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.2.100
#
interface Vlanif3

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 717


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

ip address 10.1.3.103 255.255.255.0


vrrp vrid 2 virtual-ip 10.1.3.100
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 20
#
interface Vlanif5
ip address 10.1.5.103 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp root-protection
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 5
stp edged-port enable
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.5.0 0.0.0.255
#
return

l SwitchC configuration file


#
sysname SwitchC
#
vlan batch 2 to 3
#
stp bpdu-protection
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 2 cost 20000
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 2
stp edged-port enable
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 3
stp edged-port enable
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 1 cost 20000
#
return

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 718


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.13.3 Example for Connecting CEs to the VPLS in Dual-Homing


Mode Through MSTP

Networking Requirements
NOTE

This configuration can be supported only on the S5320EI, S5320HI, and S6320EI.

In Figure 14-20, each CE is dual-homed to PEs. The PEs establish a VPLS full mesh. The
CEs and PEs run MSTP. Generally, traffic is forwarded through the primary link. If the
primary link fails, traffic is switched to the secondary link.

Figure 14-20 Network diagram for connecting CEs to the VPLS in dual-homing mode
1.1.1.1/32 2.2.2.2/32
PE1 PE2
GE0/0/1 GE0/0/1
GE0/0/2 GE0/0/2
GE0/0/1 GE0/0/3 GE0/0/3 GE0/0/1
GE0/0/2 VPLS GE0/0/2
CE1 GE0/0/3 GE0/0/2 CE2
PC1 GE0/0/4 GE0/0/2 GE0/0/3 GE0/0/4 PC2
10.1.1.1/24 GE0/0/1 GE0/0/1 10.1.1.2/24
PE4 PE3
4.4.4.4/32 3.3.3.3/32

Switch Interface VLANIF Interface IP Address

PE1 GigabitEthernet0/0/ GigabitEthernet0/0/ -


1 1.1

GigabitEthernet0/0/ VLANIF 10 172.16.1.1/24


2

GigabitEthernet0/0/ VLANIF 40 172.19.1.2/24


3

Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/ GigabitEthernet0/0/ -


1 1.1

GigabitEthernet0/0/ VLANIF 10 172.16.1.2/24


2

GigabitEthernet0/0/ VLANIF 20 172.17.1.1/24


3

Loopback1 - 2.2.2.2/32

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 719


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Switch Interface VLANIF Interface IP Address

PE3 GigabitEthernet0/0/ GigabitEthernet0/0/ -


1 1.1

GigabitEthernet0/0/ VLANIF 20 172.17.1.2/24


2

GigabitEthernet0/0/ VLANIF 30 172.18.1.1/24


3

Loopback1 - 3.3.3.3/32

PE4 GigabitEthernet0/0/ GigabitEthernet0/0/ -


1 1.1

GigabitEthernet0/0/ VLANIF 30 172.18.1.2/24


2

GigabitEthernet0/0/ VLANIF 40 172.19.1.1/24


3

Loopback1 - 4.4.4.4/32

CE1 GigabitEthernet0/0/ - -
1

GigabitEthernet0/0/ - -
4

GigabitEthernet0/0/ - -
2

CE2 GigabitEthernet0/0/ - -
1

GigabitEthernet0/0/ - -
4

GigabitEthernet0/0/ - -
2

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the routing protocol on the backbone network to implement interworking.
2. Set up a remote LDP session between the PEs.
3. Establish a VPLS full mesh between PEs.
4. Configure MSTP. Configure PE1 and PE2 as the primary roots, and configure PE3 and
PE4 as the secondary roots.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 720


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Procedure
Step 1 Specify the VLANs that device interfaces belong to and set the IP addresses of the
corresponding VLANIF interfaces according to Figure 14-20.
NOTE

l The AC-side and PW-side physical interfaces of a PE cannot be added to the same VLAN;
otherwise, a loop may occur.
l Packets sent from CEs to PEs must contain VLAN tags.

# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 100
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface gigabitethernet 0/0/4
[CE1-GigabitEthernet0/0/4] port link-type trunk
[CE1-GigabitEthernet0/0/4] port trunk allow-pass vlan 100
[CE1-GigabitEthernet0/0/4] quit
[CE1] interface gigabitethernet 0/0/2
[CE1-GigabitEthernet0/0/2] port link-type access
[CE1-GigabitEthernet0/0/2] port default vlan 100
[CE1-GigabitEthernet0/0/2] quit

# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 100
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface gigabitethernet 0/0/4
[CE2-GigabitEthernet0/0/4] port link-type trunk
[CE2-GigabitEthernet0/0/4] port trunk allow-pass vlan 100
[CE2-GigabitEthernet0/0/4] quit
[CE2] interface gigabitethernet 0/0/2
[CE2-GigabitEthernet0/0/2] port link-type access
[CE2-GigabitEthernet0/0/2] port default vlan 100
[CE2-GigabitEthernet0/0/2] quit

# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 10 40
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type trunk
[PE1-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface gigabitethernet 0/0/3
[PE1-GigabitEthernet0/0/3] port link-type trunk
[PE1-GigabitEthernet0/0/3] port trunk allow-pass vlan 40
[PE1-GigabitEthernet0/0/3] quit
[PE1] interface vlanif 10
[PE1-Vlanif10] ip address 172.16.1.1 24
[PE1-Vlanif10] quit
[PE1] interface vlanif 40
[PE1-Vlanif40] ip address 172.19.1.2 24
[PE1-Vlanif40] quit

# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 10 20

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 721


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[PE2] interface gigabitethernet 0/0/2


[PE2-GigabitEthernet0/0/2] port link-type trunk
[PE2-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet 0/0/3
[PE2-GigabitEthernet0/0/3] port link-type trunk
[PE2-GigabitEthernet0/0/3] port trunk allow-pass vlan 20
[PE2-GigabitEthernet0/0/3] quit
[PE2] interface vlanif 10
[PE2-Vlanif10] ip address 172.16.1.2 24
[PE2-Vlanif10] quit
[PE2] interface vlanif 20
[PE2-Vlanif20] ip address 172.17.1.1 24
[PE2-Vlanif20] quit

# Configure PE3.
<HUAWEI> system-view
[HUAWEI] sysname PE3
[PE3] vlan batch 20 30
[PE3] interface gigabitethernet 0/0/2
[PE3-GigabitEthernet0/0/2] port link-type trunk
[PE3-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
[PE3-GigabitEthernet0/0/2] quit
[PE3] interface gigabitethernet 0/0/3
[PE3-GigabitEthernet0/0/3] port link-type trunk
[PE3-GigabitEthernet0/0/3] port trunk allow-pass vlan 30
[PE3-GigabitEthernet0/0/3] quit
[PE3] interface vlanif 20
[PE3-Vlanif20] ip address 172.17.1.2 24
[PE3-Vlanif20] quit
[PE3] interface vlanif 30
[PE3-Vlanif30] ip address 172.18.1.1 24
[PE3-Vlanif30] quit

# Configure PE4.
<HUAWEI> system-view
[HUAWEI] sysname PE4
[PE4] vlan batch 30 40
[PE4] interface gigabitethernet 0/0/2
[PE4-GigabitEthernet0/0/2] port link-type trunk
[PE4-GigabitEthernet0/0/2] port trunk allow-pass vlan 30
[PE4-GigabitEthernet0/0/2] quit
[PE4] interface gigabitethernet 0/0/3
[PE4-GigabitEthernet0/0/3] port link-type trunk
[PE4-GigabitEthernet0/0/3] port trunk allow-pass vlan 40
[PE4-GigabitEthernet0/0/3] quit
[PE4] interface vlanif 30
[PE4-Vlanif30] ip address 172.18.1.2 24
[PE4-Vlanif30] quit
[PE4] interface vlanif 40
[PE4-Vlanif40] ip address 172.19.1.1 24
[PE4-Vlanif40] quit

Step 2 Configure an IGP. In this example, OSPF is used.

When configuring OSPF, advertise 32-bit loopback interface addresses (LSR IDs) of PE1,
PE2, PE3, and PE4.

# Configure PE1.
[PE1] router id 1.1.1.1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 172.19.1.0 0.0.0.255

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 722


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit

# Configure PE2.
[PE2] router id 2.2.2.2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 2.2.2.2 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 172.17.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit

# Configure PE3.
[PE3] router id 3.3.3.3
[PE3] interface loopback 1
[PE3-LoopBack1] ip address 3.3.3.3 32
[PE3-LoopBack1] quit
[PE3] ospf 1
[PE3-ospf-1] area 0
[PE3-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE3-ospf-1-area-0.0.0.0] network 172.17.1.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 172.18.1.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] quit
[PE3-ospf-1] quit

# Configure PE4.
[PE4] router id 4.4.4.4
[PE4] interface loopback 1
[PE4-LoopBack1] ip address 4.4.4.4 32
[PE4-LoopBack1] quit
[PE4] ospf 1
[PE4-ospf-1] area 0
[PE4-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[PE4-ospf-1-area-0.0.0.0] network 172.18.1.0 0.0.0.255
[PE4-ospf-1-area-0.0.0.0] network 172.19.1.0 0.0.0.255
[PE4-ospf-1-area-0.0.0.0] quit
[PE4-ospf-1] quit

# Wait for 40s and run the display ip routing-table command on PE1, PE2, and PE3. Output
similar to the following is displayed (PE1 is used as an example). The output indicates that
the PEs have learned the routes to one another.
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 13

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 172.16.1.2 Vlanif10
3.3.3.3/32 OSPF 10 2 D 172.19.1.1 Vlanif40
OSPF 10 2 D 172.16.1.2 Vlanif10
4.4.4.4/32 OSPF 10 1 D 172.19.1.1 Vlanif40
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.1.0/24 Direct 0 0 D 172.16.1.1 Vlanif10
172.16.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
172.17.1.0/24 OSPF 10 2 D 172.16.1.2 Vlanif10
172.18.1.0/24 OSPF 10 2 D 172.19.1.1 Vlanif40
172.19.1.0/24 Direct 0 0 D 172.19.1.2 Vlanif40
172.19.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif40

Step 3 Configure basic MPLS functions and LDP.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 723


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlanif 10
[PE1-Vlanif10] mpls
[PE1-Vlanif10] mpls ldp
[PE1-Vlanif10] quit
[PE1] interface vlanif 40
[PE1-Vlanif40] mpls
[PE1-Vlanif40] mpls ldp
[PE1-Vlanif40] quit

# Configure PE2.
[PE2] mpls lsr-id 2.2.2.2
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 10
[PE2-Vlanif10] mpls
[PE2-Vlanif10] mpls ldp
[PE2-Vlanif10] quit
[PE2] interface vlanif 20
[PE2-Vlanif20] mpls
[PE2-Vlanif20] mpls ldp
[PE2-Vlanif20] quit

# Configure PE3.
[PE3] mpls lsr-id 3.3.3.3
[PE3] mpls
[PE3-mpls] quit
[PE3] mpls ldp
[PE3-mpls-ldp] quit
[PE3] interface vlanif 20
[PE3-Vlanif20] mpls
[PE3-Vlanif20] mpls ldp
[PE3-Vlanif20] quit
[PE3] interface vlanif 30
[PE3-Vlanif30] mpls
[PE3-Vlanif30] mpls ldp
[PE3-Vlanif30] quit

# Configure PE4.
[PE4] mpls lsr-id 4.4.4.4
[PE4] mpls
[PE4-mpls] quit
[PE4] mpls ldp
[PE4-mpls-ldp] quit
[PE4] interface vlanif 30
[PE4-Vlanif30] mpls
[PE4-Vlanif30] mpls ldp
[PE4-Vlanif30] quit
[PE4] interface vlanif 40
[PE4-Vlanif40] mpls
[PE4-Vlanif40] mpls ldp
[PE4-Vlanif40] quit

Step 4 Create a remote LDP session between PEs.


# Configure PE1.
[PE1] mpls ldp remote-peer 3.3.3.3
[PE1-mpls-ldp-remote-3.3.3.3] remote-ip 3.3.3.3
[PE1-mpls-ldp-remote-3.3.3.3] quit

# Configure PE2.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 724


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[PE2] mpls ldp remote-peer 4.4.4.4


[PE2-mpls-ldp-remote-4.4.4.4] remote-ip 4.4.4.4
[PE2-mpls-ldp-remote-4.4.4.4] quit

# Configure PE3.
[PE3] mpls ldp remote-peer 1.1.1.1
[PE3-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE3-mpls-ldp-remote-1.1.1.1] quit

# Configure PE4.
[PE4] mpls ldp remote-peer 2.2.2.2
[PE4-mpls-ldp-remote-2.2.2.2] remote-ip 2.2.2.2
[PE4-mpls-ldp-remote-2.2.2.2] quit

After the configuration is complete, run the display mpls ldp session command on the PEs.
The command output shows that the status of the remote LDP peer relationship is
Operational, indicating that remote LDP sessions have been set up. The output on PE1 is used
as an example:
[PE1] display mpls ldp session

LDP Session(s) in Public Network


Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:00:00 4/4
3.3.3.3:0 Operational DU Passive 0000:00:00 4/4
4.4.4.4:0 Operational DU Passive 0000:00:00 4/4
------------------------------------------------------------------------------
TOTAL: 3 session(s) Found.

Step 5 Enable MPLS L2VPN on the PEs.

# Configure PE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit

# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit

# Configure PE3.
[PE3] mpls l2vpn
[PE3-l2vpn] quit

# Configure PE4.
[PE4] mpls l2vpn
[PE4-l2vpn] quit

Step 6 Configure a VSI on the PEs.

# Configure PE1.
[PE1] vsi a2 static
[PE1-vsi-a2] pwsignal ldp
[PE1-vsi-a2-ldp] vsi-id 2
[PE1-vsi-a2-ldp] peer 2.2.2.2
[PE1-vsi-a2-ldp] peer 3.3.3.3
[PE1-vsi-a2-ldp] peer 4.4.4.4
[PE1-vsi-a2-ldp] quit
[PE1-vsi-a2] quit

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 725


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] peer 3.3.3.3
[PE2-vsi-a2-ldp] peer 4.4.4.4
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit

Configuration of PE3 and PE4 is similar to configuration of PE1 and PE2.

Step 7 Bind the VSI to interfaces on the PEs.

# Configure PE1.
[PE1] interface gigabitethernet 0/0/1.1
[PE1-GigabitEthernet0/0/1.1] dot1q termination vid 100
[PE1-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE1-GigabitEthernet0/0/1.1] quit

# Configure PE2.
[PE2] interface gigabitethernet 0/0/1.1
[PE2-GigabitEthernet0/0/1.1] dot1q termination vid 100
[PE2-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/1.1] quit

# Configure PE3.
[PE3] interface gigabitethernet 0/0/1.1
[PE3-GigabitEthernet0/0/1.1] dot1q termination vid 100
[PE3-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE3-GigabitEthernet0/0/1.1] quit

# Configure PE4.
[PE4] interface gigabitethernet 0/0/1.1
[PE4-GigabitEthernet0/0/1.1] dot1q termination vid 100
[PE4-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE4-GigabitEthernet0/0/1.1] quit

Step 8 Configure STP.


1. Configure the MST region and activate the region.
# Configure PE1.
[PE1] stp region-configuration
[PE1-mst-region] region-name RG1
[PE1-mst-region] active region-configuration
[PE1-mst-region] quit

# Configure PE4.
[PE4] stp region-configuration
[PE4-mst-region] region-name RG1
[PE4-mst-region] active region-configuration
[PE4-mst-region] quit

# Configure CE1.
[CE1] stp region-configuration
[CE1-mst-region] region-name RG1
[CE1-mst-region] active region-configuration
[CE1-mst-region] quit

# Configure PE2.
[PE2] stp region-configuration
[PE2-mst-region] region-name RG1

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 726


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[PE2-mst-region] active region-configuration


[PE2-mst-region] quit

# Configure PE3.
[PE3] stp region-configuration
[PE3-mst-region] region-name RG1
[PE3-mst-region] active region-configuration
[PE3-mst-region] quit

# Configure CE2.
[CE2] stp region-configuration
[CE2-mst-region] region-name RG1
[CE2-mst-region] active region-configuration
[CE2-mst-region] quit

2. Configure the priorities of the PEs to make PE1 and PE2 the primary roots and PE3 and
PE4 the secondary roots.
# Configure PE1.
[PE1] stp instance 0 priority 0

# Configure PE2.
[PE2] stp instance 0 priority 0

# Configure PE3.
[PE3] stp instance 0 priority 4096

# Configure PE4.
[PE4] stp instance 0 priority 4096

3. Enable association between MSTP and VPLS on the CEs and PEs, and configure root
protection on the secondary roots.
# Configure CE1.
[CE1] stp enable
[CE1] interface gigabitethernet 0/0/4
[CE1-GigabitEthernet0/0/4] stp enable
[CE1-GigabitEthernet0/0/4] quit
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] stp enable
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface gigabitethernet 0/0/2
[CE1-GigabitEthernet0/0/2] stp edged-port enable
[CE1-GigabitEthernet0/0/2] stp bpdu-filter enable
[CE1-GigabitEthernet0/0/2] quit

# Configure CE2.
[CE2] stp enable
[CE2] interface gigabitethernet 0/0/4
[CE2-GigabitEthernet0/0/4] stp enable
[CE2-GigabitEthernet0/0/4] quit
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] stp enable
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface gigabitethernet 0/0/2
[CE2-GigabitEthernet0/0/2] stp edged-port enable
[CE2-GigabitEthernet0/0/2] stp bpdu-filter enable
[CE2-GigabitEthernet0/0/2] quit

# Configure PE1.
[PE1] stp enable
[PE1] interface gigabitethernet 0/0/1
[PE1-GigabitEthernet0/0/1] stp vpls-subinterface enable
[PE1-GigabitEthernet0/0/1] stp enable
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] stp disable
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface gigabitethernet 0/0/3

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 727


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[PE1-GigabitEthernet0/0/3] stp disable


[PE1-GigabitEthernet0/0/3] quit

# Configure PE2.
[PE2] stp enable
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] stp vpls-subinterface enable
[PE2-GigabitEthernet0/0/1] stp enable
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface gigabitethernet 0/0/2
[PE2-GigabitEthernet0/0/2] stp disable
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet 0/0/3
[PE2-GigabitEthernet0/0/3] stp disable
[PE2-GigabitEthernet0/0/3] quit

# Configure PE3.
[PE3] stp enable
[PE3] interface gigabitethernet 0/0/1
[PE3-GigabitEthernet0/0/1] stp vpls-subinterface enable
[PE3-GigabitEthernet0/0/1] stp root-protection
[PE3-GigabitEthernet0/0/1] stp enable
[PE3-GigabitEthernet0/0/1] quit
[PE3] interface gigabitethernet 0/0/2
[PE3-GigabitEthernet0/0/2] stp disable
[PE3-GigabitEthernet0/0/2] quit
[PE3] interface gigabitethernet 0/0/3
[PE3-GigabitEthernet0/0/3] stp disable
[PE3-GigabitEthernet0/0/3] quit

# Configure PE4.
[PE4] stp enable
[PE4] interface gigabitethernet 0/0/1
[PE4-GigabitEthernet0/0/1] stp vpls-subinterface enable
[PE4-GigabitEthernet0/0/1] stp root-protection
[PE4-GigabitEthernet0/0/1] stp enable
[PE4-GigabitEthernet0/0/1] quit
[PE4] interface gigabitethernet 0/0/2
[PE4-GigabitEthernet0/0/2] stp disable
[PE4-GigabitEthernet0/0/2] quit
[PE4] interface gigabitethernet 0/0/3
[PE4-GigabitEthernet0/0/3] stp disable
[PE4-GigabitEthernet0/0/3] quit

Step 9 Verify the configuration.


Run the display vsi name a2 verbose command on PE1. The command output shows that the
VSI state is Up.
[PE1] display vsi name a2 verbose

***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index : 0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 20 hours, 29 minutes, 54 seconds
VSI State : up

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 728


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

VSI ID : 2
*Peer Router ID : 2.2.2.2
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 4099
Peer Type : dynamic
Session : up
Tunnel ID : 0xd
Broadcast Tunnel ID : 0xd
Broad BackupTunnel ID : 0x0
CKey : 2
NKey : 1
Stp Enable : 0
PwIndex : 0
Control Word : disable
*Peer Router ID : 3.3.3.3
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 4100
Peer Type : dynamic
Session : up
Tunnel ID : 0xf
Broadcast Tunnel ID : 0xf
Broad BackupTunnel ID : 0x0
CKey : 4
NKey : 3
Stp Enable : 0
PwIndex : 0
Control Word : disable
*Peer Router ID : 4.4.4.4
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 4101
Peer Type : dynamic
Session : up
Tunnel ID : 0xb
Broadcast Tunnel ID : 0xb
Broad BackupTunnel ID : 0x0
CKey : 6
NKey : 5
Stp Enable : 0
PwIndex : 0
Control Word : disable

Interface Name : GigabitEthernet0/0/1.1


State : up
Access Port : false
Last Up Time : 2015/03/16 15:56:44
Total Up Time : 0 days, 0 hours, 1 minutes, 24 seconds

**PW Information:

*Peer Ip Address : 3.3.3.3


PW State : up
Local VC Label : 4100
Remote VC Label : 4099
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping bfd
Remote VCCV : alert lsp-ping bfd
Tunnel ID : 0xf
Broadcast Tunnel ID : 0xf
Broad BackupTunnel ID : 0x0
Ckey : 0x4
Nkey : 0x3
Main PW Token : 0xf

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 729


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

Slave PW Token : 0x0


Tnl Type : LSP
OutInterface : Vlanif10
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2015/03/16 15:56:48
PW Total Up Time : 0 days, 0 hours, 1 minutes, 24 seconds
*Peer Ip Address : 4.4.4.4
PW State : up
Local VC Label : 4101
Remote VC Label : 4099
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping bfd
Remote VCCV : alert lsp-ping bfd
Tunnel ID : 0xb
Broadcast Tunnel ID : 0xb
Broad BackupTunnel ID : 0x0
Ckey : 0x6
Nkey : 0x5
Main PW Token : 0xb
Slave PW Token : 0x0
Tnl Type : LSP
OutInterface : Vlanif40
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2015/03/16 15:56:49
PW Total Up Time : 0 days, 0 hours, 1 minutes, 24 seconds
*Peer Ip Address : 2.2.2.2
PW State : up
Local VC Label : 4099
Remote VC Label : 4099
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping bfd
Remote VCCV : alert lsp-ping bfd
Tunnel ID : 0xd
Broadcast Tunnel ID : 0xd
Broad BackupTunnel ID : 0x0
Ckey : 0x2
Nkey : 0x1
Main PW Token : 0xd
Slave PW Token : 0x0
Tnl Type : LSP
OutInterface : Vlanif10
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2015/03/16 15:57:06
PW Total Up Time : 0 days, 0 hours, 1 minutes, 24 seconds

PC1 (10.1.1.1) can ping PC2 (10.1.1.2).


If the link between CE1 and PE1 fails or PE1 is faulty, PE4 becomes the primary root. In this
case, PC1 and PE2 can still ping each other.

----End

Configuration Files
l CE1 configuration file
#
sysname CE1
#
vlan batch 100
#
stp enable
#
stp region-

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 730


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

configuration
region-name
RG1
active region-
configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type
access
port default vlan 100
stp bpdu-filter
enable

stp edged-port enable


#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 100
#
return
l CE2 configuration file
#
sysname CE2
#
vlan batch 100
#
stp enable
#
stp region-
configuration
region-name
RG1
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type
access
port default vlan 100
stp bpdu-filter
enable

stp edged-port enable


#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 100
#
return
l PE1 configuration file
#
sysname PE1
#
router id 1.1.1.1
#
vlan batch 10 40
#
stp instance 0 priority 0
stp enable
#
stp region-

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 731


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

configuration
region-name
RG1
active region-
configuration
#
mpls lsr-id 1.1.1.1
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 2.2.2.2
peer 3.3.3.3
peer 4.4.4.4
#
mpls ldp
#
mpls ldp remote-peer 3.3.3.3
remote-ip 3.3.3.3
#
interface Vlanif10
ip address 172.16.1.1 255.255.255.0
mpls
mpls ldp
#
interface Vlanif40
ip address 172.19.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
stp vpls-subinterface enable
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 100
l2 binding vsi a2
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
stp disable
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 40
stp disable
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 172.16.1.0 0.0.0.255
network 172.19.1.0 0.0.0.255
#
return
l PE2 configuration file
#
sysname PE2
#
router id 2.2.2.2
#
vlan batch 10 20
#
stp instance 0 priority 0

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 732


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

stp enable
#
stp region-
configuration
region-name
RG1
active region-
configuration
#
mpls lsr-id 2.2.2.2
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.1
peer 3.3.3.3
peer 4.4.4.4
#
mpls ldp
#
mpls ldp remote-peer 4.4.4.4
remote-ip 4.4.4.4
#
interface Vlanif10
ip address 172.16.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif20
ip address 172.17.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
stp vpls-subinterface enable
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 100
l2 binding vsi a2
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
stp disable
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20
stp disable
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 172.16.1.0 0.0.0.255
network 172.17.1.0 0.0.0.255
#
return
l PE3 configuration file
#
sysname PE3
#
router id 3.3.3.3
#

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 733


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

vlan batch 20 30
#
stp instance 0 priority 4096
stp enable
#
stp region-
configuration
region-name
RG1
active region-
configuration
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.1
peer 2.2.2.2
peer 4.4.4.4
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.1
remote-ip 1.1.1.1
#
interface Vlanif20
ip address 172.17.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 172.18.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
stp root-protection
stp vpls-subinterface enable
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 100
l2 binding vsi a2
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
stp disable
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 30
stp disable
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 172.17.1.0 0.0.0.255
network 172.18.1.0 0.0.0.255
#
return

l PE4 configuration file

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 734


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

#
sysname PE4
#
router id 4.4.4.4
#
vlan batch 30 40
#
stp instance 0 priority 4096
stp enable
#
stp region-
configuration
region-name
RG1
active region-
configuration
#
mpls lsr-id 4.4.4.4
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.1
peer 2.2.2.2
peer 3.3.3.3
#
mpls ldp
#
mpls ldp remote-peer 2.2.2.2
remote-ip 2.2.2.2
#
interface Vlanif30
ip address 172.18.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif40
ip address 172.19.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
stp root-protection
stp vpls-subinterface enable
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 100
l2 binding vsi a2
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 30
stp disable
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 40
stp disable
#
interface LoopBack1
ip address 4.4.4.4 255.255.255.255
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 172.18.1.0 0.0.0.255

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 735


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

network 172.19.1.0 0.0.0.255


#
return

14.13.4 Example for Configuring MSTP Multi-Process for Layer 2


Single-Access Rings and Layer 2 Multi-Access Rings
Networking Requirements
On a network deployed with both Layer 2 single-access rings and multi-access rings, switches
transmit both Layer 2 and Layer 3 services. To enable different rings to transmit different
services, configure MSTP multi-process. Spanning trees of different processes are calculated
independently.
In Figure 14-21, both Layer 2 single-access rings and dual-access rings are deployed and
switches A and B carry both Layer 2 and Layer 3 services. Switches A and B connected to
dual-access rings are also connected to a single-access ring.

NOTE
In the ring where MSTP multi-process is configured, you are advised not to block the interface directly
connected to the root protection-enabled designated port.

Figure 14-21 MSTP multi-process for Layer 2 single-access rings and multi-access rings

Network

SwitchC
GE0/0/5 GE0/0/5
Region name:RG1
PE2
PE1 SwitchB
SwitchA
CE CE
GE0/0/4 GE0/0/1 GE0/0/4
GE0/0/1
GE0/0/3 GE0/0/3
GE0/0/2 GE0/0/2
CE
CE
Instance1:VLAN2~100 Instance3:VLAN201~300
Process 1
Process 3
CE CE

Instance2:VLAN101~200
Process 2

Configuration Roadmap
The configuration roadmap is as follows:

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 736


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

1. Configure basic MSTP functions, add a device to an MST region, and create MSTIs.
NOTE

l Each ring can belong to only one region.


l Each CE can join only one ring.
2. Configure multiple MSTP processes:
a. Create multiple MSTP processes and add interfaces to these processes.
b. Configure a shared link.
3. Configure MSTP protection functions:
– Configure priorities of MSTP processes and enable root protection.
– Configure shared link protection.
4. Configure the Layer 2 forwarding function on devices.

Procedure
Step 1 Configure basic MSTP functions, add devices to an MST region, and create MSTIs.
1. Configure MST regions and create MSTIs.
# Configure an MST region and create MSTIs on SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2 to 100
[SwitchA-mst-region] instance 2 vlan 101 to 200
[SwitchA-mst-region] instance 3 vlan 201 to 300
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit

# Configure an MST region and create MSTIs on SwitchB.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2 to 100
[SwitchB-mst-region] instance 2 vlan 101 to 200
[SwitchB-mst-region] instance 3 vlan 201 to 300
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit

2. Enable MSTP.
# Configure SwitchA.
[SwitchA] stp enable

# Configure SwitchB.
[SwitchB] stp enable

Step 2 Configure multiple MSTP processes.


1. Create multiple MSTP processes and add interfaces to these processes.
# Create MSTP processes 1 and 2 on SwitchA.
[SwitchA] stp process 1
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] quit

# Create MSTP processes 2 and 3 on SwitchB.


[SwitchB] stp process 2

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 737


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchB-mst-process-2] quit
[SwitchB] stp process 3
[SwitchB-mst-process-3] quit

# Add GE 0/0/3 and GE 0/0/4 on SwitchA to MSTP process 1 and GE 0/0/2 to MSTP
process 2.
[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] stp enable
[SwitchA-GigabitEthernet0/0/4] bpdu enable
[SwitchA-GigabitEthernet0/0/4] stp binding process 1
[SwitchA-GigabitEthernet0/0/4] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] stp enable
[SwitchA-GigabitEthernet0/0/3] bpdu enable
[SwitchA-GigabitEthernet0/0/3] stp binding process 1
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] stp enable
[SwitchA-GigabitEthernet0/0/2] bpdu enable
[SwitchA-GigabitEthernet0/0/2] stp binding process 2
[SwitchA-GigabitEthernet0/0/2] quit

# Add GE 0/0/3 and GE 0/0/4 on SwitchB to MSTP process 3 and GE 0/0/2 to MSTP
process 2.
[SwitchB] interface gigabitethernet 0/0/4
[SwitchB-GigabitEthernet0/0/4] stp enable
[SwitchB-GigabitEthernet0/0/4] bpdu enable
[SwitchB-GigabitEthernet0/0/4] stp binding process 3
[SwitchB-GigabitEthernet0/0/4] quit
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] stp enable
[SwitchB-GigabitEthernet0/0/3] bpdu enable
[SwitchB-GigabitEthernet0/0/3] stp binding process 3
[SwitchB-GigabitEthernet0/0/3] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] stp enable
[SwitchB-GigabitEthernet0/0/2] bpdu enable
[SwitchB-GigabitEthernet0/0/2] stp binding process 2
[SwitchB-GigabitEthernet0/0/2] quit

2. Configure a shared link.


# Configure SwitchA.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] stp enable
[SwitchA-GigabitEthernet0/0/1] bpdu enable
[SwitchA-GigabitEthernet0/0/1] stp binding process 2 link-share
[SwitchA-GigabitEthernet0/0/1] quit

# Configure SwitchB.
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] stp enable
[SwitchB-GigabitEthernet0/0/1] bpdu enable
[SwitchB-GigabitEthernet0/0/1] stp binding process 2 link-share
[SwitchB-GigabitEthernet0/0/1] quit

3. Enable the MSTP function in MSTP multi-process.


# Configure SwitchA.
[SwitchA] stp process 1
[SwitchA-mst-process-1] stp enable
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp enable
[SwitchA-mst-process-2] quit

# Configure SwitchB.
[SwitchB] stp process 3
[SwitchB-mst-process-3] stp enable

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 738


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchB-mst-process-3] quit
[SwitchB] stp process 2
[SwitchB-mst-process-2] stp enable
[SwitchB-mst-process-2] quit

Step 3 Configure MSTP protection functions.


l Configure priorities of MSTP processes and enable root protection.
# Configure SwitchA.
[SwitchA] stp process 1
[SwitchA-mst-process-1] stp instance 0 root primary
[SwitchA-mst-process-1] stp instance 1 root primary
[SwitchA-mst-process-1] quit
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp instance 0 root primary
[SwitchA-mst-process-2] stp instance 2 root primary
[SwitchA-mst-process-2] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] stp root-protection
[SwitchA-GigabitEthernet0/0/2] quit

# Configure SwitchB.
[SwitchB] stp process 3
[SwitchB-mst-process-3] stp instance 0 root primary
[SwitchB-mst-process-3] stp instance 3 root primary
[SwitchB-mst-process-3] quit
[SwitchB] stp process 2
[SwitchB-mst-process-2] stp instance 0 root secondary
[SwitchB-mst-process-2] stp instance 2 root secondary
[SwitchB-mst-process-2] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] stp root-protection
[SwitchB-GigabitEthernet0/0/2] quit

NOTE

– In each ring, the priority of the MSTP process on the downstream CE must be lower than the
priority of the MSTP process on the switch.
– For switches A and B on the dual-access ring, you are recommended to configure them as the
primary root bridges of different MSTIs.
l Configure shared link protection.
# Configure SwitchA.
[SwitchA] stp process 2
[SwitchA-mst-process-2] stp link-share-protection
[SwitchA-mst-process-2] quit

# Configure SwitchB.
[SwitchB] stp process 2
[SwitchB-mst-process-2] stp link-share-protection
[SwitchB-mst-process-2] quit

Step 4 Create VLANs and add interfaces to VLANs.


# Create VLANs 2 to 200 on SwitchA. Add GE 0/0/3 and GE 0/0/4 to VLANs 2 to 100, and
add GE 0/0/1 and GE 0/0/2 to VLANs 101 to 200.
[SwitchA] vlan batch 2 to 200
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 100
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] port link-type trunk
[SwitchA-GigabitEthernet0/0/4] port trunk allow-pass vlan 2 to 100
[SwitchA-GigabitEthernet0/0/4] quit
[SwitchA] interface gigabitethernet 0/0/1

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 739


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

[SwitchA-GigabitEthernet0/0/1] port link-type trunk


[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 101 to 200
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 101 to 200
[SwitchA-GigabitEthernet0/0/2] quit

# Create VLANs 101 to 300 on SwitchB. Add GE 0/0/3 and GE 0/0/4 to VLANs 201 to 300,
and add GE 0/0/1 and GE 0/0/2 to VLANs 101 to 200.
[SwitchB] vlan batch 101 to 300
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] port link-type trunk
[SwitchB-GigabitEthernet0/0/3] port trunk allow-pass vlan 201 to 300
[SwitchB-GigabitEthernet0/0/3] quit
[SwitchB] interface gigabitethernet 0/0/4
[SwitchB-GigabitEthernet0/0/4] port link-type trunk
[SwitchB-GigabitEthernet0/0/4] port trunk allow-pass vlan 201 to 300
[SwitchB-GigabitEthernet0/0/4] quit
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 101 to 200
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 101 to 200
[SwitchB-GigabitEthernet0/0/2] quit

Step 5 Verify the configuration.


l Run the display stp interface brief command on SwitchA.
# GE 0/0/4 is a designated port in the CIST of MSTP process 1 and in MSTI 1.
[SwitchA] display stp process 1 interface giabitethernet 0/0/4 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/4 DESI FORWARDING NONE
1 GigabitEthernet0/0/4 DESI FORWARDING NONE

# GE 0/0/2 is a designated port in the CIST of MSTP process 2 and in MSTI 2.


[SwitchA] display stp process 2 interface giabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 DESI FORWARDING ROOT

l Run the display stp interface brief command on SwitchB.


# GE 0/0/4 is a designated port in the CIST of MSTP process 3 and in MSTI 3.
[SwitchB] display stp process 3 interface giabitethernet 0/0/4 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/4 DESI FORWARDING NONE
3 GigabitEthernet0/0/4 DESI FORWARDING NONE

# GE 0/0/2 is a designated port in the CIST of MSTP process 2 and in MSTI 2.


[SwitchB] display stp process 2 interface giabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 DESI FORWARDING ROOT

----End

Configuration Files
Only the MSTP-related configuration files are provided.
l SwitchA configuration file
#

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 740


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

sysname
SwitchA
#

vlan batch 2 to
300
#
stp enable
#

stp region-
configuration
region-name
RG1
instance 1 vlan 2 to
100
instance 2 vlan 101 to
200
instance 3 vlan 201 to
300
active region-
configuration
#

stp process
1
stp instance 0 root
primary
stp instance 1 root
primary
stp
enable
stp process
2
stp instance 0 root
primary
stp instance 2 root
primary
stp link-share-
protection
stp
enable
#
interface
GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 101 to
200
stp binding process 2 link-share
#

interface
GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 101 to
200
stp binding process
2
stp root-
protection
#

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to
100
stp binding process
1
#

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 741


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to
100
stp binding process 1
#

return
l SwitchB configuration file
#

sysname
SwitchB
#

vlan batch 2 to
300
#
stp enable
#

stp region-
configuration
region-name
RG1
instance 1 vlan 2 to
100
instance 2 vlan 101 to
200
instance 3 vlan 201 to
300
active region-
configuration
#

stp process
2
stp instance 0 root
secondary
stp instance 2 root
secondary
stp link-share-
protection
stp
enable
stp process
3
stp instance 0 root
primary
stp instance 3 root
primary
stp
enable
#

interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 101 to
200
stp binding process 2 link-
share
#

interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 101 to
200
stp binding process

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 742


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

2
stp root-
protection
#

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 201 to
300
stp binding process
3
#

interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 201 to
300
stp binding process
3
#

return

14.14 FAQ About MSTP

14.14.1 Can a Huawei STP Switch Work with a Non-Huawei STP


Device?
Huawei switches use the standard STP protocol. Whether a switch can work with a non-
Huawei STP device depends on the protocol running on the non-Huawei device:
l If the non-Huawei device runs a standard STP protocol, including STP, MSTP, and
RSTP, the Huawei switch can work with it.
l If the non-Huawei device runs a non-standard STP protocol, except for the Cisco Per
VLAN Spanning Tree (PVST) protocol, the Huawei switch can transparently transmit
the STP packets from the device after you run the stp disable and bpdu enable
commands on the interface connected to the non-Huawei device.
l If the non-Huawei device is a Cisco device that runs PVST, the switch cannot negotiate
with the device, but can transparently transmit the packets from the device.

14.14.2 How to Prevent Low Convergence for STP Edge Ports that
Connect Terminals?
Terminal devices cannot participate in the STP calculation or respond to STP packets, causing
low convergence. You can prevent low convergence for STP edge switch ports for connecting
user terminals or servers as follows:
l On a port, run the stp edge-port enable command to configure the port as an STP edge
port, and run the stp bpdu-filter enable command to enable the BPDU packet filtering
function and prevent the port from sending BPDU packets.
l Run the stp disable command on the port to disable the STP protocol and make the port
remain in forwarding state.
To ensure availability and security, you are advised to configure the port as an STP edge port.
This is because when a loop occurs on a terminal device connected to an edge port, the port
automatically switches to a non-edge port and enables the loop breaking function of STP.

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 743


Copyright © Huawei Technologies Co., Ltd.
S2300&S5300&S6320 Series Ethernet Switches
Configuration Guide - Ethernet Switching 14 MSTP Configuration

14.14.3 How Do I Configure a User-Side Interface on an STP


Switch?
Terminal devices cannot participate in the STP calculation or respond to STP packets. You
can configure a user-side interface as follows:

l On a port, run the stp edge-port enable command to configure the port as an STP edge
port, and run the stp bpdu-filter enable command to enable the BPDU packet filtering
function and prevent the port from sending BPDU packets.
l Run the stp disable command on the port to disable the STP protocol and make the port
remain in forwarding state.
To ensure availability and security, you are advised to configure the port as an STP edge port.
This is because when a loop occurs on a terminal device connected to an edge port, the port
automatically switches to a non-edge port and enables the loop breaking function of STP.

14.14.4 How Do I Prevent Terminals' Failures to Ping the Gateway


or Low Speed in Obtaining IP Addresses When They Connect to
an STP Network?
Terminal devices such as servers or network management workstations do not support STP.
However, STP is enabled on switch interfaces by default. An STP interface enters the
Forwarding state 30 seconds after it changes to the Up state. If an interface alternates between
Up and Down states, the terminal connected to the interface will fail to communicate with the
gateway or spends a long time to obtain an IP address.

To solve this problem, configure interfaces connected to terminals as edge ports or disable
STP on the interfaces.

To ensure availability and security, you are advised to configure the port as an STP edge port.
This is because when a loop occurs on a terminal device connected to an edge port, the port
automatically switches to a non-edge port and enables the loop breaking function of STP.

14.15 References for MSTP


The following table lists the references of MSTP.

Document Description

IEEE 802.1D IEEE Standard for:


Local and metropolitan area networks
Virtual Bridged Local Area Networks

IEEE 802.1S IEEE Standard for:


Local and metropolitan area networks
Virtual Bridged Local Area Networks

IEEE 802.1W IEEE Standard for:


Local and metropolitan area networks
Common specifications

Issue 05 (2018-05-14) Huawei Proprietary and Confidential 744


Copyright © Huawei Technologies Co., Ltd.