Rocky Linux 10 Tutorial / NetworkManager devices, profiles and nmcli

In Rocky Linux 10, NetworkManager's device is the actual network interface, and connection profile is a set of settings such as address and auto-connect applied to that device. Before changing settings, you should check the device name, the UUID of the currently active profile, and the assigned address and routes together to avoid modifying the wrong connection.

Device names and profile names are different targets

NetworkManager is a service that manages network settings and connection status. nmcli is a tool to view and manipulate this service from the command line. Not only physical network cards but also virtual cards in virtual machines, loopback, and virtual interfaces can appear in the device list.

Target Meaning Example of this practice
Device · Interface The target that the operating system uses for communication. Check in the DEVICE column enp0s3
Profile Name The name of the setting bundle distinguished by a person. NAME or connection.id The name first installed is also enp0s3
Profile UUID A unique identifier specifying the profile. Check separately from the name 52b8deec-25d4-3136-b6ef-d1290ca271ef
Active Connection The running status of the profile currently used by the device Originally, the enp0s3 profile is active on the enp0s3 device
Saved File A file storing a profile to be used persistently enp0s3.nmconnection

Immediately after installation, the device and profile have the same name, so it is easy to confuse the two. However, changing the profile name does not change the device name. You can prepare multiple profiles for work network and practice network on the same Ethernet device, and you can check which profile the device is currently using by looking at the active status. Configurations such as virtual private network (VPN), bridge built on other connections, or combining multiple devices are not simply interpreted as 'only one connection is active for the entire server.'

The source lab used a Rocky Linux 10.2 minimal installation virtual machine using NetworkManager 1.56.0-3.el10_2 and iproute 6.17.0-2.el10. While maintaining the basic Ethernet connection, only queries and creation/cleanup of inactive practice profiles were performed.

Identify the device, active UUID, address and routes

The following command queries the current status. The output wording may vary depending on the system language.

nmcli general status
nmcli -f DEVICE,TYPE,STATE,CONNECTION device status
nmcli -f NAME,UUID,TYPE,DEVICE connection show
nmcli -f NAME,UUID,TYPE,DEVICE connection show --active
ip -4 -brief address
ip -4 route

Find the device to work with in device status, and compare the CONNECTION in that row with the profile list. Names may be duplicated or contain spaces, so record the UUID of the actual target. The UUID (Universally Unique Identifier) is a unique identifier that distinguishes profiles and is not the device's serial number or IP address.

The correspondences checked on this VM are as follows. The addresses below are values observed in the VirtualBox network address translation (NAT) sandbox network and should not be directly assigned to a corporate network or other virtualization environments.

Device: enp0s3
Active profile: enp0s3
IPv4 address: 10.0.2.15/24
Default route: default via 10.0.2.2 dev enp0s3
Profile UUID: 52b8deec-25d4-3136-b6ef-d1290ca271ef

/24 is a prefix length that indicates the length of the network portion of the address. The default route is the exit used when sending to a destination without a more specific route. If there are multiple cards, just knowing that an address exists does not tell you which card is the default exit, so the route is also read together.

Subsequent examples are executed while keeping variables in the same Bash session. First, replace DEV with your device name and check if the query result corresponds to the intended device.

DEV=enp0s3
ACTIVE_UUID=$(nmcli -g GENERAL.CON-UUID device show "$DEV")
printf 'Device=%s\nActive UUID=%s\n' "$DEV" "$ACTIVE_UUID"
nmcli -f GENERAL,IP4 device show "$DEV"

If ACTIVE_UUID is empty or --, it means an active profile has not been found. Do not move on to the next change exercise; first check the device name and connection status. The loopback lo is an interface that communicates with itself and is generally not chosen as a target for external network connections.

Differentiate between stored settings and currently assigned addresses.

The profile's configuration values may not match the current device's operational values. In the next command, the first query shows the stored configuration items, and the second shows the actual IPv4 address, gateway, and DNS information.

