Bug 2189247

Summary: Reapply on disabled ipv6 will cause auto ipv4 lose DNS nameserver
Product: Red Hat Enterprise Linux 9 Reporter: Gris Ge <fge>
Component: NetworkManagerAssignee: Wen Liang <wenliang>
Status: CLOSED ERRATA QA Contact: Matej Berezny <mberezny>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.2CC: bgalvani, bnemec, lrintel, rkhan, sfaye, sukulkar, thaller, till, vbenes, wenliang
Target Milestone: rcKeywords: Reopened, Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: NetworkManager-1.43.5-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2219847 (view as bug list) Environment:
Last Closed: 2023-11-07 08:38:04 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:    
Bug Blocks: 2219847    
Attachments:
Description Flags
NetworkManager trace log none

Description Gris Ge 2023-04-24 14:07:35 UTC
Created attachment 1959547 [details]
NetworkManager trace log

Description of problem:

Given a NIC with both ipv4 and ipv6 enabled with auto method, only DHCPv4 provided nameserver.

When reapply with ipv6 disabled.

Then noticed DNS nameserver been purged.

Version-Release number of selected component (if applicable):
NetworkManager-1.42.2-1.el9

How reproducible:
100%

Steps to Reproduce:
1. Please reach out to QE in https://issues.redhat.com/browse/OCPBUGS-11827 for a cluster.
2.
3.

Actual results:

DNS nameserver been purged after `oc apply` which then lead to rollback.

Expected results:

DNS nameserver retrieved from DHCPv4 unchanged.

Additional info:

Comment 6 Thomas Haller 2023-05-11 08:22:47 UTC
Wen, I headerd, you were able to reproduce this issue?

Could you explain in detail how to reproduce it. Or attach a reproducer script. Or write a NM-ci test (choose whatever approach you want).


Also, to my understanding you identified 

  https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/0a02995175e06e62924705393121a1c5efc3822d

as the fix?


In that case, it is fixed in upstream 1.43.5+, 1.42.6+, 1.40.18+.
It is also fixed in rhel-9.3 package NetworkManager-1.43.5-1.el9.
As of now, it is not yet fixed in latest rhel-9.2, or latest rhel-8.

Comment 9 Wen Liang 2023-05-14 15:38:01 UTC
(In reply to Thomas Haller from comment #6)
> Wen, I headerd, you were able to reproduce this issue?
> 
> Could you explain in detail how to reproduce it. Or attach a reproducer
> script. Or write a NM-ci test (choose whatever approach you want).
> 
> 
> Also, to my understanding you identified 
> 
>  
> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/
> 0a02995175e06e62924705393121a1c5efc3822d
> 
> as the fix?
> 
> 
> In that case, it is fixed in upstream 1.43.5+, 1.42.6+, 1.40.18+.
> It is also fixed in rhel-9.3 package NetworkManager-1.43.5-1.el9.
> As of now, it is not yet fixed in latest rhel-9.2, or latest rhel-8.


I discussed this bug with bgalvani, the upstream nm-1-40 and nm-1-42 branches already had that commit and there was no customer request for backporting into rhel-9.2/rhel-8.8. 

About the steps to reproduce the bug:

1. I used the nm-in-container.sh script and added the eth1 interface
2. nmcli connection add type ethernet ifname eth1 con-name eth1+ ipv6.method manual ipv6.addresses $someaddr ipv6.dns $somedns
3. nmcli connection up eth1+ 
4. nmcli | grep -A10 "DNS configuration:"  (In this case, you should be able to see some IPv4 and IPv6 DNS)
5. nmcli connection modify eth1+ -ipv6.addresses $someaddr -ipv6.dns $somedns ipv6.method disabled (Remove the IPv6 addresses and DNS, and set the Ipv6 method into disabled)
6. nmcli device reapply eth1+; nmcli | grep -A10 "DNS configuration:" (The expected behavior is that the IPv4 DNS is not removed, but if the bug persists, then the IPv4 DNS is removed)

Comment 12 Gris Ge 2023-05-22 03:48:04 UTC
Hi Wen,

Please prepare a scratch build of 9.2 for Ben Nemec to try out.

Comment 13 Wen Liang 2023-05-22 16:37:12 UTC
(In reply to Gris Ge from comment #12)
> Hi Wen,
> 
> Please prepare a scratch build of 9.2 for Ben Nemec to try out.

Sure, I will do it!

Comment 19 errata-xmlrpc 2023-11-07 08:38:04 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:6585