I am playing with Linux Virtual Servers in the Linode Cloud for the last several days and a couple of times wanted to disable IPv6 for testing purposes.

To quickly disable IPv6 execute command:

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

Create file in the /etc/sysctl.d/ directory to make this change permanent:

$ echo net.ipv6.conf.all.disable_ipv6=1 | sudo tee /etc/sysctl.d/disableipv6.conf
net.ipv6.conf.all.disable_ipv6=1