0

I added these lines to a .conf file in the directory /etc/sysctl.d

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

I then do sudo systemctl restart systemd-sysctl

So far so good, as I can verify, e.g. cat /proc/sys/net/ipv6/conf/lo/disable_ipv6 returns 1 and I can see that ipv6 addresses are not assigned in output of ip address

But, if I put my computer to sleep, the setting does not persist (unless I repeat the above sudo systemctl restart systemd-sysctl). I am running Fedora 32. I thought that this setting should persist. Am I missing something here?

1

try:

sysctl -p

or for bulletproof ipv6 disable - add grub.conf line ipv6.disable=1 :

# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

create new grub conf:

# grub2-mkconfig -o /boot/grub2/grub.cfg

and reboot:

# reboot
  • sysctl -p doesn't seem to work for me. (I'm not sure why - I thought it worked before but led to the same issue). Thanks for suggesting the grub way, but i was really hoping for something that doesn't require a reboot – SauceCode Jul 10 '20 at 20:58
  • well you may be hitting some service or configuration that has some IPv6 "dependency". It can be for example ::1 IPv6 localhost in /etc/hosts or some postfix configuration that binds to ::1. It can be DHCPv6 that tries to give you an IPv6 lease. That's why I suggested grub approach since I have it tested and no service will bind to IPv6 after reboot. Alternatively write a small cron that will remove any IPv6 addresses from your network interfaces. since you mention putting computer to sleep - I was uder impression that it's not an enterprise production system that cannot be restarted :) – Roman Spiak Jul 10 '20 at 21:12
  • Yes, I could reboot, but if possible I prefer to figure out the underlying issue rather than workaround it. – SauceCode Jul 10 '20 at 21:38
  • I guess than you just need to poke around your system and find out what is adding IPv6 address back to your interface. BTW disabling IPv6 via grub.conf is perfectly reasonable solution and not a workaround. – Roman Spiak Jul 12 '20 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.