In this post we will walk through how to disable IPv6 on Ubuntu 18.04. IPv6 can cause problems with different applications like DNS resolution.
Normally you would never want to disable IPv6 on your system. There are many great reasons to keep it. Disabling IPv6 will only hide the real issue at hand. That being said if you still want to disable it then please follow along.
IPv6 is enabled by default on Ubuntu but to verify simply run an ‘ip a’ like below:
As you can see there are lines for each interface that begin with inet6. This shows that IPv6 is enabled.
IPv6 can be disabled easily on Ubuntu 18.04 by following these simple steps:
1. Edit /etc/sysctl.d/99-sysctl.conf
# vim /etc/sysctl.d/99-sysctl.conf
2. Add the following lines to the end of the file
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
3. Save and exit
[ESC] then :wq [ENTER]
4. Reload the values
# systemctl -p
5. Validate that IPv6 is disabled
# ip a
You should see that there is no longer any inet6 lines:
IPv6 will still be disabled on a reboot because we made changes to the sysctl.conf file.
I hope you have enjoyed this article, if so please leave a comment below. For more articles, please signup for the AdminTome Blog below. Also please feel free to share the article to your friends using the buttons to the left. Thanks again for reading this post.
Get weekly updates from AdminTome Blog including the latest articles and special content only for subscribers.
We value your privacy and would never spam you