Disable on Centos/RHEL system:
1. Append below lines in /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
NOTE : To disable IPv6 on a single interface add below lines to /etc/sysctl.conf :
net.ipv6.conf.[interface].disable_ipv6 = 1 ### put interface name here [interface] net.ipv6.conf.default.disable_ipv6 = 1
2. To make the settings affective, execute :
# sysctl -p
Disable on Debian/Ubuntu system:
One method to make this option persist is modifying /etc/sysctl.conf. Add the following lines to the file:
net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1
For the settings to take effect use:
sudo sysctl -p