A default install of Ubuntu will enable IPv6 connectivity. If you don’t need IPv6, there is no need to have it enabled. Follow the steps below to disable IPv6 on a Ubuntu install.
Check to see if you’re installation is currently set up for IPv6:
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
If the output is 0, IPv6 is enabled.
If the output is 1, IPv6 is already disabled.
Edit the /etc/sysctl.conf file to set the kernel parameter to disable IPv6:
$ sudo nano /etc/sysctl.conf
Scroll to the very bottom, and add the following line:
net.ipv6.conf.all.disable_ipv6 = 1
Save and exit the editor.
Reload the sysctl configuration:
$ sudo sysctl -p
or
$ sudo reboot
IPv6 should now be disabled.