Created attachment 1283745 [details]
Description of problem:
I attached a network interface to virtual guest running RHEL 7.4 and configure IPv6 address on the interface. When I add an IPv6 route that uses a host from the address's subnet it appears in the routing table for a while and after a second it's removed. I was able to create a simple reproducer that uses virtual guest (attached). When I disable NetworkManager the route stays in the routing table.
I see this after I updated NM from NetworkManager-1.8.0-0.4.rc3.el7 to NetworkManager-1.8.0-3.el7
I attached level=TRACE logs as well.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. run attached reproducer on a host with 7.4 guest
IPv6 route disappears after a while
IPv6 route does not disappear
Created attachment 1283746 [details]
The attached reproducer provides 3 tests but only test #2 is relevant to this bug, the rest of tests is commented out.
Tested with RHEL-7.3 version of NM NetworkManager-1.4.0-12.el7 where I could not reproduce the issue. I'm keeping the Regression keyword.
The eth1 device appears to NetworkManager like a regular ethernet. That means, the device is managed (by default), and NM does what it always does:
- disable address generation of IPv6 link-local address
- set the device IFF_UP
- reset sysctls. This involves toggeling
/proc/sys/net/ipv6/conf/eth1/disable_ipv6, which would interfere badly with
doing IP configuration on the interface.
This is inherently racy, and not much that can be done about it.
This however should only happen when the device shows up first (or NM is starting). You have to be fast to hit that race -- and that was not the problem.
Later, once you start configuring IP addresses, NM notices that somebody externally messes with the device, and it creates a in-memory connection to express the state on the interface. From that point on, NM should no longer touch the interface. There is a bug there, that needs fixing.
Created attachment 1284242 [details]
[patch] device: mark device as sys-iface-state=external when assuming connection
This should fix it...
Jan, any chance to re-test with scratch-build https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13326781
(In reply to Thomas Haller from comment #5)
> Created attachment 1284242 [details]
> [patch] device: mark device as sys-iface-state=external when assuming
Looks good to me.
I tested on the same setup with fixed NetworkManager-1.8.0-6.el7 and I cannot reproduce this anymore.
I also ran the tests that were blocked by this issue and the bug is gone there as well: https://beaker.engineering.redhat.com/recipes/3916966#task56673909
Note that one of the failures in beaker job is a known issue.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.