0% found this document useful (0 votes)
190 views5 pages

4.STP Lab Guide

(1) This document provides a guide for a lab to test Spanning Tree Protocol (STP) on a network topology with four switches. (2) The lab objectives are to understand STP principles, affect the root bridge election, and influence root port selection by changing bridge priority, port cost, and port priority values. (3) The lab guide describes configuration steps to manually set one switch as the root bridge, change port costs to make a specific port the root port, and alter a port priority to modify the root port.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views5 pages

4.STP Lab Guide

(1) This document provides a guide for a lab to test Spanning Tree Protocol (STP) on a network topology with four switches. (2) The lab objectives are to understand STP principles, affect the root bridge election, and influence root port selection by changing bridge priority, port cost, and port priority values. (3) The lab guide describes configuration steps to manually set one switch as the root bridge, change port costs to make a specific port the root port, and alter a port priority to modify the root port.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

STP Lab Guide

1 STP Lab Guide


1.1 Lab Introduction
1.1.1 Background
As shown in Figure 1-1, a customer has four switches connected on the network. Spanning
Tree Protocol (STP) is deployed on the network to prevent loops. As the network administrator
of the company, you need to perform appropriate configurations on the devices to meet different
networking requirements.
1.1.2 Lab Purpose
(1) Understand and master the working principles of STP.
(2) Master the working principles of the bridge priority in STP, and master the way to affect the
root bridge election by changing the bridge priority.
(3) Master the function of the port cost value in STP convergence, and know how to affect the
root port election by changing the port cost value.
(4) Master the function of the port priority in STP convergence, and know how to affect the root
port election by changing the port priority.
(5) Master the commands for displaying the STP status as well as STP application scenarios.
1.1.3 Lab Topology
Figure 1-1 Topology of the STP Lab

1.1.4 Lab Requirements


(1) Manually specify SW1 as the STP root bridge and SW2 as the backup root bridge.
(2) Change the cost values of ports to make port G0/1 of SW4 the root port.
(3) Change the priority of port G0/1 of SW1 to make port G0/1 of SW2 the root port.
1.1.5 Configuration Ideas
(1) Enable STP on SW1, SW2, SW3, and SW4 and switch the STP mode to STP.

1
STP Lab Guide

(2) Manually specify SW1 as the root bridge and SW2 as the backup root bridge.
(3) Change the cost values of ports to make port G0/1 of SW4 the root port.
(4) Configure the priority of port G0/1 of SW1 to make port G0/1 of SW2 the root port.
1.1.6 Procedure
(1) Enable STP on SW1–SW4 and change the STP mode to RSTP. Perform the same
configuration on SW1–SW4. Only the configurations of SW1 are listed below. On an actual
network, if STP is disabled on a device by default, do not start devices at the same time to
prevent loops.
Ruijie-SW1 (config)#spanning-tree
Ruijie-SW1 (config)#spanning-tree mode stp
(2) Change the bridge priorities of SW1 and SW2 to make SW1 the root bridge and SW2 the
backup root bridge.
Analysis: Two parameters are compared in the root bridge election. The two parameters
are the bridge priority and MAC address in the order of priority. A smaller parameter value
indicates a higher priority.
You need to manually specify the device priority to control the root bridge election. Here,
set the priority of SW1 to 4096 and the priority of SW2 to 8192.
Ruijie-SW1(config)#spanning-tree priority 4096
Ruijie-SW2(config)#spanning-tree priority 8192

2
STP Lab Guide

(3) Change the cost value of a port on SW4 to make port Gi0/1 the root port.
Analysis: After the priorities of SW1 and SW2 are changed in step 2, SW1 becomes the root
bridge and SW2 becomes the backup root bridge. On SW4, BPDUs are received by ports G0/0,
G0/1, and G0/2. The root port selection process of SW4 is as follows:
a The device compares the cost values in the three BPDUs (the cost values in the BPDUs
received by ports G0/0 and G0/1 are 40000, and the cost value in the BPDU received by
port G0/2 is 20000).
b The device compares bridge IDs in the three BPDUs. A bridge ID is composed of the
bridge priority and device MAC address, and the bridge priorities are compared first and
then the MAC addresses are compared. A smaller value indicates a higher priority. The
priority in the BPDU received by port G0/0 is 32768, the priority in the BPDU received by
port G0/1 is 8192, and the priority in the BPDU received by port G0/2 is 4096.
c The device compares port IDs in the three BPDUs. A port ID is composed of the port
priority and port ID, and the port priorities are compared first and then port IDs are
compared. A port with a smaller port ID will become the root port.
The figure below shows the status of ports on SW4. Port G0/2 is the root port, port G0/1 is
a backup port, and it is in the blocked state.

Adjust the cost values of ports as required so that the cost value from port G0/1 to the root
bridge is minimum. According to the rules above, adjust the cost value of port G0/2 to be greater
than 40000. Set it to 40001 here. The figure below shows the result after adjustment.
Ruijie-SW4(config)#interface gigabitEthernet 0/2
Ruijie-SW4(config-if-GigabitEthernet 0/2)#spanning-tree cost 40001

3
STP Lab Guide

(4) Change the priority of port G0/1 of SW1 to make G0/1 of SW2 the root port.
Analysis: SW2 receives BPDUs through four ports. According to the root port selection
process described in step 3, we need to focus only on the parameters in the BPDUs received
by ports G0/0 and G0/1.
BPDUs received by ports G0/0 and G0/1 are both sent by the root bridge. Therefore, which
port is better cannot be compared in a) and b) in step 3 and c) needs to be carried out for
comparison.
The port priority is the default value, that is, 128. Therefore, the root port can be selected
only by comparing port IDs. In this topology, port G0/0 has a smaller port ID than port G0/1 in
the BPDUs received by SW2 from SW1. Port G0/0 of SW1 is interconnected to port G0/0 of
SW2. Therefore, port G0/0 of SW2 becomes the root port, as shown in the figure below.

To make port G0/1 of SW2 the root port, you must change the priority of the peer port of
G0/1 on SW2 to be less than 128. The figure below shows the result after adjustment.
Ruijie-SW1(config)#interface gigabitEthernet 0/1

4
STP Lab Guide

1.2 Key Points of the Lab


1.2.1 Bridge Priority
The bridge priority must be an integer multiple of 4096.

1.2.2 Port Priority


The port priority must be an integer multiple of 16.

You might also like