Thursday, January 10, 2019

Enable or disable IPv6

This is a reminder on how to either disable or enable IPv6 for troubleshooting purposes.

Disabling:

$ 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


Also, in order to make the change permanent add the following lines to /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

net.ipv6.conf.lo.disable_ipv6 = 1


----

To Re-Enable, simply replace 1 with 0:

$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0

$ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0

$ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0


 And make the changes to /etc/sysctl.conf as well or simply remove those lines.