##
STP & EtherChannel
Spanning Tree blocks redundant links to stop loops. EtherChannel bundles links into one logical pipe.
// loop-free topology
Lowest bridge ID wins root. One redundant link is blocked to break the loop; it unblocks if a forwarding link fails.
// STP (802.1D) port states
| Blocking | Listens to BPDUs only (~20s) |
| Listening | Building topology, no MAC learning (15s) |
| Learning | Learns MACs, not forwarding (15s) |
| Forwarding | Normal data traffic |
| Disabled | Administratively down |
// RSTP (802.1w) states
| Discarding | Blocking + listening merged |
| Learning | Learns MACs |
| Forwarding | Passes traffic |
// port roles
| Root port | Best path toward the root bridge — one per non-root switch |
| Designated port | Forwarding port on each segment — one per segment |
| Alternate port | Backup path to root, blocking (RSTP) |
| Backup port | Backup to a designated port on a shared segment (RSTP) |
// path cost (by speed)
| 10 Mbps | 100 |
| 100 Mbps | 19 |
| 1 Gbps | 4 |
| 10 Gbps | 2 |
// timers
| Hello | 2 s — BPDU interval |
| Forward Delay | 15 s — listening + learning |
| Max Age | 20 s — BPDU expiry |
// STP variants
| STP (802.1D) | Original — one tree for all VLANs |
| PVST+ | Cisco — a separate tree per VLAN |
| RSTP (802.1w) | Rapid convergence in seconds |
| Rapid-PVST+ | Cisco RSTP per VLAN (default) |
| MSTP (802.1s) | Maps many VLANs to a few instances |
// STP facts
- Prevents L2 loops by blocking redundant paths
- Root bridge = lowest Bridge ID (priority + MAC)
- Default priority 32768, set in steps of 4096
- RSTP (802.1w) converges in seconds vs ~50s for STP
- PortFast jumps access ports straight to forwarding
- BPDU Guard shuts a PortFast port that sees a BPDU
// EtherChannel modes
| LACP | 802.3ad (open) | active / passive |
| PAgP | Cisco | desirable / auto |
| Static | no negotiation | on |
- Bundles up to 8 active links into one logical link
- Both ends must use compatible modes
- Load-balances per flow, not per packet
spanning-tree · cisco ios
spanning-tree mode rapid-pvst
! Make this switch the root for VLAN 1
spanning-tree vlan 1 priority 4096
!
interface Gi0/1
spanning-tree portfast
spanning-tree bpduguard enable
!
interface Gi0/24
spanning-tree guard root
verify
show spanning-tree
show spanning-tree vlan 1
show spanning-tree summary
show spanning-tree interface Gi0/1