Disabling IPv6 on Linux using sysfs

$ sudo -i
$ echo net.ipv6.conf.default.disable_ipv6=1 >> /etc/sysctl.conf
$ echo net.ipv6.conf.all.disable_ipv6=1 >> /etc/sysctl.conf
$ sysctl -p