0% found this document useful (0 votes)
101 views

Module 3 STP and RSTP: Lab 3-1 Configuring STP Learning Objectives

This document provides instructions for a lab on configuring STP. The tasks include enabling and disabling STP, changing the STP mode, and controlling the root bridge election. Specifically, it involves configuring S2 as the new root bridge by changing the bridge priority values of S1 to 8192 and S2 to 4096, making S2 the root bridge with the lower priority value.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views

Module 3 STP and RSTP: Lab 3-1 Configuring STP Learning Objectives

This document provides instructions for a lab on configuring STP. The tasks include enabling and disabling STP, changing the STP mode, and controlling the root bridge election. Specifically, it involves configuring S2 as the new root bridge by changing the bridge priority values of S1 to 8192 and S2 to 4096, making S2 the root bridge with the lower priority value.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Module 3 STP and RSTP

Lab 3-1 Configuring STP

Learning Objectives

As a result of this lab section, you should achieve the following tasks:

 Enable and disable STP

 Change the STP mode that is used by a switch

 Change the bridge priority to control root bridge election

 Change the port priority to control election of the root port and designated

port

 Change the port cost to control election of the root port and designated

port

 Configure an edge port

Topology

Figure 3.1 STP topology

Scenario

Assume that you are a network administrator of a company. The company network

HUAWEI TECHNOLOGIES Page1


consists of two layers: core layer and access layer. The network uses a design that
supports network redundancy. STP will be used to prevent loops. The STP network
should include setting the bridge priority to control STP root bridge election, and
configuration of features to speed up STP route convergence.

Tasks

Step 1 Configure STP and verify the STP configuration.

Irrelevant interfaces must be disabled to ensure test result accuracy.


Shut down port interfacesGigabitEthernet 0/0/1 on S3,GigabitEthernet 0/0/13 and
Ethernet 0/0/7 on S3; GigabitEthernet 0/0/1, GigabitEthernet 0/0/2, GigabitEthernet
0/0/3, GigabitEthernet 0/0/13, GigabitEthernet 0/0/14 on S1; GigabitEthernet 0/0/1,
GigabitEthernet 0/0/2, GigabitEthernet 0/0/3, GigabitEthernet 0/0/6, GigabitEthernet
0/0/7 on S2; as well as GigabitEthernet 0/0/1, GigabitEthernet 0/0/14 and
GigabitEthernet 0/0/6 on S4 before starting STP configuration. Ensure that the
devices start without any configuration files. If STP is disabled, run the stp enable
command to enable STP.
<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S1
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]shutdown
[S1-GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet 0/0/2
[S1-GigabitEthernet0/0/2]shutdown
[S1-GigabitEthernet0/0/2]quit
[S1]interface GigabitEthernet 0/0/3
[S1-GigabitEthernet0/0/3]shutdown
[S1-GigabitEthernet0/0/3]quit
[S1]interface GigabitEthernet 0/0/13
[S1-GigabitEthernet0/0/13]shutdown
[S1-GigabitEthernet0/0/13]quit
[S1]interface GigabitEthernet 0/0/14
[S1-GigabitEthernet0/0/14]shutdown
[S1-GigabitEthernet0/0/14]quit

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.

HUAWEI TECHNOLOGIES Page2


[Quidway]sysname S2
[S2]interface GigabitEthernet 0/0/1
[S2-GigabitEthernet0/0/1]shutdown
[S2-GigabitEthernet0/0/1]quit
[S2]interface GigabitEthernet 0/0/2
[S2-GigabitEthernet0/0/2]shutdown
[S2-GigabitEthernet0/0/2]quit
[S2]interface GigabitEthernet 0/0/3
[S2-GigabitEthernet0/0/3]shutdown
[S2-GigabitEthernet0/0/3]quit
[S2]interface GigabitEthernet 0/0/6
[S2-GigabitEthernet0/0/6]shutdown
[S2-GigabitEthernet0/0/6]quit
[S2]interface GigabitEthernet 0/0/7
[S2-GigabitEthernet0/0/7]shutdown
[S2-GigabitEthernet0/0/7]quit

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S3
[S3]interface GigabitEthernet 0/0/1
[S3-GigabitEthernet0/0/1]shutdown
[S3-GigabitEthernet0/0/1]quit
[S3]interface GigabitEthernet 0/0/13
[S3-GigabitEthernet0/0/13]shutdown
[S3-GigabitEthernet0/0/13]quit
[S3]interface GigabitEthernet 0/0/7
[S3-GigabitEthernet0/0/7]shutdown

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S4
[S4]inter GigabitEthernet 0/0/1
[S4-GigabitEthernet 0/0/1]shutdown
[S4-GigabitEthernet 0/0/1]quit
[S4]inter GigabitEthernet 0/0/14
[S4-GigabitEthernet 0/0/14]shutdown
[S4-GigabitEthernet 0/0/14]quit
[S4]interface GigabitEthernet 0/0/6
[S4-GigabitEthernet0/0/6]shutdown

In the lab, S1 and S2 are connected through two links, and STP is used. Enable STP

HUAWEI TECHNOLOGIES Page3


on S1 and S2 and set S1 as the root.
[S1]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]stp root primary

