bond
Manages a Linux bonding (link-aggregation) interface — creates it at runtime via ip link with the declared mode, members, and link-monitor interval, with optional boot persistence to networkd or netplan. Idempotent: once the bond exists with the right kind, re-applying reports no change.
Category: Network (base)
States
| State | Meaning |
|---|---|
present | A bond interface with the declared name exists (created with mode, members, and miimon when absent); boot config is written when persist is set. |
absent | No interface of this name exists; an existing bond is deleted (members are released) and any persistent boot config is removed. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Bond interface name, e.g. bond0 (max 15 chars; letters, digits, and ._-). |
mode | string | Bonding mode: a name (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb) or its numeric form 0-6. Default: balance-rr. | |
members | list | Interfaces to enslave at creation time (state present only); each is set master on the bond. | |
miimon | int | Link-monitor interval in milliseconds; 0 disables. Unset uses the kernel default. | |
persist | string | Boot-persistence backend: networkd, netplan, or auto. Unset = runtime-only (does not survive a reboot). |
Examples
Active-backup bond over two NICs
bond:
bond0:
state: present
name: bond0
mode: active-backup
members:
- eth0
- eth1
miimon: 100802.3ad LACP bond persisted via networkd
With persist the bond is also written to the host network config so it survives a reboot.
bond:
bond0:
state: present
name: bond0
mode: "802.3ad"
members:
- eth0
- eth1
persist: networkdRemove a bond
bond:
bond0:
state: absent
name: bond0Notes
- Linux only — bonds are created via
ip link; other operating systems are unsupported. - No in-place attribute or member reconciliation: once the bond exists with kind
bond,mode,miimon, andmembersare not reconciled. To change a live bond, declare itabsentthen re-declare it (members are released, traffic interrupted). membersis only valid with statepresent;absentdeletes the bond and releases members automatically.- Persistence backends are
networkdandnetplan(orauto); NetworkManager and ifupdown are out of scope. - An interface that exists with a non-
bondkind is left untouched (the module refuses to clobber it).