Bug 2151426

Summary: [RHEL8] Reapply does not updating IPv4 address in desired order
Product: Red Hat Enterprise Linux 8 Reporter: Gris Ge <fge>
Component: NetworkManagerAssignee: Fernando F. Mancera <ferferna>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 8.7CC: bgalvani, ferferna, lrintel, rkhan, sfaye, sukulkar, till
Target Milestone: rcKeywords: Triaged
Target Release: 8.8   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2151428 (view as bug list) Environment:
Last Closed: 2022-12-20 09:55:39 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: 2151428    
Attachments:
Description Flags
Reproducer script
none
NetworkManager trace log none

Description Gris Ge 2022-12-07 04:03:29 UTC
Created attachment 1930701 [details]
Reproducer script

Description of problem:

The `nmcli d reapply <connection_name>` does not update IPv4 address as desired.

Version-Release number of selected component (if applicable):
NetworkManager-1.40.0-4.el8_7.x86_64
NetworkManager-1.36.0-11.el8_6.x86_64


How reproducible:

100%


Steps to Reproduce:

 * sudo ./bug.sh

Actual results:

Got IPv4 address in the order:

192.168.19.4/24
192.168.199.3/24
192.168.15.5/24

which is not desired

Expected results:

192.168.15.5/24
192.168.19.4/24
192.168.199.3/24

Additional info:

Comment 1 Gris Ge 2022-12-07 04:04:27 UTC
Created attachment 1930702 [details]
NetworkManager trace log

Comment 3 Gris Ge 2022-12-07 04:14:41 UTC
Issue also found on RHEL 8.4 rpm: NetworkManager-1.30.0-16.el8_4.x86_64

Comment 4 Gris Ge 2022-12-20 10:02:59 UTC
As explained in https://bugzilla.redhat.com/show_bug.cgi?id=2151428#c4

Preserving ipv4 address order for different subnet require ip address been removed and added back again, 
this will break some use case like keepalived: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1103

Closing as not a bug.