Neighbours
ovs-appctl
Asks a running Open vSwitch for internal state the database does not show — here, its Rapid Spanning Tree view.
ovs-appctl sends a command to a live Open vSwitch daemon and prints what it answers. ovs-appctl rstp/show br0
is the one to know for spanning tree: it prints the bridge's RSTP view — the root it sees, its own bridge ID, and
each port with its role (Root, Designated, Alternate) and state (Discarding, Learning, Forwarding). The root
bridge says This bridge is the root. (stp/show is the same for classic 802.1D.) The matching per-port values are
also in the database — ovs-vsctl get port NAME rstp_status — for scripting.
ovs-appctl command usage
ovs-appctl rstp/show [BRIDGE] ovs-appctl stp/show [BRIDGE]
Options
-
rstp/show br0 - br0's Rapid Spanning Tree roles and states
-
stp/show br0 - the same for classic 802.1D
ovs-appctl examples
-
ovs-appctl rstp/show br0 - Prints the root, the bridge's own ID, and each port's role and state.
-
ovs-vsctl get port floor1 rstp_status:rstp_port_role - Reads one port's RSTP role from the database, for a script.
Reading the output
$ ovs-appctl rstp/show br0 ---- br0 ---- Root ID: stp-priority 4096 This bridge is the root Interface Role State Cost ---------- ---------- ---------- ---- floor1 Designated Forwarding 200 printer Designated Forwarding 200
- This bridge is the root: it has the lowest bridge ID.
- An Alternate port shown Discarding is the backup that breaks the loop.
Pitfalls
- The roles update as the tree converges: read twice a second apart and compare if you need a settled view.
ovs-appctlneeds the daemon running; it talks to it over a unix socket, not the network.