---
title: "STP, Rapid PVST+ and EtherChannel for CCNA | CyberWithMadhav"
description: "Free CCNA lesson: why loops melt networks, how STP elects a root, Rapid PVST+, PortFast, BPDU Guard, Root Guard and LACP EtherChannel, with a simulator and lab."
url: https://www.cyberwithmadhav.com/learn-ccna-stp-etherchannel.html
source_format: markdown rendering of the HTML page
---

[Learn](https://www.cyberwithmadhav.com/learn.html) / [Stage 3: Networking and CCNA](https://www.cyberwithmadhav.com/learn.html#stage-3) / Lesson 3.5

$ lesson 3.5 --track ccna --domain switching

# Redundant Switch Links: STP, Rapid PVST+, PortFast, BPDU Guard, EtherChannel

Redundancy keeps a network up when a cable dies, and the same redundancy can take it down in seconds if loops are not controlled. Learn how spanning tree decides which ports forward, how to choose the root yourself, how to stop rogue switches, and how EtherChannel turns parallel links into one.

- Stage **3** Networking and CCNA
- Level **Intermediate**
- **65** min
- **6** sections, quiz, lab

Start the lesson Jump to the lab

## In this lesson

1. Why redundant links can melt a network
2. How STP elects a root and picks ports
3. Rapid PVST+: faster convergence
4. PortFast, BPDU Guard, Root Guard and Loop Guard
5. EtherChannel: many links, one logical link
6. Practise on DSW1
7. Flashcards
8. Quick quiz
9. Hands-on lab
10. Key takeaways

## By the end of this lesson you can

- Explain broadcast storms and why Ethernet needs STP
- Predict the root bridge, root ports, designated ports and blocked ports
- Configure Rapid PVST+ and choose a root and secondary per VLAN
- Apply PortFast, BPDU Guard and Root Guard where they belong
- Build and verify an LACP EtherChannel trunk

3.5.01

## Why redundant links can melt a network

You add a second link between switches so one cable failure does not take a building offline. Ethernet frames have no hop limit (there is no TTL in the Layer 2 header), so without protection a redundant link creates a loop and three things happen within seconds:

- **Broadcast storm**: every broadcast is flooded out every port, comes back round the loop, and is flooded again, until links and CPUs are saturated.
- **MAC table instability**: the same source MAC arrives on different ports, so the switch keeps rewriting its table (MAC flapping).
- **Duplicate frames**: hosts receive several copies of the same unicast frame.

Spanning Tree keeps the physical redundancy but logically blocks one port, so there is exactly one active path between any two switches. If an active link fails, the blocked port takes over.
Think of it like this

A ring road with every junction open lets traffic circle forever. STP is the traffic police putting one barrier on the ring, and moving it the moment a road is closed.

3.5.02

## How STP elects a root and picks ports

Switches exchange **BPDUs** (bridge protocol data units). Each has a **bridge ID**: a priority (default 32768, changeable only in steps of 4096) plus the VLAN number (the system ID extension) plus its MAC address. Then:

1. **Root bridge**: the lowest bridge ID wins. With default priorities that means the lowest MAC, which is often the oldest switch in the building. That is why you always choose the root yourself.
2. **Root port**: every other switch picks its port with the lowest total cost to the root. Ties break on the lowest neighbour bridge ID, then the lowest port ID.
3. **Designated port**: on every link, the side closer to the root forwards. All ports on the root bridge are designated.
4. Every remaining port is **blocked** (an *alternate* port in Rapid STP).

| Link speed | Default STP cost (short method) |
| --- | --- |
| 10 Mb/s | 100 |
| 100 Mb/s | 19 |
| 1 Gb/s | 4 |
| 10 Gb/s | 2 |

Cisco Catalyst switches run one spanning tree per VLAN: **PVST+** by default (802.1D based) or **Rapid PVST+** (802.1w based). Because each VLAN has its own tree, you can make DSW1 root for VLAN 10 and DSW2 root for VLAN 20 so both uplinks carry traffic.

3.5.03

## Rapid PVST+: faster convergence

|  | Classic 802.1D (PVST+) | Rapid 802.1w (Rapid PVST+) |
| --- | --- | --- |
| Port states | Blocking, listening, learning, forwarding, disabled | Discarding, learning, forwarding |
| Port roles | Root, designated, blocked | Root, designated, alternate, backup |
| Recovery after a change | Timer based: 30 to 50 seconds (forward delay 15 s twice, plus max age 20 s) | Handshake based: usually within a few seconds on point to point links |
| Configure | `spanning-tree mode pvst` (default) | `spanning-tree mode rapid-pvst` |

An **alternate** port is a pre-computed backup root port: when the root port fails, it moves to forwarding almost immediately. A host plugged into a port should never wait 30 seconds for the network either, which is what PortFast fixes.

3.5.04

## PortFast, BPDU Guard, Root Guard and Loop Guard

| Feature | Where | What it does |
| --- | --- | --- |
| PortFast | Access ports to a single host | Skips listening and learning, so the PC gets connectivity at once. |
| BPDU Guard | Every PortFast port | If a BPDU arrives, the port goes err-disabled. A switch has no business on a user port. |
| Root Guard | Distribution ports facing access switches | If a superior BPDU (a would-be better root) arrives, the port goes root-inconsistent and stops forwarding. |
| Loop Guard | Root and alternate ports on switch to switch links | If BPDUs stop arriving (for example a one way fibre fault), the port is held instead of wrongly moving to forwarding. |

```
ASW1(config)#interface range Fa0/1 - 24
ASW1(config-if-range)#spanning-tree portfast
ASW1(config-if-range)#spanning-tree bpduguard enable
! or globally, for every access port:
ASW1(config)#spanning-tree portfast default
ASW1(config)#spanning-tree portfast bpduguard default
! recover an err-disabled port after removing the cause:
ASW1(config)#interface Fa0/5
ASW1(config-if)#shutdown
ASW1(config-if)#no shutdown
```
How attackers abuse this

Plug a small switch or a laptop running an attack tool into a user port, send BPDUs with priority 0, and you become the root bridge. Traffic between other switches may now flow through your device (a man in the middle position), and every re-election causes outages. A home router or a cheap unmanaged switch plugged in by an employee can also cause loops or elections by accident.
Defender move

BPDU Guard on every user port, Root Guard on the ports where the root must never appear, a deliberately chosen root and secondary, and alerting on err-disable and topology change logs. Users get one host per port; anything else is a ticket, not a cable.

3.5.05

## EtherChannel: many links, one logical link

STP blocks redundant parallel links, so two cables between DSW1 and DSW2 would give you the bandwidth of one. **EtherChannel** bundles up to 8 active physical links into one logical `Port-channel` interface. STP sees one link, nothing is blocked, and losing one member just reduces bandwidth.

| Protocol | Modes | Forms a channel when |
| --- | --- | --- |
| LACP (IEEE 802.3ad, now 802.1AX) | active, passive | active + active, or active + passive. passive + passive never starts. |
| PAgP (Cisco only) | desirable, auto | desirable + desirable, or desirable + auto. auto + auto never starts. |
| Static | on | on + on only. No negotiation, so mistakes are not detected. Avoid. |

- All members must match: speed, duplex, access or trunk mode, allowed VLANs and native VLAN. A mismatched port is suspended from the bundle.
- Traffic is shared per flow using a hash (for example of source and destination IPs), so a single big transfer still uses one member. Two 1 Gb/s links give 2 Gb/s of capacity, not one 2 Gb/s flow.
- Configure trunk settings on the Port-channel interface; they apply to the members.

3.5.06

## Practise on DSW1

DSW1 is a 3650 with VLANs 10, 20 and 99 already created and its uplinks already trunked. Gi1/0/1 and Gi1/0/2 go to DSW2, Gi1/0/3 goes down to ASW1. DSW2 has already been made root primary for VLAN 20, and nobody chose a root for VLANs 10 and 99. This console models DSW2's side of the election for you, so treat the outputs as a guide rather than a real protocol run.

console: DSW1 (DSW1 STP and EtherChannel)

#### Missions  0/11

Simplified IOS simulator in your browser. It teaches the commands; Packet Tracer and real gear have many more.

## Flashcards: do you remember?

Tap a card to flip it. Try to answer in your head first; recalling is what makes it stick.

## Quick quiz

Instant feedback on every answer. Score 70% or more to pass this lesson's quiz.

### Q1 All switches use priority 32768. Which becomes root?

### Q2 Where should BPDU Guard go?

### Q3 Which pair forms an LACP channel?

### Q4 Why use EtherChannel instead of two separate trunks?

### Q5 `spanning-tree vlan 10 priority 1000` is rejected. Why?

### Q6 A single large file copy runs over a two member 1 Gb/s bundle. Roughly how fast can it go?

**0 / 6**

## Hands-on lab

Cisco Packet Tracer lab  50 minutes  simulated network

### Packet Tracer lab 3.5: Rapid PVST+, guards and an LACP EtherChannel

**You need:** Cisco Packet Tracer (free with a Cisco Networking Academy account; version 9.0.1 was the current download on the NetAcad Resource Hub when this lesson was written). Devices: 2 x 3650-24PS, 1 x 2960-24TT, 2 x PC-PT. Create VLANs 10, 20 and 99 on all three switches and trunk every inter-switch link (native 99, allowed 10,20,99) as in lesson 3.4.

**Simulator lab, zero risk.** This lab runs inside Cisco Packet Tracer, so it touches no real network. Packet Tracer is free with a Cisco Networking Academy account (netacad.com). It simulates a subset of Cisco IOS, so where support for a feature is uncertain we say so instead of promising it works.

#### Topology and addressing

DSW1 and DSW2 joined by Gi1/0/1 and Gi1/0/2 (Port-channel 1). DSW1 Gi1/0/3 to ASW1 Gi0/1, DSW2 Gi1/0/3 to ASW1 Gi0/2. PC1 on ASW1 Fa0/1 (VLAN 10), PC2 on Fa0/11 (VLAN 20).

| Device | Interface | IPv4 address / prefix | Default gateway or note |
| --- | --- | --- | --- |
| PC1 | Fa0 | 192.168.10.11/24 | VLAN 10 |
| PC2 | Fa0 | 192.168.20.11/24 | VLAN 20 |
| Switches |  | no IP needed for this lab | Layer 2 only |

1. Before you change anything`DSW1#  show spanning-tree vlan 10   DSW1#  show spanning-tree vlan 20`Write down who is root and which port blocks. Expect the parallel DSW link and one ASW1 uplink to show blocking somewhere.  Done
2. Rapid PVST+ and the roots`DSW1(config)#  spanning-tree mode rapid-pvst   DSW1(config)#  spanning-tree vlan 10,99 root primary   DSW1(config)#  spanning-tree vlan 20 root secondary   DSW2(config)#  spanning-tree mode rapid-pvst   DSW2(config)#  spanning-tree vlan 20 root primary   DSW2(config)#  spanning-tree vlan 10,99 root secondary   ASW1(config)#  spanning-tree mode rapid-pvst`  Done
3. Protect the edge (ASW1)`ASW1(config)#  interface range Fa0/1 - 24   ASW1(config-if-range)#  spanning-tree portfast   ASW1(config-if-range)#  spanning-tree bpduguard enable`  Done
4. Root Guard toward the access layer (both DSWs)`DSW1(config)#  interface Gi1/0/3   DSW1(config-if)#  spanning-tree guard root`  Done
5. LACP EtherChannel (both DSWs)`DSW1(config)#  interface range Gi1/0/1 - 2   DSW1(config-if-range)#  channel-group 1 mode active   Creating a port-channel interface Port-channel 1   DSW1(config-if-range)#  interface Port-channel1   DSW1(config-if)#  switchport mode trunk   DSW1(config-if)#  switchport trunk native vlan 99   DSW1(config-if)#  switchport trunk allowed vlan 10,20,99   DSW2(config)#  interface range Gi1/0/1 - 2   DSW2(config-if-range)#  channel-group 1 mode passive`On 3650s you may need `switchport trunk encapsulation dot1q` before `switchport mode trunk`, depending on the image.  Done
6. Fail a linkStart a continuous ping from PC1 to another VLAN 10 host (`ping -t`), then delete or shut the DSW1 to ASW1 link. Watch the alternate port on ASW1 take over and count the lost pings.  Done
7. Trip BPDU GuardConnect a spare 2960 to ASW1 Fa0/5. The port should go err-disabled. Remove the switch, then recover with `shutdown` and `no shutdown` on Fa0/5.  Done
8. Verify`DSW1#  show spanning-tree vlan 10   DSW1#  show spanning-tree summary   DSW1#  show etherchannel summary   DSW1#  show interfaces trunk   ASW1#  show interfaces status err-disabled`  Done

**You are done when:** DSW1 is root for VLANs 10 and 99 and DSW2 for VLAN 20; show etherchannel summary shows Po1(SU) with both members (P); ASW1 Fa0/5 went err-disabled when a switch was attached.

#### Packet Tracer limits and notes

- In some Packet Tracer versions a 3650 starts without a power supply and stays off until you add one in its Physical tab. UNVERIFIED for every version.
- Root Guard, Loop Guard and `errdisable recovery cause bpduguard` are real IOS features; their support on Packet Tracer's switch images is UNVERIFIED. If a command is rejected, note it and read about it instead.
- Convergence timing in Packet Tracer is simulated and does not match real hardware; treat lost ping counts as rough.
- Layer 3 EtherChannel on the 3650 in Packet Tracer is UNVERIFIED; this lab uses a Layer 2 bundle. Cisco NetAcad publishes official Packet Tracer activities for Rapid PVST+ and EtherChannel if you want more practice.
- Packet Tracer simulates a subset of IOS. If a command here is rejected in your version, note it, skip that step and carry on; the concept still applies to real Cisco gear.

[Download the lab checklist (.txt)](https://www.cyberwithmadhav.com/assets/learn/learn-ccna-stp-etherchannel-lab-checklist.txt)  Print it or keep it open beside Packet Tracer.

## Key takeaways

- Loops cause storms; STP blocks just enough ports to prevent them.
- Choose the root yourself, per VLAN, with a secondary.
- Rapid PVST+ recovers in seconds instead of up to 50.
- PortFast plus BPDU Guard on user ports; Root Guard where the root must never appear.
- EtherChannel makes parallel links one logical link; use LACP.

Finished the sections, quiz and lab? Mark the lesson complete. Progress is saved only in this browser.

[Previous 3.4 VLANs and Trunks: 802.1Q, Native VLAN, DTP, Voice VLAN](https://www.cyberwithmadhav.com/learn-ccna-vlans-trunks.html)[Next 3.6 Inter-VLAN Routing and First Hop Redundancy: Router on a Stick, SVIs, HSRP](https://www.cyberwithmadhav.com/learn-ccna-inter-vlan-routing-hsrp.html)
