Configuring Network Bonding in RHEL with the Red Hat System Roles network role
Use the Red Hat Enterprise Linux System Roles network role to create an active‑backup bond with Ansible, see the example playbook, limits, and verification steps.
18 Dec 2025, 05:24 UTC

Solution: Use the network role to create an active‑backup bond
On Red Hat Enterprise Linux 8 and later you can declaratively configure a bonding interface with the supported rhel-system-roles.network Ansible role. The role translates a simple variable list into the appropriate nmstate or ifcfg files, ensuring the bond is created consistently across hosts.
How the network role works
The role reads the network_connections variable. Each entry defines a connection type (bond, bridge, ethernet, etc.). For a bond you specify type: bond, the interface name, bond options (like mode=active-backup miimon=100), and IPv4 settings. The role applies the configuration with become: true so it runs with root privileges.
Example playbook
# File: bond0-playbook.yml
- hosts: all
vars:
network_connections:
- name: bond0
type: bond
interface_name: bond0
bond_options: mode=active-backup miimon=100
ipv4:
address: 192.168.10.10/24
gateway: 192.168.10.1
# optional: define slave interfaces if they are not already present
# port:
# - eth0
# - eth1
roles:
- rhel-system-roles.network
Run the playbook from your Ansible control node:
ansible-playbook -i bond0-playbook.yml
You need sufficient privileges to modify network settings; the role uses become: true internally, so the invoking user must be allowed to become root (e.g., via sudo).
Verification
After the playbook finishes, log in to a managed host and check:
ip link show bond0– should list bond0 as UP and show the slave interfaces.cat /proc/net/bonding/bond0– confirms the active‑backup mode and the currently active slave.
To catch syntax errors before execution, run:
ansible-playbook --syntax-check bond0-playbook.yml
To preview changes without applying them, use:
ansible-playbook -i --check bond0-playbook.yml
Limits and common mistakes
- The
rhel-system-rolespackage must be installed on the control node (available in the RHEL Extras repository). Without it the role cannot be found. - The role only exposes parameters defined in its upstream specification; unsupported bond options (e.g., obscure
lacp_ratevalues) will be ignored or cause a failure. - Omitting
become: true(or relying on become elsewhere) leads to silent failures because the role cannot write network configuration files. - Forgetting to install the role before running the playbook results in an error like “ERROR! the role 'rhel-system-roles.network' was not found”.
- Network changes can disrupt connectivity; test the playbook first with
--checkor on a non‑production host.
Rollback
If you need to revert the bond, remove the bond entry from network_connections and re‑run the playbook, or delete the connection manually:
nmcli connection delete bond0
After deletion, verify that bond0 no longer appears in ip link show.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.