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.