Disable IPv6 on Ubuntu

We know we shouldnt do it and we should all embrace IPv6 and move the the future yada yada yada. Dont get me wrong, I'm a hge fan of IPv6 and i think life would be unicorns and rainbows if we were all 100% ipv6, but the nasty realisty is that even in 2022 there are quite a few reason why we cant use it.

If you find yourself in this unfortunate sisutaion and your Ubuntu 20 box has an IPv6 address but ti's not working for what ever reason(Likely a misconfigure drouter that doesnt actually have poublic IPv6 access) then this might help you

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1