Posted by Arjun Arjun on Thursday 10th May 2018, 1 minute read

How to disable IPv6 on Ubuntu

How to Ubuntu disable IPv6

In this post, I will show you disabling IPv6 on your Ubuntu machine. Before going further, let's check the current status of the IPv6 on your machine.

To check the status, open up the terminal and enter the following command /proc/sys/net/ipv6/conf/all/disable_ipv6 if the return value is 1, then IPv6 is already disabled and if the return value of 0 it means IPv6 is active.

If IPv6 is active you have to do following changes to disable it.

Step 1: Open the file /etc/sysctl.conf in your text editor of choice.
Step 2: At the end of sysctl.conf, add the following three lines:

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

Step 3: Now run sudo sysctl -p to update to reconfigure the kernel parameters with the new values set in the previous step.

Now again you can run following command to check the current status, now it should return 1 indicating that IPv6 has been disabled.

$ /proc/sys/net/ipv6/conf/all/disable_ipv6
...
Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.