Disable ipv6 on Ubuntu – updated for 20.04
So this used to work prior to 20.04
$ sudo nano /etc/sysctl.conf
add the following lines:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
$ sudo sysctl -p
$ sudo reboot now
Updated for version 20.04
$ sudo nano /etc/default/grub
Replace the following two lines
GRUB_CMDLINE_LINUX_DEFAULT=”ipv6.disable=1″
GRUB_CMDLINE_LINUX=”ipv6.disable=1″
$ sudo update-grub
$ sudo reboot now