Configure Spanning Tree Protocol (STP)

  • 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.

    Layer 2 network loop example with redundant links between switches before enabling STP

    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.

    Diagram showing the topology used for configuring Spanning Tree Protocol (STP) with Root Bridge SW1 and Backup Root SW2

    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