How do I manage the "lo" loopback interface using NetworkManager?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux
  • NetworkManager service
  • Loopback network interface lo

Issue

  • How do I manage the lo loopback interface using NetworkManager?
  • The lo interface is shown as "unmanaged" in nmcli.
  • NetworkManager is not managing the loopback

Resolution

RHEL 9.2

Managing the loopback interface is possible in NetworkManager 1.41.6 and later in RHEL 9.2.

Remove any legacy configuration file:

mv /etc/sysconfig/network-scripts/ifcfg-lo /root

Reload configuration files:

nmcli con reload

Add a new loopback keyfile connection:

nmcli con add connection.id lo connection.type loopback connection.interface-name lo connection.autoconnect yes

Activate it:

nmcli con up lo

Any additional changes can be applied to the loopback:

nmcli con mod ...
nmcli con up lo

RHEL 9.1 and earlier

Depending on needs, there are multiple ways to configure the loopback interface or provide similar functionality:

Root Cause

NetworkManager traditionally did not manage the loopback interface by design.

Red Hat customer Requests For Enhancement resulted in upstream work to add it, which was done in NetworkManager 1.41.6 with:

This is a large feature and was deemed too risky to backport to RHEL 8's earlier NetworkManager code.

Diagnostic Steps

Check the device state using older NetworkManager:

# nmcli device show
DEVICE      TYPE      STATE      CONNECTION
lo          loopback  unmanaged  --
net0        ethernet  connected  net0

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments