bridge
Manages a Linux bridge interface at runtime via ip link, optionally enslaving member ports and persisting the bridge to the host network config. Idempotent: re-applying an unchanged declaration reports no change.
Category: Network (base)
States
| State | Meaning |
|---|---|
present | The bridge interface exists; member ports are enslaved at creation, and (with persist) the host network config matches. |
absent | The bridge interface does not exist; any persistent config files for it are removed. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Bridge interface name, e.g. br0 (max 15 chars; letters, digits, and ._-). |
members | list | Interface names to enslave as bridge ports at creation (state present only). | |
stp | bool | Enable Spanning Tree Protocol on the bridge. Default: false. | |
persist | string | Persist the bridge to the host network config: networkd, netplan, or auto. Omit for runtime-only (does not survive reboot). |
Examples
Runtime-only bridge with member ports
bridge:
br0:
state: present
members:
- eth0
- eth1
stp: trueBridge persisted via systemd-networkd
persist also renders the bridge to the host network config so it survives a reboot.
bridge:
br0:
state: present
members:
- eth0
persist: networkdRemove a bridge
bridge:
br0:
state: absentNotes
- Linux only; created and removed via
ip link. Other operating systems are unsupported. - Optional boot persistence backends:
networkdandnetplan(autodetects). Withoutpersistthe bridge is runtime-only and does not survive a reboot. - No in-place reconciliation: if a bridge with this name already exists it is considered converged regardless of
stp/members. To change a live bridge, delete it (stateabsent) then re-declare it (planned, #28). membersis only valid with statepresent; onabsentthe bridge is deleted and its ports are released automatically.