Rocky Linux 10 Tutorial / Static IPv4, DNS and checkpoint recovery

The static IPv4 address and DNS in Rocky Linux 10 should be stored in the NetworkManager connection profile, activated, and then verified with actual address, route, name lookups, and new remote connections. When changing remotely, ensure you have a recovery console and the existing settings; prepare a timed checkpoint that attempts to restore the previous connection unless you explicitly confirm the change.

Set allocation conditions and recovery paths before the address

A static IP is not a configuration where you arbitrarily choose numbers. You must confirm the address, prefix length, gateway, and DNS assigned by the network administrator. DNS (Domain Name System) is the system that translates names into addresses. Setting the current address obtained via DHCP (Dynamic Host Configuration Protocol) as static without approval may later cause conflicts if the same address is assigned to another device.

Values/Conditions to Prepare Reasons to Confirm
Devices to Use and Original Profile UUID Specify Current Remote Access Path and Settings to Revert
Assigned IPv4 Address and Prefix Length Check for Subnet Overlaps. Do Not Use Example Numbers as Is
Default Gateway Exit to Other Networks. Some networks may not require a default route due to policy
DNS Servers Designated by the Organization Internal and External Name Lookup and Compliance with Security Policy
Backup of Original Connection File and Recovery Console Prepare to Directly Log In to Reactivate Existing Connections Even if SSH is Disconnected
Target for Inspection and Maintenance Time Verify Firewalls, Services, and Access Clients Affected by Address Changes

A profile UUID uniquely identifies a saved configuration. As in the lesson on distinguishing devices and connection profiles , map the device name, active UUID and saved file first. Verify that you can log in through a VM or hardware management console independently of Secure Shell (SSH).

The source lab used a dedicated VirtualBox NAT virtual machine running Rocky Linux 10.2 and NetworkManager 1.56.0. NAT is a method that converts the virtual machine's communication to an external address. The recorded comparison kept the existing address 10.0.2.15/24 and gateway 10.0.2.2, switching from automatic addressing to a manual profile, and did not test moving to other addresses. These values correspond to this isolated practice environment and are not settings to copy to a general LAN or cloud.

Record the original state and prepare a separate manual profile.

The example below runs while keeping variables in the same Bash session. Change DEV to your device, and stop if the original UUID is empty or equals --.

DEV=enp0s3
ORIGINAL_UUID=$(nmcli -g GENERAL.CON-UUID device show "$DEV")
printf 'Device=%s\nOriginal UUID=%s\n' "$DEV" "$ORIGINAL_UUID"
nmcli -f NAME,UUID,DEVICE,FILENAME connection show
nmcli -f IP4 device show "$DEV"
ip -4 -brief address show "$DEV"
ip -4 route
getent ahostsv4 docs.rockylinux.org

Back up the original file shown in FILENAME to a separate directory that only root can access, preserving its attributes. In this VM, /etc/NetworkManager/system-connections/enp0s3.nmconnection was copied to /root/lf-course-14-before/. Because connected files may contain authentication information, do not store the entire file in public logs or shared locations.

Instead of overwriting the original profile, create one practice profile. The variables below are observations for this dedicated NAT practice. In other environments, all of them must be replaced with values assigned for that network. The DNS in the example 8.8.8.8 also reflects the existing values in this environment and is not recommended to replace the organizational DNS.

ADDR=10.0.2.15/24
GATEWAY=10.0.2.2
DNS=8.8.8.8
nmcli -f NAME,UUID,DEVICE connection show
if nmcli -g NAME connection show | grep -Fxq lf-course-static14; then
  printf 'This name already exists. Inspect the existing settings and stop.\n'
else
  sudo nmcli connection add type ethernet ifname "$DEV" \
    con-name lf-course-static14 autoconnect no \
    ipv4.method manual ipv4.addresses "$ADDR" \
    ipv4.gateway "$GATEWAY" ipv4.dns "$DNS" \
    ipv4.ignore-auto-dns yes ipv6.method auto
fi

If there was an existing name, stop here. Only proceed to the next step after confirming the message that it was newly created. autoconnect no is a value to ensure that the prepared profile does not automatically replace the existing connection. In this practice, IPv6 was kept on automatic configuration, which does not mean it was fixed for all environments including IPv6.

STATIC_UUID=$(nmcli -g connection.uuid connection show id lf-course-static14)
printf 'New profile UUID=%s\n' "$STATIC_UUID"
nmcli -f connection.id,connection.uuid,connection.autoconnect,ipv4.method,ipv4.addresses,ipv4.gateway,ipv4.dns,ipv4.ignore-auto-dns connection show uuid "$STATIC_UUID"
nmcli -f NAME,UUID,DEVICE connection show --active