[S2]stp mode stp


Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]stp root secondary

Run the display stp brief command to view brief information about STP.
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 DESI FORWARDING NONE
0 GigabitEthernet0/0/10 DESI FORWARDING NONE

<S2>display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE

Run the display stp interface command to view the STP status of a port.

<S1>display stp interface GigabitEthernet 0/0/10


-------[CIST Global Info][Mode STP]-------
CIST Bridge :0 .d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .d0d0-4ba6-aab0 / 0 (This bridge is the root)
CIST RegRoot/IRPC :0 .d0d0-4ba6-aab0 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
CIST Root Type :Primary root
TC or TCN received :11
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 1h:43m:55s
Number of TC :29
Last TC occurred :GigabitEthernet0/0/9

HUAWEI TECHNOLOGIES Page4


----[Port10(GigabitEthernet0/0/10)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.d0d0-4ba6-aab0 / 128.10
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :6 packets/s
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20
TC or TCN send :52
TC or TCN received :0
BPDU Sent :3189
TCN: 0, Config: 3189, RST: 0, MST: 0
BPDU Received :5
TCN: 0, Config: 5, RST: 0, MST: 0
Last forwarding time: 2016/11/21 14:55:11 UTC

<S2>display stp interface GigabitEthernet 0/0/10


-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .d0d0-4ba6-aab0 / 20000
CIST RegRoot/IRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)
BPDU-Protection :Disabled
CIST Root Type :Secondary root
TC or TCN received :122
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 1h:50m:0s
Number of TC :17
Last TC occurred :GigabitEthernet0/0/9
----[Port10(GigabitEthernet0/0/10)][DISCARDING]----

HUAWEI TECHNOLOGIES Page5


Port Protocol :Enabled
Port Role :Alternate Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.d0d0-4ba6-aab0 / 128.10
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :6 packets/s
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
TC or TCN send :0
TC or TCN received :18
BPDU Sent :2
TCN: 0, Config: 2, RST: 0, MST: 0
BPDU Received :3317
TCN: 0, Config: 3317, RST: 0, MST: 0

Step 2Control root bridge election.

Run the display stp command to view information about the root bridge.
<S1>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :0 .d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .d0d0-4ba6-aab0 / 0 (This bridge is the root)
CIST RegRoot/IRPC :0 .d0d0-4ba6-aab0 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
CIST Root Type :Primary root
TC or TCN received :11
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 2h:32m:25s
……output omit……

HUAWEI TECHNOLOGIES Page6


<S2>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .d0d0-4ba6-aab0 / 20000
CIST RegRoot/IRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)
BPDU-Protection :Disabled
CIST Root Type :Secondary root
TC or TCN received :122
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 2h:35m:57s
……output omit……

Configure S2 as the root bridge and S1 as the backup root bridge using priority
values. The device with the same value for the CIST Bridge and CIST Root/ERPC is
the root bridge. A smaller bridge priority value indicates a higher bridge priority.
Change the priorities of S1 and S2 to 8192 and 4096 respectively so that S2 becomes
the root bridge.
[S1]undo stp root
[S1]stp priority 8192

[S2]undo stp root


[S2]stp priority 4096

Run the display stp command to view information about the new root bridge.
<S1>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :8192 .d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 20000
CIST RegRoot/IRPC :8192 .d0d0-4ba6-aab0 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)
BPDU-Protection :Disabled
TC or TCN received :47
TC count per hello :0

HUAWEI TECHNOLOGIES Page7


STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:6m:55s
……output omit……

<S2>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 0 (This bridge is the root)
CIST RegRoot/IRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :135
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:8m:4s
……output omit……

