Menu

Disable IPv6 on Ubuntu 18.04

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.

Disclaimer

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.

How to tell if you have IPv6 enabled

IPv6 is enabled by default on Ubuntu but to verify simply run an ‘ip a’ like below:

ipv6 enabled on ubuntu

As you can see there are lines for each interface that begin with inet6.  This shows that IPv6 is enabled.

How to disable IPv6 on Ubuntu 18.04?

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:

disable ipv6 on ubuntu 18.04

IPv6 will still be disabled on a reboot because we made changes to the sysctl.conf file.

Click here for more great Ubuntu articles on AdminTome Blog.

Conclusion

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.

Signup for the AdminTome Blog Newsletter

Get weekly updates from AdminTome Blog including the latest articles and special content only for subscribers.

privacy We value your privacy and would never spam you

 
Tags:
%d bloggers like this: