#1104061 /usr/sbin/NetworkManager: sysctl settings ignored / overriden

Package:
network-manager
Source:
network-manager
Description:
network management framework (daemon and userspace tools)
Submitter:
Benoit Panizzon
Date:
2025-04-25 16:24:01 UTC
Severity:
normal
Tags:
#1104061#5
Date:
2025-04-25 07:09:23 UTC
From:
To:
Dear Maintainer,

I have been fighting with wrong ipv6 routes for quite a while and have
finally been able to track them to NetworkManager being the cause. But not
what exactly in NetworkManager causes the issue.

I have a system with two ethernet interfaces. One is actually a vxlan interface
used as a L2 VPN and is set up by some of my scripting.

In this example, assume eth0 and vxlan1

I have little control of the ipv6 RA being sent to both interfaces. But for the L2 VPN to
work as intended, I need the IPv6 default route to point to that interface. So prior to set
up the vxlan interface I disable accept_ra on eth0 and delete the existing default route:

ip link add vxlan1 type vxlan id 1 dstport 4789 remote 192.168.10.2
sysctl -w net.ipv6.conf.eth0.accept_ra_defrtr=0
sysctl -w net.ipv6.conf.eth0.accept_ra=0
ip -6 route delete default
ip link set dev vxlan1 up

As soon as an RA is received on vxlan1 the interface vxlan1 is configured and
the correct ipv6 route created to send traffic via L2 VPN.

tcpdump -vvvv -ttt -i eth0 'icmp6 and ('ip6[40] = 134' or 'ip6[40] = 133')'

As soon as an RA is received on eth0, which according to the sysctl entry should
be ignored, a second default route (unfortunately with higher priority) is pointig
to eth0

All further attempts to 'fix' with sysctl by disabling autoconfig or setting the
'all' and 'default' interfaces did not fix the issue.

When I stop NetworkManager, the RA received on eth0 is ignored as configured by
sysctl. This leads me to the conclusion, that NetworkManager somehow still
handles RA even when disabled in the kernel via sysctl.

So I had a look at the NetworkManager ipv6 settings for eth0 and attempted to disable IPv6 RA there,
unfortunately with no success.

I wonder if this is a bug or if this is intended behaviour. If intended, how can
my use case be 'fixed'?

#1104061#10
Date:
2025-04-25 16:21:32 UTC
From:
To:
Am 25.04.25 um 09:09 schrieb Benoit Panizzon:

If you are going to manage eth0 manually, why do you want NetworkManager
to manage eth0 as well?

You can mark a device as unmanaged by NetworkManager

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-networkmanager-to-ignore-certain-devices_configuring-and-managing-networking#permanently-configuring-a-device-as-unmanaged-in-networkmanager_configuring-networkmanager-to-ignore-certain-devices


Aside from that, if you want to have NM manage eth0, you can use the
ipv6 specific settings

https://www.networkmanager.dev/docs/api/latest/nm-settings-nmcli.html

See ipv6.method and related settings.