The highlighted lines in the preceding information indicate that S2 has become the
new root bridge.
Shut down interfaces Gigabit Ethernet 0/0/9 and GigabitGigabitEthernet 0/0/10 on
S2 to isolate S2.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]shutdown
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]shutdown

<S1>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :8192 .d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :8192 .d0d0-4ba6-aab0 / 0 (This bridge is the root)
CIST RegRoot/IRPC :8192 .d0d0-4ba6-aab0 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :174

HUAWEI TECHNOLOGIES Page8


TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:12m:51s
……output omit……

The highlighted lines in the preceding information indicate that S1 becomes the root
bridge when S2 is faulty.
Re-enable the interfaces that have been disabled on S2.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo shutdown
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo shutdown

<S1>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :8192 .d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 20000
CIST RegRoot/IRPC :8192 .d0d0-4ba6-aab0 / 0
CIST RootPortId :128.9 (GigabitEthernet0/0/9)
BPDU-Protection :Disabled
TC or TCN received :47
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:6m:55s
……output omit……

<S2>display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 0 (This bridge is the root)
CIST RegRoot/IRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :135

HUAWEI TECHNOLOGIES Page9


TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:8m:4s
……output omit……

The highlighted lines in the preceding information indicate that S2 has been restored
and has become the root bridge once again.

Step 3Control root port election.

Run the display stp brief command on S1 to view the roles of the interfaces.
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE

The preceding information shows that G0/0/9 is the root port and G0/0/10 is the
alternate port. You can change port priorities so that port interface G0/0/10 will
become the root port and G0/0/9 will become the alternate port.
Change priorities of G0/0/9 and G0/0/10 on S2.
The default port priority is 128. A larger port priority value indicates a lower priority.
The priorities of G0/0/9 and G0/0/10 on S2 are set to 32 and 16; therefore, G0/0/10
on S1 becomes the root port.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]stp port priority 32
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]stp port priority 16

Note that the port priorities are changed on S2, not S1.
<S2>display stp interface GigabitEthernet 0/0/9
-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 0 (This bridge is the root)
CIST RegRoot/IRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :0.0

HUAWEI TECHNOLOGIES Page10


BPDU-Protection :Disabled
TC or TCN received :147
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:7m:35s
Number of TC :41
Last TC occurred :GigabitEthernet0/0/10
----[Port34(GigabitEthernet0/0/9)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :32
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.d0d0-4ba6-ac20 / 32.34
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :6 packets/s
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20
TC or TCN send :35
TC or TCN received :2
BPDU Sent :1013
TCN: 0, Config: 1013, RST: 0, MST: 0
BPDU Received :2
TCN: 2, Config: 0, RST: 0, MST: 0
Last forwarding time: 2016/11/22 10:00:00 UTC

<S2>display stp interface GigabitEthernet 0/0/10


-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :4096 .d0d0-4ba6-ac20 / 0 (This bridge is the root)
CIST RegRootIRPC :4096 .d0d0-4ba6-ac20 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :147
TC count per hello :0
STP Converge Mode :Normal

HUAWEI TECHNOLOGIES Page11


Share region-configuration :Enabled
Time since last TC :0 days 0h:8m:19s
Number of TC :41
Last TC occurred :GigabitEthernet0/0/10
----[Port35(GigabitEthernet0/0/10)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :16
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.d0d0-4ba6-ac20 / 16.35
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :6 packets/s
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20
TC or TCN send :35
TC or TCN received :1
BPDU Sent :1032
TCN: 0, Config: 1032, RST: 0, MST: 0
BPDU Received :2
TCN: 1, Config: 1, RST: 0, MST: 0
Last forwarding time: 2016/11/22 10:00:11 UTC

Run the display stp brief command on S1 to view the role of the interfaces.
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE

The highlighted lines in the preceding information indicate that G0/0/10 on S1 has
become the root port and G0/0/9 has become the alternate port.
Shut down G0/0/10 on S1 and view the port roles.
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]shutdown
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE

HUAWEI TECHNOLOGIES Page12


The highlighted line in the preceding information indicates that G0/0/9 has become
the root port. Resume the default priorities of G0/0/9 and G0/0/10 on S2 and re-
enable the shutdown interfaces on S1.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo stp port priority
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo stp port priority

[S1]interface GigabitEthernet 0/0/10


[S1-GigabitEthernet0/0/10]undo shutdown

Run the display stp brief and display stp interface command on S1 to view the
roles of interfaces.
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE

[S1]display stp interface GigabitEthernet 0/0/9


----[CIST][Port9(GigabitEthernet0/0/9)][FORWARDING]----
Port Protocol :Enabled
Port Role :Root Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-cc45-aacc / 128.9
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
TC or TCN send :4
TC or TCN received :90
BPDU Sent :5
TCN: 4, Config: 1, RST: 0, MST: 0
BPDU Received :622
TCN: 0, Config: 622, RST: 0, MST: 0

HUAWEI TECHNOLOGIES Page13


[S1]display stp interface GigabitEthernet 0/0/10
----[CIST][Port10(GigabitEthernet0/0/10)][DISCARDING]----
Port Protocol :Enabled
Port Role :Alternate Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-cc45-aacc / 128.10
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
TC or TCN send :3
TC or TCN received :90
BPDU Sent :4
TCN: 3, Config: 1, RST: 0, MST: 0
BPDU Received :637
TCN: 0, Config: 637, RST: 0, MST: 0

The greyed line in the preceding information indicates that G0/0/9 and G0/0/10
cost is 20000 by default.
Change the cost of G0/0/9 to 200000 on S1.
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]stp cost 200000

