Totally disable ipv6

Hello,

I want to totally disable ipv6 in my Home Assistant (hassio through VM)

I disabled ipv6 in settings (system/network/ipv6/disabled) but HA is still using ipv6 on my network interface (enp0s3)

I disabled ipv6 on enp0s3 through SSH using nmcli command :

nmcli connection modify Supervisor\ enp0s3 ipv6.method “disabled”

It works, it disable ipv6 but… if I restart my VM ipv6 is back again

Do you have any idea to totally disable it ?

Many thanks !

Hi!

That is exactly the same problem I have currently. My HA drops from cloud every day.
Any new information how to fix this?

  • Jarmo

I played around some, but ended up only re-confirming your findings.
I did a test using the nmcli command you mentioned, and I looked inside
/etc/NetworkManager/system-connections/Supervisor\ enp0s3.nmconnection and it shows the ipv6 entries:

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=disabled

But after a reboot, the method changed to link-local.
I don’t really know why. AFAIK a modify on a connection profile is suppose to persist.

+1 to this issue here. My HA drops out every 40 minutes or so. Today I can’t connect at all.

Was fix or work around found?

Would be interested to know this too.

The only thing I can suggest is seeing if you can disable IPv6 on whatever you’re using for a router, if it supports that.

Also, if you’re on a Supervised version of Home Assistant, you can got to settings/config/network and disable IPv6 in there.

You can’t disable IPV6 on some router and… unfortunately that’s my case :slight_smile:

Like I said in original post, IPV6 is already disabled in settings (settings/config/network) but it doesn’t seem to really disable it

1 Like

This command did the job.

nmcli connection modify <connection_name> ipv6.method ignore

To check if ipv6 is permanently disabled you can

cat /etc/NetworkManager/system-connections/<connection_name>

There you should find method=ignore

This won’t survive a reboot either.

Did anyone find a permanent solution?

I’m wondering if I can find a spot in the startup to insert the command so it happens at the end of the boot process. I’ll let you know if I figure it out.

I don’t use Hassio, rather just run the Home Assistant docker container in a Ubuntu VM on Proxmox. That said, the following modification to the linux kernel boot line disables IPV6 for the VM.

‘disabled ipv6 using this:’

sudo -s
vi /etc/default/grub

FROM:
GRUB_CMDLINE_LINUX_DEFAULT=""
TO:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

sudo update-grub
sudo sync
sudo reboot

Worked fine!

Just to confirm, it did survive a reboot?

Sadly Hassio (VM) doesn’t have the /etc/default/grub file, nor the update-grub command, so this is not straight forward.

BUT, there’s a way to do it:

Edit the Grub config file:

vi /mnt/boot/EFI/BOOT/grub.cfg

Find the default_cmdline variable (it’s near the end, at ~83% of the file)
At the end, add the following before the closing quote:

ipv6.disable=1

For example: (DON’T COPY THESE, as your default_cmdline may vary and would leave your system unusable)

#Before
default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 systemd.machine_id=$MACHINE_ID fsck.repair=yes $boot_condition"
#After
default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 systemd.machine_id=$MACHINE_ID fsck.repair=yes $boot_condition ipv6.disable=1"

After that, just reboot and then check with ip addr

Just note that this will disable IPV6 entirely and might make some issues in HA as clearly HASSIO wasn’t prepared to have IPV6 disabled system-wide

For instance, Matter support doesn’t happen without IPV6…

2 Likes