nmcli -f connection.id,connection.uuid,connection.interface-name,connection.autoconnect,ipv4.method,ipv4.addresses,ipv4.gateway,ipv4.dns connection show uuid "$ACTIVE_UUID"
nmcli -f IP4 device show "$DEV"

The ipv4.method of the practice VM was auto, and the ipv4.addresses, ipv4.gateway, ipv4.dns of the profile were --. However, the actual state of the device had address 10.0.2.15/24, gateway 10.0.2.2, and DNS server 8.8.8.8. Since DHCP (Dynamic Host Configuration Protocol) is a method for automatically receiving information such as addresses, you should not assume the network is not configured just because the manual address field is empty.

DNS (Domain Name System) is a system for finding addresses from names. The DNS addresses observed on this VM are the results of the given practice environment and are not recommended settings for all servers. If your organization has internal name resolution or security policies, you should follow the designated DNS.

connection.autoconnect is a setting that determines whether it can be a candidate for automatic activation, and it is not an indicator of whether it is currently active. Even if automatic connection is turned off, an administrator can explicitly activate it. The current state should be separately checked with connection show --active and device show. The meaning of profile properties and the distinction of active state can also be referred to together with NetworkManager official nmcli documentation .

Check the actual stored files and permissions.

The Rocky Linux 10 networking release notes state that legacy ifcfg network scripts are not supported. Do not configure Rocky Linux 10 using old /etc/sysconfig/network-scripts/ifcfg-* files or ifup and ifdown commands.

nmcli -f NAME,UUID,DEVICE,FILENAME connection show
sudo ls -l /etc/NetworkManager/system-connections/

The Ethernet profile for this VM was in /etc/NetworkManager/system-connections/enp0s3.nmconnection. Meanwhile, the loopback profile was in /run/NetworkManager/system-connections/lo.nmconnection. Do not assume that all profiles listed are necessarily persistent files in /etc; check the FILENAME.

The official keyfile documentation describes storage locations under /etc, /run and /usr/lib and their permission requirements. Connection files can contain credentials; do not publish them wholesale or enable secret-display options in logs. The source lab’s Ethernet file had owner root:root and permissions 600.

If a backup is needed, copy the actual file verified with FILENAME to a separate directory accessible only by root, preserving its attributes. For example, in this VM, the original Ethernet file is stored in /root/lf-course-13-before/, and after practice, it was confirmed to be the same as the original in cmp. nmcli connection export is not a command that backs up all Ethernet profiles, and according to the official description, the export target is the VPN connection.

Practice checking the differences in name, UUID, and file with inactive profiles.

This is a practice to observe the operation of the profile itself without changing work connections. Perform it on a dedicated virtual machine and check again whether DEV and ACTIVE_UUID have the previously confirmed values. The practice below creates a new profile from scratch as auto-connect no, and the activation command is not executed .

nmcli -g GENERAL.CON-UUID device show "$DEV"
nmcli -f NAME,UUID,DEVICE connection show
if nmcli -g NAME connection show | grep -Fxq lf-course-profile13; then
  printf 'This profile name already exists. Inspect the existing profile.\n'
else
  sudo nmcli connection add type ethernet ifname "$DEV" \
    con-name lf-course-profile13 autoconnect no \
    ipv4.method auto ipv6.method auto
fi

If a profile with the same name already existed, do not consider the one created in this practice and stop here. Only if a success message confirming new creation is received, store the UUID of the created profile in a variable and compare it with the saved list and the active list.

TEST_UUID=$(nmcli -g connection.uuid connection show id lf-course-profile13)
printf 'New test profile UUID=%s\n' "$TEST_UUID"
nmcli -f NAME,UUID,DEVICE,AUTOCONNECT,FILENAME connection show
nmcli -f NAME,UUID,DEVICE connection show --active

In the practice, the DEVICE of the new profile was --, and AUTOCONNECT was no, and only the existing enp0s3 and lo remained in the active list. This means that even if the new profile is saved targeting enp0s3, it is not currently applied to that device. Successfully saving and successfully communicating with the new settings are separate outcomes.

