All topic guides
Layer 2 Switching

Spanning Tree & EtherChannel

Loop prevention, port roles, Rapid PVST+, and link aggregation.

How the sources were combined

Only Panagiss publishes dedicated STP markdown with broadcast-storm and EtherChannel diagrams. jdepew88 has no STP file — study charts on this site supplement port-state tables.

Overview

Redundant switch links need STP to prevent Layer 2 loops; EtherChannel bundles links for bandwidth and resiliency. CCNA covers port roles, Rapid PVST+, root bridge election, and LACP/PAgP modes.

The problem: Layer 2 loops

Redundant links between switches improve availability — but without loop prevention, Ethernet has no TTL. A broadcast (ARP, DHCP, unknown unicast) can circulate forever, multiplying at every switch. CPU utilization spikes, MAC tables flap, and the network becomes unusable. This is a broadcast storm.

Without STP, redundant switch links cause broadcast storms that overwhelm CPU and bandwidth.

Without STP, redundant switch links cause broadcast storms that overwhelm CPU and bandwidth.

Supplementary figure from Panagiss CCNAmd

Spanning Tree Protocol (STP) builds a loop-free logical tree by blocking redundant paths while keeping them physically cabled for failover. STP is enabled by default on Cisco switches.

How STP works

  1. Switches exchange Bridge Protocol Data Units (BPDUs) out all ports when they come online
  2. Switches elect a root bridge — the center of the spanning tree
  3. Each non-root switch picks one root port (best path toward the root)
  4. On each segment, one designated port forwards; redundant ports become blocking/alternate
  5. Ports do not forward user traffic until STP confirms the port is loop-free

Classic 802.1D convergence can take up to ~50 seconds (max age 20s + forward delay 15s × 2). Production networks use faster variants.

Root bridge election

The root bridge is elected by lowest Bridge ID:

  • Bridge priority (0–65535; default 32768) — lower wins
  • Tie-break: lowest MAC address

In PVST+/RPVST+, the effective priority is often 32768 + VLAN ID per VLAN instance.

Tip

Best practice: manually set core switches as root — spanning-tree vlan 10 root primary (priority 24576) and root secondary (28672) on the backup core. Without this, the oldest switch (lowest MAC) may become root by accident.

Influence root bridge election

spanning-tree vlan 10 root primary spanning-tree vlan 10 root secondary ! show spanning-tree vlan 10 root

Port roles

Root, designated, and blocking port roles in a loop-free spanning tree.

Root, designated, and blocking port roles in a loop-free spanning tree.

Supplementary figure from Panagiss CCNAmd

RoleDefinition
Root portBest path to root bridge on a non-root switch (one per switch)
Designated portBest path onto a segment — forwards traffic
Alternate / BackupRedundant path — blocking in classic STP

Seven-step exam method

  1. Determine the root bridge (lowest Bridge ID)
  2. All ports on the root are designated
  3. On every other switch, find the root port (lowest cost to root)
  4. The port on the other end of each root-port link is designated
  5. On remaining links, one port blocks
  6. Blocking port = highest cost to root (or highest Bridge ID tie-break)
  7. Draw the tree before reading show spanning-tree

Root port selection tie-breakers: lowest root path cost → lowest sender Bridge ID → lowest sender port ID.

STP Cost

Default STP port cost by link speed — memorize for root/designated port questions.

From study charts · jdepew88 CCNA notes

STP versions (know for CCNA)

STP Vs PVST Vs RSTP Vs RPVST Vs MSTP

STP variants — CCNA focuses on PVST+ and Rapid PVST+.

From study charts · jdepew88 CCNA notes

Standard / CiscoScopeNotes
802.1D STPOne tree for all VLANsSlow; Blocking → Listening → Learning → Forwarding
802.1w RSTPOne tree, fast convergenceProposal/agreement handshake
802.1s MSTPGroups VLANs into instancesLoad-balance roots per instance
PVST+Per-VLAN 802.1D (Cisco default)Separate root per VLAN possible
RPVST+Per-VLAN 802.1w (Cisco)CCNA default on modern switches — fast per-VLAN convergence
PerVLAN STP - Diagram

Per-VLAN STP — each VLAN can have a different blocked port.

