Module 3 STP and RSTP: Lab 3-1 Configuring STP Learning Objectives
Module 3 STP and RSTP: Lab 3-1 Configuring STP Learning Objectives
Learning Objectives
As a result of this lab section, you should achieve the following tasks:
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
Topology
Scenario
Assume that you are a network administrator of a company. The company network
Tasks
<Quidway>system-view
Enter system view, return user view with Ctrl+Z.
<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
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
Run the display stp interface command to view the STP status of a port.
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……
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
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
<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
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
The highlighted lines in the preceding information indicate that S2 has been restored
and has become the root bridge once again.
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
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
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
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
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
<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
<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
Learning Objectives
As a result of this lab section, you should achieve the following tasks:
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
If you are starting this section with a non-configured device, begin here and then
<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
<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
Remove the configured STP priority from S1 and S2, and assigned cost on S1.
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
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
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
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
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
<S3>display current-configuration
#
!Software Version V100R006C05
sysname S3
#
interface GigabitEthernet0/0/1
shutdown
#
interface GigabitEthernet0/0/13
shutdown
#
<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