Skip to content

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

StateMeaning
presentThe bridge interface exists; member ports are enslaved at creation, and (with persist) the host network config matches.
absentThe bridge interface does not exist; any persistent config files for it are removed.

Parameters

ParameterTypeRequiredDescription
namestringyesBridge interface name, e.g. br0 (max 15 chars; letters, digits, and ._-).
memberslistInterface names to enslave as bridge ports at creation (state present only).
stpboolEnable Spanning Tree Protocol on the bridge. Default: false.
persiststringPersist 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: true

Bridge 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: networkd

Remove a bridge

bridge:
  br0:
    state: absent

Notes

  • Linux only; created and removed via ip link. Other operating systems are unsupported.
  • Optional boot persistence backends: networkd and netplan (auto detects). Without persist the 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 (state absent) then re-declare it (planned, #28).
  • members is only valid with state present; on absent the bridge is deleted and its ports are released automatically.