sysctl disable IPv6 autoconf

Christian Klemm asked:

I’m trying to setup IPv6 on my OVH server using their guide.

In the article they recommend to

disable IPv6 autoconf and router advertising to prevent known issues
You can do so by adding the following lines to your sysctl.conf file, which is located in /etc/sysctl.conf:
net.IPv6.conf.all.autoconf=0
net.IPv6.conf.all.accept_ra=0
Once this has been done, you can apply those rules by executing the following command: sh sysctl -p

I added those parameters to my the sysctl config like described. When trying to apply the config using sysctl -p I get the following error(s):

sysctl: cannot stat /proc/sys/net/IPv6/conf/all/autoconf: No such file or directory  
sysctl: cannot stat /proc/sys/net/IPv6/conf/all/accept_ra: No such file or directory

I’m on Debian 10 with a recent kernel:

# cat /proc/version
Linux version 4.19.0-9-amd64 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07)
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

My answer:


It’s a typo. ipv6 should be in lowercase.

net.ipv6.conf.all.autoconf=0
net.ipv6.conf.all.accept_ra=0

This should be set automatically if you configured your IPv6 address and gateway in /etc/network/interfaces, but the rest of the directions are also obsolete.

You do not need those post-up and pre-down commands. You just set the netmask and gateway normally.

iface eth0 inet6 static 
    address YOUR_IPv6 
    netmask 64             # NOT 128! this was also wrong
    gateway IPv6_GATEWAY

Finally, consider switching to systemd-networkd for your network configuration. This method of network configuration is ancient and rather fiddly.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.