Can "nmcli con up" cause a temporary network interruption?
Environment
- Red Hat Enterprise Linux 7 and later
- NetworkManager
Issue
- Can "nmcli con up [ID]" cause a temporary network interruption?
Resolution
- Yes, it can cause a temporary network interruption as it removes and then re-assigns the IP address and routing entries. This process may take longer with complex configurations like bonding. To avoid the interruption, you can use "nmcli device reapply [ifname]" instead when modifying IPv4.addresses, ipv4.dns, ipv4.routes, etc. Please note that if a DHCP client is used, NetworkManager should be updated to version 1.42.2-1.el9.x86_64 (RHEL 9.2) or later.
NMCLI(1):
DEVICE MANAGEMENT COMMANDS
nmcli device {status | show | set | up | connect | reapply | modify | down | disconnect | delete | monitor | wifi | lldp | checkpoint} [ARGUMENTS...]
...
reapply ifname
Attempt to update device with changes to the currently active connection made since it was last applied.
Note: The above temporary network interruption doesn't affect existing TCP sessions.
Root Cause
-
RHEL 9.2 Release Notes
NetworkManager now preserves IP addresses during reapply before acquiring a new DHCP lease
Previously, after changing the connection settings and then using nmcli device reapply command, NetworkManager did not preserve the DHCP lease. Consequently, the IP address got removed temporarily. With this fix, NetworkManager preserves the DHCP lease and uses it until the lease expires or the client requests a new one. As a result, when the nmcli device reapply command restarts DHCP client, it does not temporarily remove the IP address.
Bugzilla:2117352
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