rstpctl man page

rstpctl — rstpd spanning tree protocol administration


rstpctl [command]


rstpctl is used to set up, maintain, and inspect the bridge RSTP configuration for ethernet bridges as implemented using rstpd(8). rstpd implements the spanning tree algorithm specified by the Rapid Spanning Tree Protocol (RSTP). An implementation of the original Spanning Tree Protocol (STP) is provided by the Linux kernel bridging code and can be enabled and controlled using the brctl command.


rstpctl rstp <bridge> {on|off} configures whether rstpd implements RSTP (Rapid Spanning Tree Protocol) for the specified bridge. The remaining commands are applicable only if rstpd is configured to run RSTP on that bridge.

rstpctl showbridge [<bridge> ... ] displays the spanning tree configuration and status for the specified bridges. If no bridges are given, it displays the information for all bridges.

rstpctl showport <bridge> [<port> ... ] displays, as one line per port, the spanning tree configuration and status for the specified ports. If no ports are specified, it displays the information for all ports of the bridge.

The format of the line is :
pes  name iiii sss  rrrr-rootbridgeid dddd-desgbridgeid dprt R
where the following abbreviations are used.

p: '*' if the port link is not point to point, ' ' otherwise.
e: 'E' if the port is operating as an edge port, ' ' otherwise.
s: 's' if the port is in STP (slow) mode, ' ' otherwise.
name: The name of the port, i.e, the network interface name.
iiii: The port id, containing the port priority and port number
sss: The port state, one of Dis (disabled), Blk (blocking), Lrn (learning), Fwd (forwading), Non (non-stp), Unk (unknown).
rrrr-rootbridgeid: Root bridge id, including priority.
dddd-desgbridgeid: Designated bridge id, including priority
dprt: Designated port id
R: Port role, one of 'A' (alternate), 'B' (backup), 'R' (root), 'D' (designated), '-' (non-stp)

rstpctl showportdetail <bridge> [<port> ... ] displays the spanning tree configuration and status for the specified ports much more verbosely. If no ports are specified, it displays the information for all ports of the bridge.

rstpctl setbridgestate <bridge> {on|off} enables/disables the operation of RSTP. When RSTP is configured with the rstp subcommand listed above, the default is enabled.

rstpctl setbridgeprio <bridge> <priority> sets the bridge's priority to <priority>. The priority value is a number between 0 and 61440 in steps of 4096, and defaults to 32768. Lower priority values are 'better'. The bridge with the lowest priority will be elected 'root bridge'.

rstpctl sethello <bridge> <time> sets the bridge's 'bridge hello time' to <time> seconds.

rstpctl setmaxage <bridge> <time> sets the bridge's 'maximum message age' to <time> seconds.

rstpctl setfdelay <bridge> <time> sets the bridge's 'bridge forward delay' to <time> seconds.

rstpctl setforcevers <bridge> {normal|slow} sets the bridge's spanning tree algorithm to operate in normal (i.e. RSTP) mode or force it to operate in slow (i.e. old STP) mode. In normal mode, RSTP falls back to STP on ports where it sees other hosts operating in STP mode.

rstpctl setportprio <bridge> <port> <priority> sets the ports's priority to <priority>. The priority value is a number from 0 to 240 in steps of 16, defaulting to 128.

rstpctl setportpathcost <bridge> <port> <cost> sets the ports's path cost to <cost>. This is by default set automatically based on the link speed. This setting overrides the automatic setting. Setting this to zero puts it back in automatic mode.

rstpctl setportedge <bridge> <port> {yes|no} sets or unsets the port's configures as an edge port. If a port is an edge port, then it is assumed to be a leaf link in the graph, not connected to any other bridges. Receiving any STP BPDU's on a port configured as an edge port turns off edge port behaviour for the port.

rstpctl setportnonstp <bridge> <port> {yes|no} : Setting this to yes disables RSTP operation on the port, which then is always kept in FORWARDING state.

rstpctl portmcheck <bridge> <port> : This command is used when the port is operating in STP compatibility mode. I causes the bridge to transmit RSTP BPDUs and to test the hypothesis that non RSTP hosts have been removed from the LAN connected to the port, and if that is the case, the remaining hosts switch back to RSTP mode.

rstpctl debuglevel <level> sets the level of verbosity of rstpd's logging.


TODO: Indicate lack of persistence of configuration across restarts of daemon.

See Also

rstpd(8), brctl(8)


Srinivas Aji <>

Referenced By


August 20, 2006