Run the display stp brief and display stp interface command on S1 to view the
roles of interfaces.
<S1>display stp interface GigabitEthernet 0/0/9
----[CIST][Port9(GigabitEthernet0/0/9)][DISCARDING]----
Port Protocol :Enabled
Port Role :Alternate Port
Port Priority :128
Port Cost(Dot1T ) :Config=200000 / Active=200000
Designated Bridge/Port :4096.4c1f-cc45-aacc / 128.9
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true

HUAWEI TECHNOLOGIES Page14


Transit Limit :147 packets/hello-time
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s
BPDU Encapsulation :Config=stp / Active=stp
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
TC or TCN send :4
TC or TCN received :108
BPDU Sent :5
TCN: 4, Config: 1, RST: 0, MST: 0
BPDU Received :818
TCN: 0, Config: 818, RST: 0, MST: 0

<S1>display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE

The highlighted lines in the preceding information indicates that G0/0/10 has
become the root port.

Final Configuration

<S1>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S1
#
stp mode stp
stp instance 0 priority 8192
#
interface GigabitEthernet0/0/1
shutdown
#
interface GigabitEthernet0/0/2
shutdown
#
interface GigabitEthernet0/0/3
shutdown
#
interface GigabitEthernet0/0/9
stp instance 0 cost 200000

HUAWEI TECHNOLOGIES Page15


#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/13
shutdown
#
interface GigabitEthernet0/0/14
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

<S2>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S2
#
stp mode stp
stp instance 0 priority 4096
#
interface GigabitEthernet0/0/1
shutdown
#
interface GigabitEthernet0/0/2
shutdown
#
interface GigabitEthernet0/0/3
shutdown
#
interface GigabitEthernet0/0/6
shutdown
#
interface GigabitEthernet0/0/7
shutdown
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
user-interface con 0

HUAWEI TECHNOLOGIES Page16


user-interface vty 0 4
#
return

<S3>display current-configuration
#
!Software Version V100R006C05
sysname S3
#
interface GigabitEthernet0/0/1
shutdown
#
interface GigabitEthernet0/0/13
shutdown
#
interface GigabitEthernet0/0/7
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

<S4>display current-configuration
#
!Software Version V100R006C05
sysname S4
#
interface GigabitEthernet0/0/14
shutdown
#
interface Gigabit
Ethernet0/0/1
shutdown
#
interface GigabitEthernet0/0/6
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

HUAWEI TECHNOLOGIES Page17


HUAWEI TECHNOLOGIES Page18
Lab 3-2 Configuring RSTP

Learning Objectives

As a result of this lab section, you should achieve the following tasks:

 Enable and disable RSTP .

 Configuration of an edge port.

 Configuration of RSTP BPDU protection.

 Configuration of RSTP loop protection

Topology

Figure 3.2 RSTP topology

Scenario

Assume that you are a network administrator of a company. The company network
consists of two layers: core layer and access layer. The network uses a redundancy
design. RSTP will be used to prevent loops. You can configure features to speed up
RSTP route convergence at the edge network and configure RSTP protection
function.

Tasks

Step 1 Preparing the environment

If you are starting this section with a non-configured device, begin here and then

HUAWEI TECHNOLOGIES Page19


