Disabling IPv6 on Linux

Check if ipv6 protocol support is enabled or disabled (0 – on, 1 – off):

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

To disable it, open the configuration file /etc/sysctl.conf in a text editor and specify:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Apply the changes:

sudo sysctl -p

Let’s see if there are ipv6 addresses on the network interfaces:

ifconfig | grep inet6

See also my article:
Lowering the priority of IPv6

Leave a comment

Leave a Reply