Spanning Tree
NX-OSSpanning Tree Protocol (STP) configuration prevents Layer 2 loops and provides redundant path management on NX-OS devices, supporting PVST+ (per-VLAN spanning tree) and MST (Multiple Spanning Tree) modes with bridge assurance and loop guard for enhanced network stability. Global settings control STP mode selection, pathcost method, FCoE integration, LC ISSU behavior, L2 gateway STP domain ID, and default edge port behavior. Per-VLAN settings allow customization of timers, priority, and root bridge designation. MST settings define the region (name, revision, and instance-to-VLAN mapping), global MST timers and hop count, PVST simulation, and per-instance priority and root bridge designation. Spanning tree interface-level configuration manages BPDU filter, BPDU guard, port cost, guard mode (root/loop), link type, port type (edge/network/normal), port priority, per-MST instance cost and port priority, and MST interoperability settings across Ethernet and port-channel interfaces.
Spanning Tree Protocol (STP) configuration prevents Layer 2 loops and provides redundant path management on NX-OS devices, supporting PVST+ (per-VLAN spanning tree) and MST (Multiple Spanning Tree) modes with bridge assurance and loop guard for enhanced network stability. Global settings control STP mode selection, pathcost method, FCoE integration, LC ISSU behavior, L2 gateway STP domain ID, and default edge port behavior. Per-VLAN settings allow customization of timers, priority, and root bridge designation. Spanning tree interface-level configuration manages BPDU filter, BPDU guard, port cost, guard mode (root/loop), link type, port type (edge/network/normal), port priority, and MST interoperability settings across Ethernet and port-channel interfaces.
Diagram
Section titled “Diagram”Diagram
Section titled “Diagram”Classes
Section titled “Classes”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| devices | List | devices | No | |
| device_groups | List | device_groups | No | |
| global | Class | global | No | |
| templates | List | templates | No | |
| interface_ | List | interface_ | No |
| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| devices | List | devices | No | |
| device_groups | List | device_groups | No | |
| global | Class | global | No | |
| templates | List | templates | No |
devices (nxos)
Section titled “devices (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
device_groups (nxos)
Section titled “device_groups (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
global (nxos)
Section titled “global (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
templates (nxos)
Section titled “templates (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
interface_groups (nxos)
Section titled “interface_groups (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
configuration (nxos.devices)
Section titled “configuration (nxos.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| interfaces | Class | interfaces | No | |
| spanning_tree | Class | spanning_tree | No |
interfaces (nxos.devices.configuration)
Section titled “interfaces (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ethernets | List | ethernets | No | |
| port_channels | List | port_channels | No |
ethernets (nxos.devices.configuration.interfaces)
Section titled “ethernets (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| spanning_tree | Class | spanning_tree | No |
port_channels (nxos.devices.configuration.interfaces)
Section titled “port_channels (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| spanning_tree | Class | spanning_tree | No |
configuration (nxos.interface_groups)
Section titled “configuration (nxos.interface_groups)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| spanning_tree | Class | spanning_tree | No |
spanning_tree (nxos.devices.configuration)
Section titled “spanning_tree (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bridge_ | Boolean | true, false | No | |
| fcoe | Boolean | true, false | No | |
| l2gateway_ | Integer | min: 0, max: 200000000 | No | |
| lc_issu | Choice | disruptive, non-disruptive, auto | No | |
| loopguard | Boolean | true, false | No | |
| mode | Choice | mst, rapid-pvst | No | |
| pathcost_method | Choice | auto, short, long | No | |
| port_ | Boolean | true, false | No | |
| port_ | Boolean | true, false | No | |
| port_ | Boolean | true, false | No | |
| mst | Class | mst | No | |
| vlans | List | vlans | No |
spanning_tree (nxos.devices.configuration)
Section titled “spanning_tree (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bridge_ | Boolean | true, false | No | |
| fcoe | Boolean | true, false | No | |
| l2gateway_ | Integer | min: 0, max: 200000000 | No | |
| lc_issu | Choice | disruptive, non-disruptive, auto | No | |
| loopguard | Boolean | true, false | No | |
| mode | Choice | mst, rapid-pvst | No | |
| pathcost_method | Choice | auto, short, long | No | |
| port_ | Boolean | true, false | No | |
| port_ | Boolean | true, false | No | |
| port_ | Boolean | true, false | No | |
| vlans | List | vlans | No |
spanning_tree (nxos.devices.configuration.interfaces.ethernets)
Section titled “spanning_tree (nxos.devices.configuration.interfaces.ethernets)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bpdufilter | Boolean | true, false | No | |
| bpduguard | Boolean | true, false | No | |
| cost | Integer | min: 0, max: 200000000 | No | |
| guard | Choice | root, loop, none | No | |
| link_type | Choice | auto, point-to-point, shared | No | |
| port_type | Choice | edge, network, normal | No | |
| port_priority | Integer | min: 0, max: 224 | No | |
| mst_ | Boolean | true, false | No | |
| mst_ | Boolean | true, false | No | |
| mst_instances | List | mst_instances | No |
spanning_tree (nxos.devices.configuration.interfaces.ethernets)
Section titled “spanning_tree (nxos.devices.configuration.interfaces.ethernets)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bpdufilter | Boolean | true, false | No | |
| bpduguard | Boolean | true, false | No | |
| cost | Integer | min: 0, max: 200000000 | No | |
| guard | Choice | root, loop, none | No | |
| link_type | Choice | auto, point-to-point, shared | No | |
| port_type | Choice | edge, network, normal | No | |
| port_priority | Integer | min: 0, max: 224 | No | |
| mst_ | Boolean | true, false | No | |
| mst_ | Boolean | true, false | No |
mst (nxos.devices.configuration.spanning_tree)
Section titled “mst (nxos.devices.configuration.spanning_tree)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No | |
| forward_time | Integer | min: 4, max: 30 | No | |
| hello_time | Integer | min: 1, max: 10 | No | |
| max_age | Integer | min: 6, max: 40 | No | |
| max_hops | Integer | min: 1, max: 255 | No | |
| simulate_ | Boolean | true, false | No | |
| instances | List | instances | No |
vlans (nxos.devices.configuration.spanning_tree)
Section titled “vlans (nxos.devices.configuration.spanning_tree)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| vlans | Class | vlans | Yes | |
| forward_time | Integer | min: 4, max: 30 | No | |
| hello_time | Integer | min: 1, max: 10 | No | |
| max_age | Integer | min: 6, max: 40 | No | |
| priority | Integer | min: 0, max: 61440 | No | |
| root | Choice | primary, secondary | No | |
| diameter | Integer | min: 2, max: 7 | No |
mst_instances (nxos.devices.configuration.interfaces.ethernets.spanning_tree)
Section titled “mst_instances (nxos.devices.configuration.interfaces.ethernets.spanning_tree)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 0, max: 4094 | Yes | |
| cost | Integer | min: 0, max: 200000000 | No | |
| port_priority | Integer | min: 0, max: 224 | No |
configuration (nxos.devices.configuration.spanning_tree.mst)
Section titled “configuration (nxos.devices.configuration.spanning_tree.mst)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | No | ||
| revision | Integer | min: 0, max: 65535 | No | |
| instances | List | instances | No |
instances (nxos.devices.configuration.spanning_tree.mst)
Section titled “instances (nxos.devices.configuration.spanning_tree.mst)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 0, max: 4094 | Yes | |
| priority | Integer | min: 0, max: 61440 | No | |
| root | Choice | primary, secondary | No | |
| diameter | Integer | min: 2, max: 7 | No |
vlans (nxos.devices.configuration.spanning_tree.vlans)
Section titled “vlans (nxos.devices.configuration.spanning_tree.vlans)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ids | List | Integer[min: 1, max: 4094] | No | |
| ranges | List | ranges | No |
instances (nxos.devices.configuration.spanning_tree.mst.configuration)
Section titled “instances (nxos.devices.configuration.spanning_tree.mst.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 4094 | Yes | |
| vlans | Class | vlans | No |
ranges (nxos.devices.configuration.spanning_tree.vlans.vlans)
Section titled “ranges (nxos.devices.configuration.spanning_tree.vlans.vlans)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| from | Integer | min: 1, max: 4094 | Yes | |
| to | Integer | min: 1, max: 4094 | Yes |
Examples
Section titled “Examples”Example 1: PVST+ mode with bridge assurance, loopguard, and default edge port settings
nxos: devices: - name: LEAF1 configuration: spanning_tree: mode: rapid-pvst loopguard: true bridge_assurance: true port_type_edge_default: true port_type_edge_bpduguard_default: trueExample 2: MST mode with region configuration, timers, and per-instance root bridge settings
nxos: devices: - name: SPINE1 configuration: spanning_tree: mode: mst bridge_assurance: true loopguard: true pathcost_method: long mst: configuration: name: REGION1 revision: 5 instances: - id: 1 vlans: ranges: - from: 10 to: 20 - id: 2 vlans: ids: [30, 40] forward_time: 20 hello_time: 5 max_age: 25 max_hops: 30 simulate_pvst_global: false instances: - id: 0 root: primary - id: 1 priority: 4096 - id: 2 root: secondaryExample 3: Spanning tree with FCoE support, LC ISSU behavior, and L2 gateway domain ID
nxos: devices: - name: BORDER-LEAF1 configuration: spanning_tree: mode: rapid-pvst bridge_assurance: true loopguard: true fcoe: true lc_issu: non-disruptive l2gateway_stp_domain_id: 100Example 4: Per-VLAN spanning tree with root bridge designation and custom timers
nxos: devices: - name: LEAF1 configuration: spanning_tree: mode: rapid-pvst vlans: - vlans: ids: [100] priority: 4096 root: primary diameter: 3 forward_time: 15 hello_time: 2 max_age: 20 - vlans: ids: [200] priority: 8192 root: secondaryExample 5: Interface-level spanning tree with edge port, BPDU guard, MST interop, and per-MST instance settings
nxos: devices: - name: LEAF1 configuration: interfaces: ethernets: - id: 1/1 spanning_tree: port_type: edge bpduguard: true guard: root mst_pre_standard: true mst_simulate_pvst: true mst_instances: - id: 1 cost: 100 port_priority: 64 port_channels: - id: 100 spanning_tree: port_type: network guard: loop link_type: point-to-point cost: 500 port_priority: 128Examples
Section titled “Examples”Example 1: PVST+ mode with bridge assurance, loopguard, and default edge port settings
nxos: devices: - name: LEAF1 configuration: spanning_tree: mode: rapid-pvst loopguard: true bridge_assurance: true port_type_edge_default: true port_type_edge_bpduguard_default: trueExample 2: MST mode with long pathcost on a spine switch
nxos: devices: - name: SPINE1 configuration: spanning_tree: mode: mst bridge_assurance: true loopguard: true pathcost_method: longExample 3: Spanning tree with FCoE support, LC ISSU behavior, and L2 gateway domain ID
nxos: devices: - name: BORDER-LEAF1 configuration: spanning_tree: mode: rapid-pvst bridge_assurance: true loopguard: true fcoe: true lc_issu: non-disruptive l2gateway_stp_domain_id: 100Example 4: Per-VLAN spanning tree with root bridge designation and custom timers
nxos: devices: - name: LEAF1 configuration: spanning_tree: mode: rapid-pvst vlans: - vlans: ids: [100] priority: 4096 root: primary diameter: 3 forward_time: 15 hello_time: 2 max_age: 20 - vlans: ids: [200] priority: 8192 root: secondaryExample 5: Interface-level spanning tree with edge port, BPDU guard, and MST interop settings
nxos: devices: - name: LEAF1 configuration: interfaces: ethernets: - id: 1/1 spanning_tree: port_type: edge bpduguard: true guard: root mst_pre_standard: true mst_simulate_pvst: true port_channels: - id: 100 spanning_tree: port_type: network guard: loop link_type: p2p cost: 500 port_priority: 128