move to step 3. For those continuing from previous labs, begin at step 2.
Irrelevant interfaces must be disabled to ensure test result accuracy.
Shut down port interfacesGigabitEthernet 0/0/1 on S3,GigabitEthernet 0/0/13 and
Ethernet 0/0/7 on S3; GigabitEthernet 0/0/1, GigabitEthernet 0/0/2, GigabitEthernet
0/0/3, GigabitEthernet 0/0/13, GigabitEthernet 0/0/14 on S1; GigabitEthernet 0/0/1,
GigabitEthernet 0/0/2, GigabitEthernet 0/0/3, GigabitEthernet 0/0/6, GigabitEthernet
0/0/7 on S2; as well asGigabitEthernet 0/0/1,GigabitEthernet 0/0/14 and
GigabitEthernet 0/0/6 on S4 before starting STP configuration. Ensure that the
devices start without any configuration files. If STP is disabled, run the stp enable
command to enable STP.

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S1
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]shutdown
[S1-GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet 0/0/2
[S1-GigabitEthernet0/0/2]shutdown
[S1-GigabitEthernet0/0/2]quit
[S1]interface GigabitEthernet 0/0/3
[S1-GigabitEthernet0/0/3]shutdown
[S1-GigabitEthernet0/0/3]quit
[S1]interface GigabitEthernet 0/0/13
[S1-GigabitEthernet0/0/13]shutdown
[S1-GigabitEthernet0/0/13]quit
[S1]interface GigabitEthernet 0/0/14
[S1-GigabitEthernet0/0/14]shutdown
[S1-GigabitEthernet0/0/14]quit

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S2
[S2]interface GigabitEthernet 0/0/1
[S2-GigabitEthernet0/0/1]shutdown
[S2-GigabitEthernet0/0/1]quit
[S2]interface GigabitEthernet 0/0/2
[S2-GigabitEthernet0/0/2]shutdown
[S2-GigabitEthernet0/0/2]quit
[S2]interface GigabitEthernet 0/0/3

HUAWEI TECHNOLOGIES Page20


[S2-GigabitEthernet0/0/3]shutdown
[S2-GigabitEthernet0/0/3]quit
[S2]interface GigabitEthernet 0/0/6
[S2-GigabitEthernet0/0/6]shutdown
[S2-GigabitEthernet0/0/6]quit
[S2]interface GigabitEthernet 0/0/7
[S2-GigabitEthernet0/0/7]shutdown
[S2-GigabitEthernet0/0/7]quit

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S3
[S3]interface GigabitEthernet 0/0/1
[S3-GigabitEthernet 0/0/1]shutdown
[S3-GigabitEthernet 0/0/1]quit
[S3]interface GigabitEthernet 0/0/13
[S3-GigabitEthernet 0/0/13]shutdown
[S3-GigabitEthernet 0/0/13]quit
[S3]interface GigabitEthernet 0/0/7
[S3-GigabitEthernet0/0/7]shutdown

<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
[Quidway]sysname S4
[S4]interface GigabitEthernet 0/0/1
[S4-GigabitEthernet 0/0/1]shutdown
[S4-GigabitEthernet 0/0/1]quit
[S4]interface GigabitEthernet 0/0/14
[S4-GigabitEthernet 0/0/14]shutdown
[S4-GigabitEthernet 0/0/14]quit
[S4]interface GigabitEthernet 0/0/6
[S4-GigabitEthernet0/0/6]shutdown

Step 2 Clean up the previous configuration

Remove the configured STP priority from S1 and S2, and assigned cost on S1.

[S1]undo stp priority


[S1]inter GigabitEthernet 0/0/9

HUAWEI TECHNOLOGIES Page21


[S1-GigabitEthernet0/0/9]undo stp cost

[S2]undo stp priority

Step 3 Configure RSTP and verify the RSTP configuration.

Configure S1 and S2 to use RSTP as the spanning tree protocol.


[S1]stp mode rstp

[S2]stp mode rstp

Run the display stp command to view brief information about RSTP.
[S1]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :32768.d0d0-4ba6-aab0
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.d0d0-4ba6-aab0 / 0 (This bridge is the root)
CIST RegRoot/IRPC :32768.d0d0-4ba6-aab0 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :362
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:0m:45s
……output omit……

[S2]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :32768.d0d0-4ba6-ac20
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.d0d0-4ba6-aab0 / 20000
CIST RegRoot/IRPC :32768.d0d0-4ba6-ac20 / 0
CIST RootPortId :128.34 (GigabitEthernet0/0/9)
BPDU-Protection :Disabled
TC or TCN received :186
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled

HUAWEI TECHNOLOGIES Page22


Time since last TC :0 days 0h:3m:55s
……output omit……

Step 4Configure an edge port.

Configure ports connected to the user terminals as edge ports. An edge port can
transition to the forwarding state without participating in the RSTP calculation. In this
example, interface GigabitEthernet 0/0/1 on S1 and S2 connect to a router and can
be configured as edge ports.
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]undo shutdown
[S1-GigabitEthernet0/0/1]stp edged-port enable

