New, different IPv6 address every time

Hello everyone :slight_smile:

I had to upgrade from my Rpi3b+ to the new Rpi4 and so far everything is working perfectly :grin: Nearly at least.

I am using Duckdns to access my Home Assistant remotely but unfortunately I am stuck behind a CG-Nat, meaning I can only access my devices from outside my network via IPv6. There is no way to change that. The problem is, that this new Pi somehow is assigned a new IPv6 address every time the Pi or my router are rebooted and since the Duckdns Addon is only updating the IPv4 address (which stays the same btw) I keep losing access to my Home Assistant regularly. Previously, my Pi was assigned the same IPv6 address every time.

Does anyone have an idea what might have caused this change or even know a fix for my problem?

Thanks in advance
Tafelbomber

1 Like

to me that sounds like dhcp needs setting up, what i would do if you can is to set a static address for the mac so then the IPv6 stays the same?

1 Like

Thank you for the suggestion. I forgot to mention that before but my router does not support that. I have assigned a static network internal ipv4 address to my Pi’s mac address and that is unfortunately all I’m able to do. The router does not support that for ipv6.

Does your provider support IPv6 PD (prefix delegation) and assigns a static prefix (i.e. a range of IPv6 addresses) to your connection, or is it really that you get a random IPv6 address each time the router reconnects?
If PD, then you could configure a static IPv6 address out of the delegated range on your Pi.

1 Like

I do have a static prefix. Could you kindly explain to me how I would be able to set a static IPv6 address on my Pi? I don’t really know how to do it on Hass.io when my router does not support that.

Thank you!

I’m very sorry, but I’m not a hass.io user myself.

There is a thread about configuring a static IPv4 address: How To: Set a Static IP on Hass.io/HassOS

I could make some guesses on how the ipv6 section of the configuration should look like (e.g. method=manual, adding a static address from your range like address1=1234:1234:1234::1/64, adding DNS which could be your router’s address dns=...), but maybe someone else on this forum has already done that?

1 Like

I’ve got it to work today!

The solution was changing this

[ipv6]
addr-gen-mode=stable-privacy

to this

[ipv6]
addr-gen-mode=eui64

in the file described here https://github.com/home-assistant/hassos/blob/712dcf9f74497eef6a75ed1e76f8ae8817ae3ee6/Documentation/network.md.

The meaning of the settings described above can be found here: https://developer.gnome.org/libnm/stable/NMSettingIP6Config.html#NMSettingIP6ConfigAddrGenMode.

I hope this helps someone else as well! :smiley:

4 Likes