1

If I run ifconfig I can see that there are no ipv6 addresses assigned to any of the interfaces. I get an error telling that the address family is not supported if I try to create AF_INET6 socket. I do not have /proc/sys/net/inet6 folder. The machine runs Debian 10 (buster). In /etc/default/grub there is no lines about ipv6 disabling.

$ uname -r
4.19.52.1.amd64-smp

Could you, please, tell how can I enable ipv6? I find many articles on how to disable it but not how to enable it.

4

There are many ways to disable IPv6 in Linux, so you'll have to check for them all.

First, your kernel version does not quite look like Debian 10 standard AMD64 kernel. If you are using a custom kernel, IPv6 may be disabled at kernel compilation time, in which case you'll need to recompile the kernel (or switch to another kernel) to get it enabled.

Please run grep CONFIG_IPV6 /boot/config-$(uname -r) and see what it says. If the response includes a line:

# CONFIG_IPV6 is not set

then your current kernel had its IPv6 support disabled at compilation time.

If the response includes a line:

CONFIG_IPV6=m

then the IPv6 support is compiled as a kernel module.

If there is instead a line:

CONFIG_IPV6=y

then IPv6 support is compiled in to the main kernel. In this case, one way to disable IPv6 would be to add boot option ipv6.disable=1 to the kernel command line (in /etc/default/grub) but you said you've already checked for that.

IPv6 compiled as a module

Please run modprobe -c |grep "options ipv6" as root. If the response includes a line:

options ipv6 disable=1

then IPv6 is disabled by kernel module configuration, and you should find that line in one of the files in /etc/modprobe.d.

To re-enable IPv6 in this case, find that line, comment it out, and run update-initramfs -u as root to make sure IPv6 does not get disabled at early boot, as this disabling strategy may require a reboot to re-enable.

(In theory, unloading and re-loading the ipv6 after commenting out the disable option should suffice, but because of dependencies between modules, it might be hard to actually do without rebooting.)

Methods applicable for both modular and compiled-in IPv6

You should also check the sysctl settings:

grep "disable_ipv6" /etc/sysctl.conf /etc/sysctl.d/*.conf

If the output includes lines like this, then IPv6 has been disabled through sysctl settings:

net.ipv6.conf.<something>.disable_ipv6 = 1

Here, <something> might be the word all or default, or a name of a specific network interface. To re-enable, comment out the disable_ipv6 lines and run sysctl -p as root, then reboot (or just reconfigure your network interfaces).

  • Thank you very much for such a great answer! For me, it turned out "CONFIG_IPV6=m" and "options ipv6 disable=1 disable_ipv6=1". – JenyaKh Aug 31 '19 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.