[S2]interface GigabitEthernet 0/0/1


[S2-GigabitEthernet0/0/1]undo shutdown
[S2-GigabitEthernet0/0/1]stp edged-port enable

Step 5Configure BPDU protection.

Edge ports are directly connected to user terminal and will not receive BPDUs.
Attackers may send pseudo BPDUs to attack the switching device. If the edge ports
receive the BPDUs, the switching device 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 switching devices against malicious attacks.
Configure BPDU protection on both S1 and S2.
[S1]stp bpdu-protection

[S2]stp bpdu-protection

Run the display stp brief command to view the port protection.
<S1>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/9 DESI FORWARDING NONE
0 GigabitEthernet0/0/10 DESI FORWARDING NONE

<S2>display stp brief


MSTID Port Role STP State Protection

HUAWEI TECHNOLOGIES Page23


0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE

After the configuration is complete, interface GigabitGigabitEthernet 0/0/1 on S1


and S2 shows as supporting BPDU protection.

Step 6Configure Loop protection

On a network running RSTP, a switching device maintains the root port status and
status of alternate ports by receiving BPDUs from an upstream switching device. If
the switching device cannot receive BPDUs from the upstream device because of link
congestion or unidirectional-link failure, the switching device re-selects a root port.
The original root port becomes a designated port and the original discarding ports
change to the Forwarding state. This switching may cause network loops, which can
be mitigated by configuring loop protection.
Configure loop protection on both the root port and the alternate port.
[S2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE

G0/0/9 and G0/0/10 on S2 are now the root port and alternate port. Configure loop
protection on these two ports.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]stp loop-protection
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]stp loop-protection

Run the display stp brief command to view the port protection.
<S2>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/9 ROOT FORWARDING LOOP
0 GigabitEthernet0/0/10 ALTE DISCARDING LOOP

HUAWEI TECHNOLOGIES Page24


Since S1 is root, all the ports are designated ports and therefore do not need to
configure loop protection. After completing the configuration, you may wish to set
S2 as the root, and configure loop protection on the root port and alternate port of
S1 using the same process as with S2.

Final Configuration

<S1>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S1
#
stp mode rstp
stp bpdu-protection
#
interface GigabitEthernet0/0/1
undo shutdown
stp edged-port enable
#
interface GigabitEthernet0/0/2
shutdown
#
interface GigabitEthernet0/0/3
shutdown
#
interface GigabitEthernet0/0/13
shutdown
#
interface GigabitEthernet0/0/14
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

<S2>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S2

HUAWEI TECHNOLOGIES Page25


#
stp mode rstp
stp bpdu-protection
#
interface GigabitEthernet0/0/1
undo shutdown
stp edged-port enable
#
interface GigabitEthernet0/0/2
shutdown
#
interface GigabitEthernet0/0/3
shutdown
#
interface GigabitEthernet0/0/6
shutdown
#
interface GigabitEthernet0/0/7
shutdown
#
interface GigabitEthernet0/0/9
stp loop-protection
#
interface GigabitEthernet0/0/10
stp loop-protection
#
user-interface con 0
user-interface vty 0 4
#
return

<S3>display current-configuration
#
!Software Version V100R006C05
sysname S3
#
interface GigabitEthernet0/0/1
shutdown
#
interface GigabitEthernet0/0/13
shutdown
#

HUAWEI TECHNOLOGIES Page26


interface GigabitEthernet0/0/7
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

<S4>display current-configuration
#
!Software Version V100R006C05
sysname S4
#
interface GigabitEthernet0/0/14
shutdown
#
interface GigabitEthernet0/0/1
shutdown
#

interface GigabitEthernet0/0/6
shutdown
#
user-interface con 0
user-interface vty 0 4
#
return

HUAWEI TECHNOLOGIES Page27


HUAWEI TECHNOLOGIES Page28

You might also like