Now, check whether TEST_UUID is the inactive profile created this time and simply change the name. Use your own actual UUID and do not copy the UUID of another VM mentioned in the text.

nmcli -f connection.id,connection.uuid,connection.interface-name,connection.autoconnect connection show uuid "$TEST_UUID"
sudo nmcli connection modify uuid "$TEST_UUID" connection.id lf-course-profile13-renamed
nmcli -f NAME,UUID,DEVICE,AUTOCONNECT,FILENAME connection show

In the actual results, only the name changed to lf-course-profile13-renamed, and the UUID remained the same. The file name also retained the previous lf-course-profile13.nmconnection. Therefore, do not infer the profile name by looking at the file name or interpret that a new device has been created just because the name was changed.

In this VM, the following command was also executed, which reads only the practice file again. In other environments, use the path actually displayed in the previous FILENAME.

sudo nmcli connection load /etc/NetworkManager/system-connections/lf-course-profile13.nmconnection
nmcli -f NAME,UUID,DEVICE connection show --active
ip -4 -brief address show "$DEV"
ip -4 route

Even after reading the file again, the practice profile remained inactive, and the original active UUID, address, and default route were the same. This result shows that reading the saved file and activating the connection are different actions. This is not a practice of directly editing the file or restarting the NetworkManager service.

Delete only the test profile and verify the original connection

Before deletion, check the name, UUID, and automatic connection status again, and make sure TEST_UUID is not in the active list. Delete only this practice profile when all the conditions below are met. Do not apply to existing profiles or profiles currently in use.

if test -n "$TEST_UUID" \
  && test "$(nmcli -g connection.id connection show uuid "$TEST_UUID")" = lf-course-profile13-renamed \
  && test "$(LC_ALL=C nmcli -g connection.autoconnect connection show uuid "$TEST_UUID")" = no \
  && test "$TEST_UUID" != "$ACTIVE_UUID" \
  && ACTIVE_IDS=$(nmcli -g UUID connection show --active) \
  && ! printf '%s\n' "$ACTIVE_IDS" | grep -Fxq "$TEST_UUID"; then
  sudo nmcli connection delete uuid "$TEST_UUID"
else
  printf 'Cleanup conditions do not match. Do not delete; inspect the actual state.\n'
fi
nmcli -f NAME,UUID,DEVICE,FILENAME connection show
nmcli -g GENERAL.CON-UUID device show "$DEV"
ip -4 -brief address show "$DEV"
ip -4 route

After actual cleanup, the new UUID and practice file were gone, and the UUID of the existing enp0s3 profile, 10.0.2.15/24 address, and 10.0.2.2 default gateway were maintained. The original profile file was also the same as the backup, and the NetworkManager, SSH service, and SELinux Enforcing status were preserved. The new profile was never activated, so this is not expressed as a result of testing fixed IP conversion or failure recovery.

Distinguish saved settings, file reloads and activation

Command types Main roles Points to judge
connection show, device show Check profile and device status Compare the settings with the current operating values together
connection add, connection modify Create or modify a settings bundle Do not assume the current address changes just because saving succeeds
connection load, connection reload Load specific profile files or reload all profile files Distinguish between reading and activating connections when directly modifying a file
connection up, connection down Activate or deactivate connections Recovery console and planning are needed as it may affect remote access
device reapply Attempt to reapply changes supported by the active device Do not guarantee all types of setting changes without interruption

In inquiry, if disconnected appears, check whether the device exists but is currently not connected; if unmanaged appears, verify if it is managed by NetworkManager. If the card itself does not exist, investigate virtual card connection, drivers, and device list before repeatedly adding the profile. When a permission error occurs, check the current user and allowed management privileges rather than expanding file permissions.

The task of changing the address and gateway on a remote server should be planned after the current connection identification is completed. Check for an access path independent of SSH, as described in the VM networking and recovery console lesson. Record the active UUID, address, routes and profile file before making changes. Understanding this mapping lets you choose the right profile and verify the result.