#3405 Issue closed: rear checklayout does not check the NetworkManager configuration files on RHEL 9

Labels: fixed / solved / done, minor bug

gdha opened issue at 2025-02-18 13:05:

ReaR version

Relax-and-Recover 2.6 / 2020-06-17

Describe the ReaR bug in detail

No IP address bounded to the network interfaces on RHEL 9 once booted into ReaR rescue image.
Reason:

2025-02-25 14:15:52.073838813 Detected an active Network Manager connection 'lo' set up via DHCPv6
2025-02-25 14:15:52.080518586 Auto-enabling DHCP on the rescue system

Platform

Linux x64

OS version

RHEL 9.5

Backup

NETFS

Storage layout

RHEL 9 is using the NetworkManager and not the legacy network scripts. Therefore, we also better update the current 450_check_network_files.sh script with this one:

#-> cat /usr/share/rear/layout/save/default/450_check_network_files.sh
# This file is part of Relax-and-Recover, licensed under the GNU General
# Public License. Refer to the included COPYING for full text of license.

if [[ -d /etc/sysconfig/network ]] ; then
    # SUSE
    ls /etc/sysconfig/network/ifcfg-* >/dev/null 2>&1 && CHECK_CONFIG_FILES+=( /etc/sysconfig/network/ifcfg-* )
fi


if [[ -d /etc/NetworkManager/system-connections ]] ; then
    # Red Hat >= 8
    # Check if the network interfaces are really present in NetworkManager style and if yes also add nmcli to PROGS array
    ls /etc/NetworkManager/system-connections/*.nmconnection >/dev/null 2>&1 && CHECK_CONFIG_FILES+=( /etc/NetworkManager/system-connections/*.nmconnection )
    PROGS+=( nmcli )
fi

if [[ -d /etc/sysconfig/network-scripts ]] ; then
    # Red Hat <=8
    # Check if the network interfaces are really present in legacy network configuration files
    ls /etc/sysconfig/network-scripts/ifcfg-* >/dev/null 2>&1 && CHECK_CONFIG_FILES+=( /etc/sysconfig/network-scripts/ifcfg-* )
fi

if [[ -d /etc/network ]] ; then
    # Debian
    CHECK_CONFIG_FILES+=( /etc/network/interfaces )
fi

if [[ -d /etc/netplan ]] ; then
   # Ubuntu using NetworkManager
   CHECK_CONFIG_FILES+=( /etc/network/*.yaml )
   PROGS+=( nmcli )
fi

What steps will reproduce the bug?

Well, the side effect seems that on RHEL 9 it wants to use dhclient as ReaR had no knowledge about the network manager configuration. And, interface lo seems to enable DHCPv6.
On RHEL 8 and older versions the legacy network scripts were used.
We had to add the IP address manual on the console once booted into ReaR.

Workaround, if any

Add in /etc/rear/local.conf file:

USE_STATIC_NETWORK=yes

Additional information

No response


[Export of Github issue for rear/rear.]