Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable IPv6 RA sysctls for networkd #3438

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

bcressey
Copy link
Contributor

@bcressey bcressey commented Sep 8, 2023

Issue number:

Fixes #3411

Description of changes:
Try to keep the kernel's IPv6 RA client from changing anything when using systemd-networkd's client, since that could put the interface into an unexpected state that requires a service restart to fix.

This disables all sysctls where the upstream docs have this note:

Functional default: enabled if accept_ra is enabled.

These sysctls are used to selectively enable or disable parts of the kernel's accept_ra behavior, so disabling them all gets us as close as we can to having the entire feature disabled.

Testing done:

Before:

# cat /etc/sysctl.d/90-primary_interface.conf
-net.ipv4.conf.eth0.rp_filter = 2

# head /proc/sys/net/ipv6/conf/eth0/accept_ra{,_defrtr,_pinfo,_rtr_pref,_mtu}
==> /proc/sys/net/ipv6/conf/eth0/accept_ra <==
0

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_defrtr <==
1

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_pinfo <==
1

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_rtr_pref <==
1

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_mtu <==
1

# sysctl -w net.ipv6.conf.eth0.accept_ra=2
net.ipv6.conf.eth0.accept_ra = 2

# dmesg|grep ICMPv6
[  402.503946] ICMPv6: RA: ndisc_router_discovery failed to add default route

After:

# cat /etc/sysctl.d/90-primary_interface.conf
-net.ipv4.conf.eth0.rp_filter = 2
-net.ipv6.conf.eth0.accept_ra = 0
-net.ipv6.conf.eth0.accept_ra_defrtr = 0
-net.ipv6.conf.eth0.accept_ra_pinfo = 0
-net.ipv6.conf.eth0.accept_ra_rtr_pref = 0
-net.ipv6.conf.eth0.accept_ra_mtu = 0

# head /proc/sys/net/ipv6/conf/eth0/accept_ra{,_defrtr,_pinfo,_rtr_pref,_mtu}
==> /proc/sys/net/ipv6/conf/eth0/accept_ra <==
0

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_defrtr <==
0

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_pinfo <==
0

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_rtr_pref <==
0

==> /proc/sys/net/ipv6/conf/eth0/accept_ra_mtu <==
0

# sysctl -w net.ipv6.conf.eth0.accept_ra=2
net.ipv6.conf.eth0.accept_ra = 2

# dmesg|grep ICMPv6
<nothing>

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Try to keep the kernel's IPv6 RA client from changing anything when
using systemd-networkd's client, since that could put the interface
into an unexpected state that requires a service restart to fix.

Signed-off-by: Ben Cressey <[email protected]>
@bcressey bcressey requested review from zmrow and yeazelm September 8, 2023 22:40
@zmrow
Copy link
Contributor

zmrow commented Sep 8, 2023

Related to #3394

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@bcressey bcressey merged commit 703692e into bottlerocket-os:develop Sep 9, 2023
@bcressey bcressey deleted the netdog-ipv6-sysctls branch September 9, 2023 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeated ndisc_router_discovery failed messages in the journal when using systemd-networkd
3 participants