ipv4.method manual is a manual IPv4 setting, and ipv4.addresses requires an address and prefix length. ipv4.ignore-auto-dns yes is a property used when ignoring DNS received in automatic mode, and it does not mean the same as the manual method itself. If you want to receive the address via DHCP but specify only the DNS, consider a combination of ipv4.method auto, ipv4.dns, ipv4.ignore-auto-dns yes. The meaning can be found in official IPv4 profile property description .

Activate it within the checkpoint and verify with a new connection.

A checkpoint is a feature that captures the state immediately before a network change and attempts to restore it if maintenance confirmation is not received within the time limit. This can be confirmed in nmcli official description and checkpoint usage examples . Be careful, as creating a checkpoint after activating the profile does not protect the pre-change state.

First, secure the recovery console and prepare a second terminal. The following is an example specifying 120 seconds as the time to wait for human verification. Adjust according to the scope of change and inspection time, but do not consider the checkpoint as a full server backup or guaranteed connection recovery.

sudo env LC_ALL=C nmcli device checkpoint --timeout 120 "$DEV" -- \
  nmcli --wait 30 connection up uuid "$STATIC_UUID"

While the first terminal asks whether to keep the changes, check the status below on the second terminal or console. If you changed to a new address, the second SSH connection must be newly opened using the new address and the correct port. The mere fact that the existing SSH window is still active does not make the new connection possible.

nmcli -f NAME,UUID,DEVICE connection show --active
nmcli -f GENERAL.CON-UUID,IP4 device show enp0s3
ip -4 -brief address show enp0s3
ip -4 route
getent ahostsv4 docs.rockylinux.org
curl -4 --silent --show-error --max-time 10 \
  -o /dev/null -w 'HTTPS GET=%{http_code}\n' https://docs.rockylinux.org/

Replace the device name in the separate terminal with your own value as well. getent checks the address through the system's name lookup path, and curl verifies the actual HTTPS response. Simply accessing the official documentation site does not verify all internal services, so in a production environment, you should also check the services that are actually needed.

Only if verification is complete and you want to keep the changes, follow the instructions in the first window and enter Yes. If it fails or you are unsure, do not confirm to keep the changes; restore and check the status again. Do not pipe or pre-supply automatic confirmation.

In the recorded source test, the time limit was set to 40 seconds, and it was executed without confirmation input. The source lab connected using a new SSH session while the manual profile was active, and verified the actual address, gateway, DNS, and HTTPS GET 200. In one query immediately after activation, not all device properties were shown, but in the subsequent query, the address and route were confirmed, so judgment was not based on a single moment output. After the time limit passed, it returned to the original UUID and proto dhcp default route. Even at the moment the command ended with exit status 1 without confirmation input, the new connection was briefly active, so the command termination was not treated as a completion of restoration. In this exercise, confirmation input to permanently maintain changes was not performed.

Try changing only one DNS value to distinguish name resolution issues.

Even if the address and route are normal, name resolution can fail. The source lab compared a dedicated VM by changing only one DNS value from the previous normal manual profile to a non-responsive address. On the production server, do not deliberately create faults and start with read-only queries.

If you reproduce this comparison, first confirm that normal restoration has finished and the original profile is active. Pre-fetch the current address of the document site with the normal DNS. Since this address can change over time, do not fix the past IP stated in the text.

nmcli -g GENERAL.CON-UUID device show "$DEV"
DOC_IP=$(getent ahostsv4 docs.rockylinux.org | awk 'NR==1 {print $1}')
printf 'Documentation site address resolved while DNS worked=%s\n' "$DOC_IP"

If DOC_IP is empty, it will not proceed. Change only the DNS after confirming that the new practice profile is inactive and that it is a UUID you created. 192.0.2.53 belongs to document IPv4 range of RFC 5737, and it was used in this practice to reproduce faulty DNS. It is not used as an actual DNS service.

sudo nmcli connection modify uuid "$STATIC_UUID" ipv4.dns 192.0.2.53
sudo env LC_ALL=C nmcli device checkpoint --timeout 120 "$DEV" -- \
  nmcli --wait 30 connection up uuid "$STATIC_UUID"

Check the current DNS and name resolution in the second terminal. The DOC_IP variable is not automatically passed from the first window, so the actual values verified in a normal state must also be separately set in the second window.

