Description of problem:
nmcli con add type ethernet ifname eth1 con-name ethie autoconnect no ipv6.method manual ipv6.addresses 2000::2/126 ipv6.route-metric 256
nmcli con modify ethie ipv6.routes '1010::1/128 src=2000::2'
never works out to full route.
<error> [1495198700.1398] platform-linux: do-add-ip6-route[4: 1010::1/128 256]: failure 22 (Invalid argument)
Version-Release number of selected component (if applicable):
Created attachment 1282758 [details]
test script adding route with "src"
NetworkManager first adds the IPv6 address, and immediately afterwards the IPv6 route. The route's "src" (RTA_PREFSRC) references the added address.
At that point, the address is still tentative (DAD), and adding the route fails with "Invalid argument".
Then, NM aborts activation because it was unable to configure the route.
I think this is a kernel bug (or at least, ill behavior). How is somebody supposed to write a script that adds a route with "src" set, when he first has to wait until the address becomes non-tenative? Kernel should allow adding the route, and possibly just not use it until the address survives DAD.
Since NM doesn't support the nodad flag for addresses, specifying "src" is broken.
I don't know how to fix this. I tried a bit with th/route-pref-src-rh1452684, but go nowhere. Beniamino?
I cloned this bug for kernel (bug 1452684).
It's unclear, whether we should put effort into adding a workaround in NetworkManager. It's complicated, and I think kernel should be fixed.
anyway, I don't think this is gonna make it to rhel-7.4.
(In reply to Thomas Haller from comment #3)
> I cloned this bug for kernel (bug 1452684).
I cloned this bug for kernel (bug 1457196).
Please review th/route-pref-src-rh1452684
The solution here is very ugly. Maybe we should just log a meaningful error message and add support for IFA_F_OPTIMISTIC flag, so that the user can configure that.
(In reply to Thomas Haller from comment #5)
> Please review th/route-pref-src-rh1452684
+ priv->rt6_temporary_not_available = g_hash_table_new_full ((GHashFunc) nmp_object_id_hash,
+ (GEqualFunc) nmp_object_id_equal,
+ (GDestroyNotify) nmp_object_unref,
+ nm_g_slice_free_fcn (IP6RoutesTemporaryNotAvailableData));
Indentation. The rest LGTM.
> The solution here is very ugly. Maybe we should just log a meaningful error
> message and add support for IFA_F_OPTIMISTIC flag, so that the user can
> configure that.
At the moment kernel doesn't allow adding addresses with the
optimistic flag, which is probably a bug. But once it's fixed,
I think this would be a better solution.
th/route-pref-src-rh1452684 looks good
patch merged as https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=2cc1813340c63dbbdc183931a700bb38740419e1
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.