Disable IPv6 on Ubuntu 18.04

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.

Video Walkthrough

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:

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:

[video_player type=”youtube” style=”1″ dimensions=”560×315″ width=”560″ height=”315″ align=”center” margin_top=”0″ margin_bottom=”20″ ipad_color=”black”]aHR0cHM6Ly95b3V0dS5iZS9uRW5QNklpUmI4OA==[/video_player]

 

 

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.

If you enjoyed this post, please consider donating to AdminTome Blog below. Thanks again for reading!