Bug 2169869

Summary: NetworkManager does not show actual DHCP settings for dhcp-client-id, dhcp-duid, dhcp-iaid
Product: Red Hat Enterprise Linux 9 Reporter: Thomas Haller <thaller>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED ERRATA QA Contact: David Jaša <djasa>
Severity: high Docs Contact:
Priority: medium    
Version: 9.2CC: akaris, bgalvani, desktop-qa-list, ferferna, lrintel, rbrattai, rkhan, sfaye, sukulkar, thaller, till, vbenes
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.42.2-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2152601
: 2171827 (view as bug list) Environment:
Last Closed: 2023-05-09 08:17:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2152601, 2167812    
Bug Blocks: 2171827, 2171832    

Description Thomas Haller 2023-02-14 21:26:59 UTC
+++ This bug was initially created as a clone of Bug #2152601 +++

NetworkManager allows configuring ipv4.dhcp-client-id, ipv6.dhcp-duid and ipv6.dhcp-iaid.

The properties support explicitly selecting the value (as hex-string or number). But they also support special keyworks, like "mac" or "per-mac" (check `man nm-settings`). This indicates to generate the values based on the chosen method. Note that if the properties are left unspecified, then a global default from NetworkManager.conf is consulted.

This means, when the profile does not explicitly select the used value (by either using one of the special keywords, or by allowing fallback to the global default), it's not immediately clear which value is used at time of activation

when the profile/device activates, the effectively used value gets generated (it sticks until a `nmcli device reapply` or the device goes down).

It is interesting to know, the actually used value.


We should expose the actually used value in the lease information. That is, both on D-Bus API, via `nmcli -f all device show $IFNAME` and in `/run/NetworkManager/devices/$IFINDEX`.


They keys are called:
 - dhcp4.dhcp_client_identifier
 - dhcp6.dhcp6_client_id
 - dhcp6.iaid


- for the dhclient plugin, those keys were already in the lease information, because with the dhclient plugin we get it via the environment variables of the hook script, and they were already there.

- for the internal plugin, they were not present. This was a missing feature (or regression compared to dhclient, if you want to call it like that).


Since commit [1], "dhcp4.dhcp_client_identifier" and "dhcp6.dhcp6_client_id" was fixed for the internal plugin. That is in upstream 1.41.8+ (rhel-9.2) and 1.40.10 (rhel-8.8).

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/831b8f8e7e7c2660570bf36e3987f68047d1a91b

To support expose "dhcp6.iaid" (for the internal plugin), this is currently in progress at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1534


---

Optimally, we would have test that check this for the internal and the dhclient plugin. That seems cumbersome, because we don't have a convenient way to test both plugins (bug 2091891) and as dhclient is on the way out, maybe not worth it...

Comment 4 David Jaša 2023-02-27 11:14:17 UTC
VERIFIED in NetworkManager-1.42.2-1.el9.x86_64, dhcp-client-identifier, dhcp6-client-id (as well as iaid) are exposed.

Tested by NM CI scenarios:
bond_expose_dhcp_client_identifier
bond_expose_dhcp6_client_id
bond_expose_iaid

Comment 6 errata-xmlrpc 2023-05-09 08:17:59 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