IP control - jhu-information-security-institute/NwSec GitHub Wiki
To check if IPv6 is enabled or disabled
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0
means itโs enabled and 1
is disabled
To disable IPv6:
$ su -
# nano /etc/sysctl.conf
and add these lines to sysctl.conf file:
#disable ipv6 by adding any of the below
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.wlan0.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
Save sysctl.conf file with new config, then reboot your system
References
https://askubuntu.com/questions/316492/disabling-ipv6-on-a-single-interface