steps
-
method 1
-
disable all nic
$ nano /etc/sysctl.conf ... net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 ...
-
disable special nic
$ nano /etc/sysctl.conf ... net.ipv6.conf.eno1.disable_ipv6=1
-
to make the setting affective execute, no reboot required
$ sysctl -p
-
-
method 2
-
use echo
$ echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 $ echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
-
use sysctl
$ sysctl -w net.ipv6.conf.all.disable_ipv6=1 $ sysctl -w net.ipv6.conf.default.disable_ipv6=1
-