To completely disable IPv6 on your Linux system, side note you shouldn’t but it’s your choice, you can do so simply editing the 99-sysctl.conf file at the location ‘/etc/sysctl.d/99-sysctl.conf’
Copy and paste the following 3 lines at the bottom of the file.
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
After editing the file you need to then reboot the machine or run the following command as root
To verify that you have ipv6 disabled you can run