Imagine a small company expanding its local network. To improve reliability, the administrator connects the switches using multiple redundant links. A few minutes later, users start complaining, the network becomes slow, pings time out, and broadcast traffic floods the LAN.
Figure 1 – Example of a Layer 2 loop created by redundant switch links before Spanning Tree Protocol is enabled.
What happened? The network has fallen into a Layer 2 loop, a classic issue that can bring even simple Ethernet topologies to a halt. Frames endlessly circulate between switches because there’s no mechanism to stop them.
This is exactly the kind of disaster that the Spanning Tree Protocol (STP) was designed to prevent. STP ensures that even if multiple links exist between switches, only one logical path remains active. The others are placed in a blocking state to avoid loops but can reactivate instantly if a failure occurs.In this lesson, you’ll learn how to control which switch becomes the Root Bridge, the central decision-maker in any STP topology.
Network Topology Overview
Now that you understand why STP is necessary, let’s see how to configure it in practice. We’ll use a simple three-switch topology to illustrate how to set the Root Bridge and a Backup Root Bridge.
SW1: Intended Root Bridge.
SW2: Backup Root Bridge.
SW3: Default priority switch serving as a NON-ROOT switch.
Figure 2 – Three-switch topology with Root, Backup, and Non-Root switches.
We’ll configure SW1 with a lower Bridge ID (BID) so it becomes the Root Bridge.
SW2 will act as a backup, ready to take over if SW1 fails.
This ensures that the network behaves predictably and recovers quickly from link or switch failures.Answer the question below
Now that you’ve seen how loops can bring a network down, it’s time to take control.
Let’s make sure our switch becomes the Root Bridge, the central point from which the entire Spanning Tree topology is built.Understanding the Root Bridge Election
In every STP domain, switches compare their Bridge ID (BID) to decide who will be the Root Bridge.
The BID is made up of two elements:Figure 3 – Spanning Tree Bridge ID Example
Bridge Priority
MAC Address
The switch with the lowest BID wins the election and takes the role of Root Bridge.
By default, every switch starts with a priority of32768 + VLAN ID
.
That means any device could accidentally become the Root, leading to unpredictable traffic paths.
Let’s fix that by assigning a clear priority to our main switch.Preparing to Configure the Root Bridge
We’ll now configure Spanning Tree Protocol (STP) so that SW1 becomes the Root Bridge.
In our example, the network only uses VLAN 1, so we’ll apply the configuration to this VLAN.Note: Cisco switches use Rapid PVST+ (IEEE 802.1w) by default — a faster version of STP.
In this lesson, we’ll focus on classic STP to understand the fundamental configuration steps.To view what can be configured for VLAN 1:
SW1(config)# spanning-tree vlan 1 ? forward-time Set the forward delay for the spanning tree hello-time Set the hello interval for the spanning tree max-age Set the max age interval for the spanning tree priority Set the bridge priority for the spanning tree root Configure switch as root
Among these options, the key parameter is
priority
, which determines who becomes the Root Bridge.Setting the Bridge Priority
The Bridge Priority defines how likely a switch is to be elected as the Root.
Cisco allows values between 0 and 61440, in increments of 4096.
The lower the number, the higher the chance of becoming Root Bridge.Priority Value
Description
0
Lowest possible — almost guaranteed to become Root
4096
Very high priority
8192
High priority
12288–28672
Medium range
61440
Highest number — least likely to become Root
Table 1 - Spanning Tree Protocol Priority values
You could manually assign the lowest possible value like this:
SW1(config)# spanning-tree vlan 1 priority 0
This would force SW1 to always win the election by giving it the lowest Bridge ID.
However, in our lab, we’ll use Cisco’s shortcut method.Using the Root Bridge Shortcut
Let’s now configure SW1 to become the Root Bridge using the shortcut command:
SW1(config)# spanning-tree vlan 1 root primary
This command automatically adjusts the bridge priority so that SW1 becomes the Root Bridge for VLAN 1.
It’s simple, quick, and ensures the correct election outcome without manual calculations.40 % Complete: you’re making great progress
Unlock the rest of this lesson
If you’d like to continue your CCNA journey, create your free account now.
Access all free CCNA lessons
Practice with quizzes and level test
Progress tracking in your dashboard
Made by network engineers - CCNP certified
Create your Free Account1151 learners continued their CCNA journey this month