Configuring STP
STP provides a loop-free network at the Layer 2 level. Layer 2 LAN ports send and receive STP frames, which are called Bridge Protocol Data Units (BPDUs), at regular intervals. Network devices do not forward these frames but use the frames to construct a loop-free path.
802.1D is the original standard for STP, and many improvements have enhanced the basic loop-free STP. You can create a separate loop-free path for each VLAN, which is named Per VLAN Spanning Tree (PVST+). Additionally, the entire standard was reworked to make the loop-free convergence process faster to keep up with the faster equipment. This STP standard with faster convergence is the 802.1w standard, which is known as Rapid Spanning Tree (RSTP). Now, these faster convergence times are available as you create STP for each VLAN, which is known as Per VLAN Rapid Spanning Tree (Rapid PVST+).
Finally, the 802.1s standard, Multiple Spanning Trees (MST), allows you to map multiple VLANs into a single spanning tree instance. Each instance runs an independent spanning tree topology.
Although the software can interoperate with legacy 802.1D systems, the system runs Rapid PVST+ and MST. Rapid PVST+ is the default STP protocol for Cisco Nexus devices.
Note: Cisco NX-OS uses the extended system ID and MAC address reduction; you cannot disable these features.
In addition, Cisco has created some proprietary features to enhance the spanning tree activities.
For more information about security features, see the Cisco Nexus 9000 Series NX-OS Layer 2 Switching Configuration Guide.
Configuring STP Settings
NX-API REST supports the following spanning-tree protocol (STP) settings:
spanning-tree mode <stp-mode> | no spanning-tree mode [<stp-mode>]
[no] spanning-tree mst simulate pvst global
[no] spanning-tree port type edge bpduguard default
[no] spanning-tree port type edge bpdufilter default
[no] spanning-tree port type edge edge default
[no] spanning-tree port type edge network default
[no] spanning-tree vlan <vlan-id>
[no] spanning-tree vlan <vlan-id> forward-time <seconds>
[no] spanning-tree vlan <vlan-id> hello-time <seconds>
[no] spanning-tree vlan <vlan-id> max-age <seconds>
[no] spanning-tree vlan <vlan-id> priority <prio>
spanning-tree port type <port-type> | no spanning-tree port [<port-type>]
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting STP Mode to MST
Setting STP Mode to MST
POST http://<IP_Address>/api/mo/sys/stp/inst.json
{
"stpInst": {
"attributes": {
"mode": "mst"
}
}
}
{
imdata": []
}
This example sets STP mode to support Multiple Spanning Trees (MST):
When you issue an POST to configure STP, an stpInst object (/sys/stp/inst) is created in the MIT. Under this object, objects are created for each interface included in the spanning tree, and an stpMstEntity object (syst/stp/inst/mstent) is created, which holds the MST configuration.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting STP Mode to Rapid PVST
Setting STP Mode to Rapid PVST
POST http://<IP_Address>/api/mo/sys/stp/inst.json
{
"stpInst": {
"attributes": {
"mode": "pvrst"
}
}
}
{
imdata": []
}
This example sets STP mode to support Rapid PVST.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Enabling or Disabling MST Spanning Tree Simulation
Enabling or Disabling MST Spanning Tree Simulation
POST http://<IP_Address>/api/mo/sys/stp/inst/mstent.json
{
"stpMstEntity": {
"attributes": {
"simulate": "enabled"
}
}
}
{
imdata": []
}
This example enables MST spanning tree simulation.
To disable MST Spanning Tree simulation, set the "simulate" value to "disabled."
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting the Spanning Tree Port Type to extchp-edge
Setting the Spanning Tree Port Type to extchp-edge
POST http://<IP_Address>/api/mo/sys/stp/inst.json
{
"stpInst": {
"attributes": {
"ctrl": "extchp-edge"
}
}
}
{
imdata": []
}
This example changes the spanning tree port type to 'extchp-edge'.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting the Spanning Tree Port Type to network
Setting the Spanning Tree Port Type to network
POST http://<IP_Address>/api/mo/sys/stp/inst.json
{
"stpInst": {
"attributes": {
"ctrl": "network"
}
}
}
{
imdata": []
}
This example changes the spanning tree port type to 'network'.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Enabling Additional Settings for the Spanning Tree Port Type
This section uses payload examples to demonstrate how to enable additional settings for the spanning tree port type.
Setting the Spanning Tree Port Type to extchp-bpdu-filter
Setting the Spanning Tree Port Type to extchp-bpdu-filter
POST http://<IP_Address>/api/mo/sys/stp/inst.json
{
"stpInst": {
"attributes": {
"ctrl": "extchp-bpdu-filter"
}
}
}
{
"imdata": []
}
You can provide additional settings for the "ctrl" object to enable additional settings for the spanning tree port type. For example, you can set the value to:
- "extchp-bpdu-guard"
- "extchp-bpdu-filter"
- "" - This specifies a port type of "none"
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting the Spanning Tree Port Type to None ("")
Setting the Spanning Tree Port Type to None ("")
{
"stpInst": {
"attributes": {
"ctrl": ""
}
}
}
{
"imdata": []
}
You can provide additional settings for the "ctrl" object to enable additional settings for the spanning tree port type. For example, you can set the value to:
- "extchp-bpdu-guard"
- "extchp-bpdu-filter"
- "" - This specifies a port type of "none"
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Enabling or Disabling Spanning Tree Protocol on a VLAN
Enabling or Disabling Spanning Tree Protocol on a VLAN
POST http://<IP_Address>/api/mo/sys/stp/inst/vlan-33.json
{
"stpVlan": {
"attributes": {
"adminSt": "enabled"
}
}
}
{
imdata": []
}
To enable STP, set the "adminSt" value to "enabled." To disable STP, set the "adminSt" value to "disabled".
This example enables STP on VLAN 33.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Setting an Interface Port Type
Setting an Interface Port Type
POST http://<IP_Address>/api/mo/sys/stp/inst/if-[eth5/1].json
{
"stpIf": {
"attributes": {
"mode": "network"
}
}
}
{
"imdata": []
}
This example sets the interface port type on the eth5/1 interface to 'network'.
By changing the value of the "mode" parameter, you can specify other interface port type values; for example:
- "edge"
- "normal"
- "default"
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring the Bridge Priority for the Spanning Tree
Configuring the Bridge Priority for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"children": [
{
"stpMstDom": {
"attributes": {
"id": "9",
"priority": "61440"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "7",
"priority": "61440"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "8",
"priority": "61440"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<mst-items>
<MstDom-list>
<id>9</id>
<priority>61440</priority>
</MstDom-list>
<MstDom-list>
<id>7</id>
<priority>61440</priority>
</MstDom-list>
<MstDom-list>
<id>8</id>
<priority>61440</priority>
</MstDom-list>
</mst-items>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst 7-9 priority 61440
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting the Bridge Priority for the Spanning Tree
Deleting the Bridge Priority for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"children": [
{
"stpMstDom": {
"attributes": {
"id": "9",
"priority": "32768"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "7",
"priority": "32768"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "8",
"priority": "32768"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<mst-items>
<MstDom-list>
<id>9</id>
<priority>32768</priority>
</MstDom-list>
<MstDom-list>
<id>7</id>
<priority>32768</priority>
</MstDom-list>
<MstDom-list>
<id>8</id>
<priority>32768</priority>
</MstDom-list>
</mst-items>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst 7-9 priority 61440
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring the Forward Delay for the Spanning Tree
Configuring the Forward Delay for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"fwdTime": "25"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<fwdTime>25</fwdTime>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst forward-time 25
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting the Forward Delay for the Spanning Tree
Deleting the Forward Delay for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"fwdTime": "15"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<fwdTime>15</fwdTime>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst forward-time 25
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring the the Hello Interval for the Spanning Tree
Configuring the the Hello Interval for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"helloTime": "7"
}
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<helloTime>7</helloTime>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst hello-time 7
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting the Hello Interval for the Spanning Tree
Deleting the Hello Interval for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"helloTime": "2"
}
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<helloTime>2</helloTime>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst hello-time 7
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring the Max Age Interval for the Spanning Tree
Configuring the Max Age Interval for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"maxAge": "25"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<maxAge>25</maxAge>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst max-age 25
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting the Max Age Interval for the Spanning Tree
Deleting the Max Age Interval for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"maxAge": "20"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<maxAge>20</maxAge>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst max-age 25
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring the Max Hops Value for the Spanning Tree
Configuring the Max Hops Value for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"maxHops": "125"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<maxHops>125</maxHops>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst max-hops 125
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting the Max Hops Value for the Spanning Tree
Deleting the Max Hops Value for the Spanning Tree
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"attributes": {
"maxHops": "20"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<maxHops>20</maxHops>
</mstent-items>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst max-hops 125
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Enabling Spanning Tree Domain
Enabling Spanning Tree Domain
POST http://<mgmt0_IP>/api/mo/sys/stp.json
{
"stpEntity": {
"children": [
{
"stpInst": {
"attributes": {
"l2GStpDomId": "0"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<l2GStpDomId>0</l2GStpDomId>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree domain enable
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Disabling Spanning Tree Domain
Disabling Spanning Tree Domain
POST http://<mgmt0_IP>/api/mo/sys/stp.json
{
"stpEntity": {
"children": [
{
"stpInst": {
"attributes": {
"l2GStpDomId": "1024"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<l2GStpDomId>1024</l2GStpDomId>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree domain disable
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting an Enabled Spanning Tree Domain
Deleting an Enabled Spanning Tree Domain
POST http://<mgmt0_IP>/api/mo/sys/stp.json
{
"stpEntity": {
"children": [
{
"stpInst": {
"attributes": {
"l2GStpDomId": "1024"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<l2GStpDomId>1024</l2GStpDomId>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree domain enable
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring a Spanning-Tree Domain
Example: <description>
POST http://<mgmt0_IP>/api/mo/sys/stp.json
{
"stpEntity": {
"children": [
{
"stpInst": {
"attributes": {
"l2GStpDomId": "123"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<l2GStpDomId>123</l2GStpDomId>
</inst-items>
</stp-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree domain 123
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Enabling Portfast
Enabling Portfast
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpIf": {
"attributes": {
"id": "eth1/27",
"mode": "edge"
}
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
POST: http://<IP_Address>/restconf/data/Cisco-NX-OS-device:
<stp-items>
<inst-items>
<if-items>
<If-list>
<id>eth1/27</id>
<mode>edge</mode>
</If-list>
</if-items>
</inst-items>
</stp-items>
</System>
CLI Commands
interface ethernet 1/27
spanning-tree port type edge
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the opt-left corner of the pane on the right to view the JSON payload. Click the YANG tab to view the xML payload.
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Disabling Portfast
Disabling Portfast
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpIf": {
"attributes": {
"id": "eth1/27",
"mode": "default"
}
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
POST: http://<IP_Address>/restconf/data/Cisco-NX-OS-device:
<stp-items>
<inst-items>
<if-items>
<If-list>
<id>eth1/27</id>
<mode>default</mode>
</If-list>
</if-items>
</inst-items>
</stp-items>
</System>
CLI Commands
interface ethernet 1/27
no spanning-tree port type edge
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the opt-left corner of the pane on the right to view the JSON payload. Click the YANG tab to view the xML payload.
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring VLAN Switch Spanning Trees
Configuring VLAN Switch Spanning Trees
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpVlan": {
"attributes": {
"adminSt": "enabled",
"id": "1"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<vlan-items>
<Vlan-list>
<id>1</id>
<adminSt>enabled</adminSt>
</Vlan-list>
</vlan-items>
</inst-items>
</stp-items>
</System>
Note: This example was added in Release 9.2(2).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree vlan 1
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting VLAN Switch Spanning Trees
Deleting VLAN Switch Spanning Trees
POST http://<mgmt0_IP>/api/mo/sys/stp/inst.json
{
"stpInst": {
"children": [
{
"stpVlan": {
"attributes": {
"adminSt": "disabled",
"id": "1"
}}}]}}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<vlan-items>
<Vlan-list>
<id>1</id>
<adminSt>disabled</adminSt>
</Vlan-list>
</vlan-items>
</inst-items>
</stp-items>
</System>
Note: This example was added in Release 9.2(2).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree vlan 1
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Configuring Multiple Spanning Tree (Setting the Switch as Primary Root and the Hello-Time Interval)
Configuring Multiple Spanning Tree (Setting the Switch as Primary Root and the Hello-Time Interval)
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"children": [
{
"stpMstDom": {
"attributes": {
"diameter": "2",
"id": "9",
"rootMode": "enabled",
"rootType": "primary"
}
}
},
{
"stpMstDom": {
"attributes": {
"diameter": "2",
"id": "7",
"rootMode": "enabled",
"rootType": "primary"
}
}
},
{
"stpMstDom": {
"attributes": {
"diameter": "2",
"id": "8",
"rootMode": "enabled",
"rootType": "primary"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<mst-items>
<MstDom-list>
<id>9</id>
<diameter>2</diameter>
<rootMode>enabled</rootMode>
<rootType>primary</rootType>
</MstDom-list>
<MstDom-list>
<id>7</id>
<diameter>2</diameter>
<rootMode>enabled</rootMode>
<rootType>primary</rootType>
</MstDom-list>
<MstDom-list>
<id>8</id>
<diameter>2</diameter>
<rootMode>enabled</rootMode>
<rootType>primary</rootType>
</MstDom-list>
</mst-items>
</mstent-items>
</inst-items>
</stp-items>
</System>
Options for configuring the switch as root:
- primary - Configure this switch as primary root for this spanning tree
- secondary - Configure this switch as secondary root
Note: This example was added in Release 9.2(2).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
spanning-tree mst 7-9 root primary diameter 2 hello-time 7
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Deleting a Multiple Spanning Tree Configuration
Deleting a Multiple Spanning Tree Configuration
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"stpEntity": {
"children": [
{
"stpInst": {
"children": [
{
"stpMstEntity": {
"children": [
{
"stpMstDom": {
"attributes": {
"id": "9",
"rootMode": "enabled",
"rootType": "none"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "7",
"rootMode": "enabled",
"rootType": "none"
}
}
},
{
"stpMstDom": {
"attributes": {
"id": "8",
"rootMode": "enabled",
"rootType": "none"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<stp-items>
<inst-items>
<mstent-items>
<mst-items>
<MstDom-list>
<id>9</id>
<rootMode>enabled</rootMode>
<rootType>none</rootType>
</MstDom-list>
<MstDom-list>
<id>7</id>
<rootMode>enabled</rootMode>
<rootType>none</rootType>
</MstDom-list>
<MstDom-list>
<id>8</id>
<rootMode>enabled</rootMode>
<rootType>none</rootType>
</MstDom-list>
</mst-items>
</mstent-items>
</inst-items>
</stp-items>
</System>
Note: This example was added in Release 9.2(2).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no spanning-tree mst 7-9 root primary diameter 2 hello-time 7
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html
For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html