nmcli -g IP4.DNS device show enp0s3
ip -4 route
timeout 6 getent ahostsv4 docs.rockylinux.org
printf 'Name lookup exit status=%s\n' "$?"
curl -4 --silent --show-error --max-time 8 \
  --resolve "docs.rockylinux.org:443:$DOC_IP" \
  -o /dev/null -w 'Explicit-address HTTPS GET=%{http_code}\n' \
  https://docs.rockylinux.org/

In the source VM, the DNS changed to 192.0.2.53 while the address and gateway remained the same. The name resolution limited to 6 seconds with timeout ended with 124, and the HTTPS GET specifying the address confirmed in the normal state was 200. 124 indicates that it did not finish within this timeout, and not all DNS errors necessarily result in 124.

The resolve option in the official curl documentation specifies the address to use for the name and port of this request. Hostname and certificate verification were maintained, and the option to disable certificate checking was not used. In environments with other name resolution paths such as proxies, local caches, or hosts files, these comparison conditions must also be checked. This comparison method is a way to narrow down problems in the DNS path during practice, not a method to permanently bypass the organizational DNS.

In this test as well, the 40-second checkpoint was allowed to expire without confirmation, and after the system returned to the original DHCP connection, normal name resolution and HTTPS GET 200 were checked again. The incorrect DNS value in the prepared practice profile required separate correction, so it was restored to the correct value as shown below and then the profile was removed.

Check the restoration results and the remaining profiles separately.

After restoration, verify the original UUID, address/default route/DNS, and new SSH access again. Do not repeat the same change commands on failed remote connections. If it does not return after the designated time, use the recovery console to check the original UUID and follow the path to activate the existing connection.

nmcli -f NAME,UUID,DEVICE connection show
nmcli -f IP4 device show enp0s3
ip -4 route
getent ahostsv4 docs.rockylinux.org

The command to manually bring up an existing connection from the console is sudo nmcli connection up uuid "$ORIGINAL_UUID". If you have newly logged into the console, there will be no existing shell variables, so you need to reset the originally recorded UUID. If you mistakenly modified the original profile, this command alone will not restore the previous settings, so a separate recovery procedure with the saved connection file is required. The actual restoration this time was performed via a checkpoint, and the manual activation path in the console was not executed.

A new profile created in advance before the checkpoint may remain in the saved list even when returning to the original connection. Only after confirming that the STATIC_UUID created this time is inactive should you revert the DNS to the original practice values and remove it.

nmcli -f connection.id,connection.uuid,ipv4.dns connection show uuid "$STATIC_UUID"
nmcli -f NAME,UUID,DEVICE connection show --active
if test -n "$STATIC_UUID" \
  && test "$STATIC_UUID" != "$ORIGINAL_UUID" \
  && test "$(nmcli -g connection.id connection show uuid "$STATIC_UUID")" = lf-course-static14 \
  && ACTIVE_IDS=$(nmcli -g UUID connection show --active) \
  && ! printf '%s\n' "$ACTIVE_IDS" | grep -Fxq "$STATIC_UUID"; then
  sudo nmcli connection modify uuid "$STATIC_UUID" ipv4.dns "$DNS" \
    && sudo nmcli connection delete uuid "$STATIC_UUID"
else
  printf 'Cleanup conditions do not match. Stop and inspect the profiles.\n' >&2
fi
nmcli -f NAME,UUID,DEVICE,FILENAME connection show

The above deletion is the step to clean up the newly created practice profile. If the verification results differ from expectations, stop and do not delete the existing connection or the active profile. In the source lab, the new profile and files were removed, and the original Ethernet file was identical to the backup at the byte level. The original address and routes, NetworkManager and SSH services, and SELinux Enforcing status were also preserved.

Judge according to the stage at which the failure occurred.

Observation results Scope to investigate
The new profile is saved but inactive The difference between saving and activation. Check whether it is in a ready state before remote changes.
The device has an address, but the destination route is incorrect. Prefix length, default gateway, routes on other interfaces.
The specified address HTTPS works, but name resolution fails. DNS server, search domain, name resolution path and policy.
External web works, but new SSH connection fails. Connection address, NAT forwarding, server receiving address, firewall, upstream network.
Returns to the original connection after the checkpoint. Verify separately whether restoration is normal and the remaining practice profiles.

The scope tested in the source lab is manual IPv4 switching with the same NAT address and automatic restoration of incorrect DNS. It does not verify public address changes, complex bridges/VPNs, routing changes of other devices, or restoration during server restart. Even with checkpoints, it does not restore external routers, DNS services, or application data, so actual environment failure response must be prepared together with console, backup, and service verification.