Configuring bonding in RHEL7 with NetworkManager (nmcli) - persistence problems

Latest response

Hi all,

I'm experiencing problems when configuring a bonded interface on RHEL7. After reading the networking guides and documentation I've found a way to get it working, but for some reason that does not persist when rebooting. Hopefully I can get some guidance here from a real expert!

I configured the bonded interface using nmcli, with the commands below:

nmcli con add type bond con-name bond0 ifname bond0 mode active-backup;
nmcli con mod bond0 ipv4.addresses 192.168.40.1;
nmcli con mod bond0 ipv6.method ignore;
nmcli con mod bond0 ipv4.method manual;
nmcli con add type bond-slave ifname ens4f0 master bond0;
nmcli con add type bond-slave ifname ens4f1 master bond0;
nmcli con mod bond0 +bond.options mii=100
nmcli con mod bond0 +ipv4.routes 192.168.40.0/24
nmcli con up bond0;

I create the bonded interface, configure the network IP address, make sure IPv6 is disabled (for now, it's for an internal private network with only a few devices), and add the two slave interfaces. And this works! However, after a reboot it doesn't work, so there must be something that I'm missing (or something that I did before I made this config that messes up my configuration during boot time.

Here's what I see in /var/log/messages after the reboot:

Feb 15 15:09:53 dps-cloud01 NetworkManager[1027]: <info>  ifcfg-rh: new connection /etc/sysconfig/network-scripts/ifcfg-bond0 (ad33d8b0-1f7b-cab9-9447-ba07f855b143,"bond0")
Feb 15 15:09:53 dps-cloud01 NetworkManager[1027]: <info>  (bond0): new Bond device (carrier: OFF, driver: 'bonding', ifindex: 8)
Feb 15 15:10:03 dps-cloud01 network: Bringing up interface bond0:  Error: Connection activation failed: Connection 'bond0' is not available on the device bond0 at this time.
Feb 15 15:10:03 dps-cloud01 network: Bringing up interface bond-slave-ens4f0:  Error: Connection activation failed: Master device bond0 unmanaged or not available for activation
Feb 15 15:10:03 dps-cloud01 network: Bringing up interface bond-slave-ens4f1:  Error: Connection activation failed: Master device bond0 unmanaged or not available for activation

The error message is not very helpful. After this, the NetworkManager has bond0 in an 'unmanaged' state, and attempting to start it manually gives the same error message (bond0 not available on the device bond0 at this time).

However, if I (at this point) delete the connections from NetworkManager (the 2 slaves and the bond), delete the device and then re-create the bond using the commands above, it works again. Here's the output of those commands:

[root@dps-cloud01 network-scripts]# nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
Connection 'bond0' (e11bd51a-735c-4b06-b633-ffe273b86e5c) successfully added.
[root@dps-cloud01 network-scripts]# nmcli con mod bond0 ipv4.addresses 192.168.40.1
[root@dps-cloud01 network-scripts]# nmcli con mod bond0 ipv6.method ignore;
[root@dps-cloud01 network-scripts]# nmcli con mod bond0 ipv4.method manual;
[root@dps-cloud01 network-scripts]# nmcli con add type bond-slave ifname ens4f0 master bond0;
Connection 'bond-slave-ens4f0' (7b053428-5301-487f-9b54-65050b36d187) successfully added.
[root@dps-cloud01 network-scripts]# nmcli con add type bond-slave ifname ens4f1 master bond0;
Connection 'bond-slave-ens4f1' (a4de5e3c-cea4-4eee-ba9f-8e7cb7dccf15) successfully added.
[root@dps-cloud01 network-scripts]# nmcli con up bond0;
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
[root@dps-cloud01 network-scripts]# ip route add 192.168.40.0/24 via 192.168.40.1 dev bond0;
[root@dps-cloud01 network-scripts]# ping 192.168.40.4 -c 1
PING 192.168.40.4 (192.168.40.4) 56(84) bytes of data.
64 bytes from 192.168.40.4: icmp_seq=1 ttl=64 time=0.271 ms

--- 192.168.40.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.271/0.271/0.271/0.000 ms

What am I doing wrong? Why is this NetworkManager configuration not persistent, or why is it failing during the boot process? Which other file/ script/thingy could be interfering?

Thanks a lot in advance for your help!

Kind regards,
Pieter van Wijngaarden
Erwin Kragt

Edit 2016-02-16:
Disabling the NetworkManager solves the problem:

# systemctl stop NetworkManager.service
# systemctl disable NetworkManager.service

There must be something in NetworkManager that messes things up. Please note that if you disable NetworkManager, you'll not be able to use nmcli (i.e. the commands above) or other NetworkManager interfaces. You'll need to fallback to editing the /etc/sysconfig/network-scripts directly if I'm not mistaken.

Responses

Thanks for helping, it really works!

So when defining the bonding in RHEL 7.x (7.4), should we disable the NetworkManager ? Is it recommended to turn NetworkManager off ?

All,

During training for RHEL 7 RCSA and RHCE we are taught to use teaming instead of bonding in combination with NetworkManager.

Alternative is use bondig with the old network service.

Regards,

Jan Gerrit

As this post indicates, I was able to use this solution successfully on rhel 7.9 and bonding configuration persisted after reboot. I don't use nmcli and prefer to edit files manually.