Cloud-init re-enables IPv6 despite sysctl disabled setting

herzkerl

Active Member
Mar 18, 2021
104
21
38
Hi everyone,

I’m currently facing an issue with disabling IPv6 on a VM using Cloud-init. For this particular machine, I didn’t configure any IPv6 settings in Cloud-init (left it as static but empty). Despite having net.ipv6.conf.all.disable_ipv6 = 1 set in sysctl.conf, the VM still gets an IPv6 address assigned to eth0 after a reboot.

From what I understand, Cloud-init seems to apply configurations after sysctl.conf, which might be why IPv6 gets re-enabled.

Has anyone experienced this issue or found a more permanent fix?

Thanks in advance!
 
Experienced same issue.
What kind of IPv6 address? A link-local (fe80::<something>)? Or a real one? Did you check that the setting is really in /etc/sysctl.conf? What OS are you configuring?
As IPv6 is enabled, in my case on a VM bridged to NIC facing hosting provider network, i.e. Internet directly, the VM gets real (2a06:dd00:...) addresses via DHCPv6, which seems to be default Cloud-init behavior which could not be configured in Proxmox VE. The settings to disable IPv6 via sysctl are in `/etc/sysctl.conf ` indeed and they are correct as they disable IPv6 via `sysctl -p` until reboot. Tried even to disable IPv6 via `/etc/modprobe/blacklist.conf` and `update-initramfs -u`, but with no effect. OS in my case is Debian 12.

It seems that the only way to disable IPv6 in Linux VM on Proxmox at the moment is to add `ipv6.disable=1` to GRUB_CMDLINE_LINUX, update grub2 config and reboot the system.