Port Bonding / using script / instread of nmcli or nmtui

Hi i am starting using Rocky linux 9.2 instead of Centos 7.9
in Centos i can create port bonding between the two ports using scripts as below
i added a new ifcfg-file as bond
then i add additional lines on each port of the bonding that will be used

the question is , how i can do the same scripts on Rocky 9.2
i have tried the same procedures but it doesn’t work for me

> additional scripts add on each Ethernet port
NM_CONTROLLED=no
MASTER=bondm
SLAVE=yes
USERCTL=no

Main Bonding file
ifcfg-bondm
DEVICE=bondm
NAME=bondm
USERCTL=no
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS=“miimon=100 mode=active-backup”
TYPE=Bond
BONDING_MASTER=yes
IPADDR="172.16.133.123
NETMASK=“255.255.255.0”
GATEWAY=“172.16.133.1”

First: Rocky 9.2 is no longer supported. The Rocky 9 is currently based on RHEL 9.3 content.


I have set up a LACP bond with Ansible playbook like one below.
For that one needs at least packages ansible-core and rhel-system-roles. (The latter provides /usr/share/ansible/roles/rhel-system-roles.network/README.md)

- hosts: all
  vars:
    network_connections:
    - name: bond0
      type: bond
      interface_name: bond0
      ip:
        address:
        - 172.16.133.123/24
        gateway4: 172.16.133.1
        ipv6_disabled: true
      ethtool:
        features: {}
      state: up
      bond:
        mode: 802.3ad
        lacp_rate: fast
        xmit_hash_policy: layer2+3
    - name: bond0-ens7f1
      type: ethernet
      interface_name: ens7f1
      controller: bond0
      port_type: bond
      state: up
    - name: bond0-ens6f1
      type: ethernet
      interface_name: ens6f1
      controller: bond0
      port_type: bond
      state: up
  roles:
  - rhel-system-roles.network

Hi Thank you very much for your feedback
as far as i understand its not longer support the scripts
and need to install these packages
ansible-core
rhel-system-roles
also where i can add the Ansible playbook that you mentioned in which folder for example /etc/sysconfig/network-scripts or something different
there are any commands need to be run after adding the Ansible playbook , like systemctl restart NetworkManager or another command
also i have another questions did these packages effect on any kind of processing because we depends on the CPU for video encoding this is why i don’t need any tools to effect the processing

The Ansible is essentially a python script that you run when you want to – not a service that runs as background process.

The RHEL System Roles are “modules” that expand what the Ansible can do – more code for the script and the playbooks are input, parameters to run the script with.


As example, I have my own machine where I run Ansible. If the playbook were named bond.ymland I would want to run it for host “node01”, then I could run:

ansible-playbook -l node01 bond.yml

This requires two additional things:

  • Create inventory for Ansible that lists ‘node01’ as one of the hosts
  • Ability to ssh into node01, preferably with ssh-keys

The ‘node01’ won’t need the Ansible packages at all.


If the packages are installed in the node01 and the playbook file is in it too, then one can run in it:

ansible-playbook -l localhost bond.yml

Whether one can do that already in %post of a kickstart – I have never tried.


Point is, Ansible does not affect “processing” any more than your own scripts.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.