RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2117352 - Improve reapply to reset the device according to the profile
Summary: Improve reapply to reset the device according to the profile
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: NetworkManager
Version: 9.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Wen Liang
QA Contact: Matej Berezny
Mayur Patil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-10 17:51 UTC by Thomas Haller
Modified: 2023-05-09 10:23 UTC (History)
10 users (show)

Fixed In Version: NetworkManager-1.41.8-1.el9
Doc Type: Bug Fix
Doc Text:
.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.
Clone Of:
Environment:
Last Closed: 2023-05-09 08:17:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker NMT-143 0 None None None 2023-01-23 10:25:35 UTC
Red Hat Issue Tracker RHELPLAN-130850 0 None None None 2022-08-10 17:57:56 UTC
Red Hat Product Errata RHBA-2023:2485 0 None None None 2023-05-09 08:17:51 UTC
freedesktop.org Gitlab NetworkManager NetworkManager-ci merge_requests 1267 0 None merged ipv4: reapply device keep the lease 2023-01-30 00:18:05 UTC
freedesktop.org Gitlab NetworkManager NetworkManager merge_requests 1443 0 None merged Draft: device: preserve the DHCP lease during reapply 2023-01-11 15:40:52 UTC

Description Thomas Haller 2022-08-10 17:51:12 UTC
Background:

When we activate a profile in NetworkManager, we create an internal copy of what was activated.

When later the profile gets modified (via `nmcli connection modify`), the changes don't take effect immediately (*). Changes to a profile only take effect after reactivating the profile.

(*) except "connection.zone" and "connection.metered", which take effect immediately, unless the modification happens with `NM_SETTINGS_UPDATE2_FLAG_NO_REAPPLY` flag.

Btw, you can get the content of the copy, wia the `GetAppliedConnection()` D-Bus call.


Now, there is the `Reapply()` D-Bus call,which takes a new profile and applies the changes right away, without requiring a full activation.

That is used by `nmcli device reapply` and `nmcli device modify` commands.


Reapply tries to do two conflicting things.

- apply all the changes as requested
- do not disrupt the connectivity. That means for example, avoid restarting DHCP and if we restart it, then do in a way that does not temporarily loose all IP addresses.

---

There are problem with this.

1) If there are no changes to the profile, then often reapply does not actually do anything.

  nmcli device reapply eth0
  ip link set eth0 mtu 2000
  nmcli device reapply eth0

one might expect that the second reapply call fixes the MTU. However, it might not. Here we should lean more towards: make sure that the settings are really as requested, and take all necessary measures to make sure that's the case.


2) when we reapply the IP configuration and need to restart DHCP, then the IP address goes away. I think reapply should always restart DHCP, even if presumably no configuration changed. This is problem 1) above. The problem 2) is that while we restart DHCP, that the IP address gets removed temporarily. We should instead leave the IP address there, until we get a new lease. NMDhcpClient should abstract this. Similar things for RA, link-local, etc.

Comment 11 errata-xmlrpc 2023-05-09 08:17:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2485


Note You need to log in before you can comment on or make changes to this bug.