The following may work on other systems as well but has been tested on Debian, Kali, and Ubuntu latest releases.

For various reasons, we often need to avoid using IPv6 addresses to facilitate penetration testing on our network, improve network stability, or test proxy settings without the eyesore of an IPv6 address. Since most Tekoso servers are running Debian based systems, we created this article for those with similar needs.

Using ifconfig we will see an output containing IPv6 and IPv4 addresses.

Edit the file – /etc/sysctl.conf

$ sudo nano /etc/sysctl.conf

Add the following to the end of this file.

# IPv6 disabled
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Save the file and close it

Now let’s restart sysctl with

$ sudo sysctl -p

And check the output of ifconfig again and there should be no ipv6 address

If this for some reason does not work for your system, a reboot may be in order, or a more advanced method than this. Our technicians are always ready to help and can be contacted through our support system.