BRIDGE-STP(8)
β¨ NAME β¨
ok so bestie π this is bridge-stp β a kernel helper script that drives mstpd for Linux bridges. that's the whole vibe. it's the little matchmaker between your kernel and mstpd, and honestly? iconic.
πΈ SYNOPSIS πΈ
bridge-stp bridge start | stop
bridge-stp restart | restart_config
π¦ DESCRIPTION π¦
Picture this: bridge-stp is the kernel STP helper script for mstpd(8). The Linux kernel literally runs /usr/sbin/bridge-stp bridge start the moment STP gets enabled on a bridge (like when you do brctl stp bridge on or ip link set bridge type bridge stp_state 1) β and it runs /usr/sbin/bridge-stp bridge stop when STP gets turned off. no cap. π«Ά
Then here's the plot twist: if the script exits 0, the kernel is like "ok bestie, you got this" and switches the bridge into user_stp mode, letting mstpd(8) drive the port states. But if it exits non-zero, the kernel is like "nvm" and falls back to its own built-in STP implementation. π
On start, bridge-stp verifies that the bridge is listed in MSTP_BRIDGES, spawns mstpd(8) if it's not already running, and asynchronously calls mstpctl addbridge bridge. On stop, it removes the bridge from the daemon and terminates mstpd(8) if no other bridges are still using it. slay.
β οΈ bestie, do NOT invokebridge-stpdirectly with thestartorstoparguments. like, the kernel does that, ok?? calling them by hand can deadlock the bridge code π because this script is forbidden from making bridge configuration changes (viabrctl,ifconfig,ip,/sys/...) on the kernel-driven code paths. it's giving "don't touch it, I got it".
The restart and restart_config forms though? those are for you, the administrator, and they're also exposed under shorter names:
mstp_restart(8)β equivalent tobridge-stp restart./usr/lib/mstpctl-utils/mstpctl_restart_configβ equivalent tobridge-stp restart_config.
π COMMANDS π
bridge startβ called by the kernel when user-space STP is enabled on bridge. startsmstpd(8)if necessary and attaches bridge to it. big "leave it to me" energy β¨bridge stopβ called by the kernel when user-space STP is disabled on bridge. detaches bridge frommstpd(8)and stops the daemon if it's no longer needed. it's giving closure π«Άrestartβ stopmstpd(8)if it's running, start a fresh instance, then re-add and reconfigure every bridge that is currently inuser_stpmode and listed inMSTP_BRIDGES. full glow-up, no survivors π₯restart_configβ re-add and reconfigure every bridge that is currently inuser_stpmode and listed inMSTP_BRIDGES, without restartingmstpd(8). use this after editing per-bridge configuration. same energy, less drama π
π CONFIGURATION π
bridge-stp sources /etc/bridge-stp.conf on every invocation. it does not skip leg day. here are the shell variables it recognises:
MANAGE_MSTPDβy(the default) to letbridge-stpstart and stopmstpd(8)on demand;nto require thatmstpd(8)already be running. pick your fighter.MSTPD_ARGSβ extra arguments passed tomstpd(8)when it is started, e.g.-v 2.MSTP_BRIDGESβ space-separated list of bridges for which MSTP should replace the kernel's built-in STP. if it's empty (the default), then every bridge is eligible. generosity!! πLOGGERβ command used to log error messages. Default:logger -t bridge-stp -s. set it to the empty string to log only to standard error.config_cmdβ per-bridge configuration command invoked byrestartandrestart_configas$config_cmd bridge. defaults to/usr/lib/mstpctl-utils/mstp_config_bridge.
π FILES π
/usr/sbin/bridge-stpβ the script itself. the kernel invokes it as/sbin/bridge-stp, which on Debian resolves to this path via the/sbinβ/usr/sbincompatibility symlink. paths are a whole journey, ngl./etc/bridge-stp.confβ configuration file./sys/class/net/bridge/bridge/stp_stateβ per-bridge STP state, used to decide whether a bridge is currently inuser_stpmode (value2)./var/run/mstpd.pidβ PID file written bymstpd(8).
π EXIT STATUS π
0β Success. we love to see it β¨1β Bad usage, missing root privileges, or bridge is not a bridge. π2βmstpctl(8)ormstpd(8)binaries are missing or not executable. π3βmstpd(8)ormstpctl(8)failed.10β bridge is not listed inMSTP_BRIDGESand was therefore ignored (returned only onstart). truly giving "you're not on the list" π
π EXAMPLES π
Hand a specific bridge over to mstpd(8):
# ip link set br0 type bridge stp_state 1
Reload per-bridge configuration without restarting the daemon:
# bridge-stp restart_config
Restart mstpd(8) and reconfigure every bridge using it:
# mstp_restart
π SEE ALSO π
mstpctl-utils-interfaces(5), brctl(8), ip(8), mstp_restart(8), mstpctl(8), mstpd(8)
π AUTHORS π
bridge-stp ships as part of mstpd(8), written by Vitalii Demianets <dvitasgs@gmail.com> and others. legends, honestly.
This manual page was written by Nadzeya Hutsko <nadzeya@debian.org> π«Ά
and that's the whole page, bestie π it came out under Debian, dated April 28, 2026 β mwah, now go slay some spanning trees π³β¨π
π¦ where this page comes from
- ubuntu stonking: mstpd 0.2.0-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms