Skip to content

Spanning Tree

Spanning Tree Protocol (STP) is a Layer 2 loop prevention mechanism that ensures a loop-free topology in Ethernet networks by selectively blocking redundant paths while maintaining network connectivity and providing automatic failover capabilities. It supports multiple implementations including Per-VLAN Spanning Tree Plus (PVST+), Rapid Per-VLAN Spanning Tree Plus (RPVST+), and Multiple Spanning Tree (MST) protocol, each offering different approaches to VLAN-aware loop prevention and convergence optimization. Spanning Tree configuration includes features like PortFast for edge ports, BPDU Guard for security, root bridge selection, and path cost manipulation to optimize network topology and ensure rapid recovery from link failures while preventing broadcast storms and network instability.

Diagram

Diagram

Classes

configuration (iosxe.devices)

NameTypeConstraintMandatoryDefault Value
spanning_treeClass[spanning_tree]No

spanning_tree (iosxe.devices.configuration)

NameTypeConstraintMandatoryDefault Value
modeChoicemst, pvst, rapid-pvstNo
loopguard_defaultBooleantrue, falseNo
portfast_defaultBooleantrue, falseNo
portfast_bpduguard_defaultBooleantrue, falseNo
extend_system_idBooleantrue, falseNo
mst_instancesList[mst_instances]No

mst_instances (iosxe.devices.configuration.spanning_tree)

NameTypeConstraintMandatoryDefault Value
idIntegermin: 0, max: 4094Yes
vlan_idsListIntegerNo

Examples

iosxe:
devices:
- name: Device1
configuration:
spanning_tree:
mode: rapid-pvst
loopguard_default: true
portfast_default: true
portfast_bpduguard_default: true
extend_system_id: true
- name: Device2
configuration:
spanning_tree:
mode: mst
loopguard_default: true
portfast_default: false
portfast_bpduguard_default: true
extend_system_id: true
mst_instances:
- id: 0
vlan_ids: [1, 10, 20, 30]
- id: 1
vlan_ids: [100, 200, 300]
- id: 2
vlan_ids: [400, 500, 600]