If you are disabling IPv6 then you likely know why you are doing it and the reasons may be varied. Disabling IPv6 only requires a brief search to find the sysctl change required but the Ubuntu bug issue is worth a mention.
Modify the following file:
Add the following lines:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
Reload values and confirm IPv6 addresses have been removed:
There appears to a bug in Ubuntu affecting the sysctl settings loading after reboot.
The fix however is to create a new file /etc/rc.local and add these contents:
#!/bin/bash # /etc/rc.local # Load kernel variables from /etc/sysctl.d /etc/init.d/procps restart exit 0
You’ll need to ensure the file is executable as well:
chmod 755 /etc/rc.local
Thanks to Bill for his post which likely saved me time searching the interweb for answers…
Disable IPv6 on Ubuntu 18.04
One thought on “Disable IPv6 on Ubuntu 18.04”
Ah.. The bug.. Thanks it works.