my new ISP forces me to reconnect every 24 hours and with the reconnect i get not only a new IPv4 address, but also a new IPv6 prefix. After the reconnect odhcp announces the new prefix and announces the old prefix as deprecated (for some time). This works for my iPhone, iPad and linux-servers as they immediately start using the new prefix for SLAAC. The old prefix is kept for a few hours (but not used) and then deleted. In my understanding, this is how it should work.
My MacBook on the other hand is not following along. If i wake the MacBook from sleep after odhcp stops announcing the old prefix as deprecated, i think MacOS is still trying to use the old prefix (and this test fails). I see ip addresses for the old and the new prefix in settings under TCP/IP, but i have to reconnect the wifi to get IPv6 working again.
I am struggling to verify this assumption, because i have not found a counterpart to ip addr on MacOS to view valid_lf and preferred_lft of the prefix.
Has anyone an idea on how to solve this? Is there maybe an option to announce the old prefix as deprecated for a longer time or to force MacOS to use only recently announced prefixes?
Ok ra_lifetime is already lowered to 300 with the settings above. I think it is automatically calculated from ra_mininterval or ra_maxinterval. Some time ago it tried to set ra_useleasetime, which crashed odhcp. I will try again.
Yes, in part. It is not showing the lifetime of the prefix.
Thanks, i was aware of this thread. In my case using the new prefix works, but not when the macbook sleeps through odhcp announcing the deprecation of the old prefix. At least i think that this is the problem.
This gets me a valid and pref time of 43200 s for the prefix. If i set option leasetime to a lower value. The valid time of the prefix is reduced, but the pref time stays 43200 s, which results in the devices not acquiring an IPv6-address at all.
I think i solved the issue by adding option preferred_lifetime '2h'. For the first two hours after the prefix change odhcp announces the old prefix with a preferred lifetime of 0. This works on all my devices and they are deprecating the old prefix, but if the macbook sleeps through the prefix change and has no connection in the first two hours it still tries to use the old prefix. With the setting above the old prefix should have a preferred lifetime of 0 when i wake the macbook (e.g. 3 hours after prefix change).
So unfortunately, I never got it to work properly. Even my iPad will not connect through IPv6 sometimes. Both iPad and MacBook are accumulating the IPv6 addresses and are probably getting confused by which one to use. I just disabled distributing IPv6 addresses via SLAAC (and DHCPv6) for now.