Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
+++ This bug was initially created as a clone of Bug #2151426 +++
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:
--- Additional comment from Gris Ge on 2022-12-07 12:04:27 CST ---
--- Additional comment from Gris Ge on 2022-12-07 12:06:10 CST ---
Requesting 8.4 zstream as customer request nmstate fix in bug
https://bugzilla.redhat.com/show_bug.cgi?id=2132570#c8
When you add two (or more) IPv4 addresses from the same subnet, kernel will set the "secondary" flag to all but the primary address (btw, for IPv6, kernel doesn't do that).
But if you have addresses from separate subnets, then this doesn't happen.
NetworkManager follows that. If you add IPv4 addresses from different subnets, then their order/priority is undefined and not enforced by NetworkManager. The order is only enforced by addresses from the same subnet.
See here: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/5e0b867a49eb10a37383ccd3d674719392b742c0/src/libnm-platform/nm-platform.c#L4163> Expected results:
>
> 192.168.15.5/24
> 192.168.19.4/24
> 192.168.199.3/24
Right. Different subnets. No order enforced.
For IPv6, that's different, and NetworkManager enforces the relative order for all addresses.
> Requesting 8.4 zstream as customer request nmstate fix in bug
>
> https://bugzilla.redhat.com/show_bug.cgi?id=2132570#c8
Could you give more context why this behavior is requested? https://bugzilla.redhat.com/show_bug.cgi?id=2132570#c0 doesn't configure addresses from different subnets, so it's not clear whether you request that addresses from different subnets also have their order preserved, or whether there was just a a bug with addresses in the same subnet (I cannot reproduce the problem .
Kernel has no proper API to set the order, except removing and readding the addresses in the right order. But removing+readding is rather problematic, because the address is gone for a moment. For that reason, I think this behavior should not be extended.