From study charts · jdepew88 CCNA notes

STP Vs RSTP States

Classic STP vs RSTP port states.

From study charts · jdepew88 CCNA notes

Span Tree Comp

Rapid PVST+ port state progression — discarding, learning, forwarding.

From study charts · jdepew88 CCNA notes

Info

RPVST+ uses discarding instead of blocking/listening. Exams may reference classic states conceptually even when the switch runs RPVST+.

Portfast and BPDU Guard

Portfast puts access ports into forwarding immediately — appropriate only where no switch can attach (single host). If someone plugs a switch into a Portfast port, loops can form instantly.

BPDU Guard shuts the port (err-disable) if a BPDU arrives — protecting against rogue switches on access ports.

Portfast + BPDU Guard on access ports

interface GigabitEthernet0/10 spanning-tree portfast spanning-tree bpduguard enable ! spanning-tree portfast default spanning-tree portfast bpduguard default

Root Guard (on distribution/core ports) prevents an access-layer switch from becoming root — port goes root-inconsistent if superior BPDUs arrive.

EtherChannel

Multiple physical links bundled into one logical Port-channel give bandwidth aggregation without STP blocking individual member links. STP sees the bundle as a single interface.

EtherChannel — STP treats the bundle as one link, so no member is blocked for loop prevention.

EtherChannel — STP treats the bundle as one link, so no member is blocked for loop prevention.

Supplementary figure from Panagiss CCNAmd

Aliases: Port-channel, LAG, link bundle. Server-side equivalent: NIC teaming / bonding.

Etherchannel Operating Modes

EtherChannel negotiation modes — LACP active/passive and PAgP desirable/auto.

From study charts · jdepew88 CCNA notes

EtherChannel rules (exam favorites)

  • Member interfaces must match: speed, duplex, access vs trunk, VLAN settings
  • Configure the Port-channel interface — do not rely on per-member settings alone
  • Mismatched configs → bundle won't form
ProtocolStandard?ModesResult if both passive/auto
LACP (802.3ad)Open standardactive / passiveNo bundle
PAgPCisco proprietarydesirable / autoNo bundle
Static (on)N/Amode onMust match both sides — no negotiation
LACP EtherChannel (recommended)

interface range GigabitEthernet0/23-24 channel-group 1 mode active ! interface Port-channel 1 switchport mode trunk switchport trunk allowed vlan 10,20,30

Verify EtherChannel

show etherchannel summary show interfaces Port-channel 1 show spanning-tree vlan 10

Warning

EtherChannel misconfiguration trap: Mixing access and trunk on members, different native VLANs, or different allowed VLAN lists prevents the port-channel from forming. Always verify show etherchannel summary — look for (P) bundled vs (D) down.

STP + HSRP alignment (bonus context)

When HSRP provides the default gateway, align the active HSRP router with the STP root path for each VLAN. Otherwise traffic hairpins through an extra hop (e.g., active gateway on CD2 while STP root path goes through CD1).

Exam checklist

TrapDetail
Wrong root bridgeOldest/lowest-MAC switch becomes root if priorities tie at default
Confusing port cost vs port priorityCost is cumulative path metric; port priority breaks ties on same cost
Blocking port on wrong linkRe-draw tree — blocking is on the higher-cost side of the redundant link
EtherChannel + STPSTP blocks whole bundle or none — not individual members
Portfast without BPDU GuardUser-plugged switch causes immediate loop
Per-VLAN STPVLAN 10 and VLAN 20 may block different physical ports

Verification workflow

STP and EtherChannel troubleshooting

show spanning-tree vlan 10 show spanning-tree vlan 10 root show spanning-tree interface GigabitEthernet0/1 detail show etherchannel summary show interfaces Port-channel 1 trunk

  1. Identify root bridge and root path cost per VLAN
  2. Label root, designated, and blocking ports on paper
  3. Confirm access ports use Portfast + BPDU Guard
  4. If using redundant links, verify EtherChannel bundles before expecting full bandwidth

Related lessons on this site

Continue in this domain

Layer 2 Switching · guide 2 of 4

Sources & further reading

This page is an amalgamated study guide synthesized from the markdown sources above, cross-checked against Cisco's official CCNA exam topics. Verify scope before your exam date.