ip a gives normal info on both servers, I believe it is indeed in /etc/network/interfaces that you point out.
In interfaces I see:
auto
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
# Cloud images dynamically generate config fragments for newly
# attached interfaces. See /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d
And looking in /etc/network/interfaces.d I see the file 50-cloud-init which contains on the server where it works fine:
auto lo
iface lo inet loopback
auto ens6
iface ens6 inet dhcp
iface ens6 inet6 static
pre-up /sbin/modprobe -q ipv6 ; /bin/true
address aaaa:2222:222:6666:1::1
netmask 64
but on the ‘problem’ server just:
auto lo
iface lo inet loopback
auto all
iface all inet dhcp
# control-alias all
iface all inet6 dhcp
And at the working server /run/network/interfaces.d is empty and the ‘problem’ server it has the file ens6 in it with content:
Could it be a bug? Did I misconfigure anything? I thought I setup the ipv6 on all servers the same and it has been working (even with reboots) fore quite a while as far as I was aware of.
I see. I’ve spotted one difference between the working server and the other one. That is the all record in the Activated at Boot tab. This is only on the server that keeps forgetting the settings.
(I set both ipv4 and ipv6 to static addresses in ens6, but on reboot it was back to From DHCP again)
Can I throw the all record out and then set both ipv4 and ipv6 to static addresses on the ens6 record?
If your static IP configuration resets to DHCP after a reboot, the issue is likely due to cloud-init overwriting the changes—I recommend asking your cloud provider about this issue.
I will see if I can remove/change the cloud-init. It’s a VPS and installed with an Debian 11 image. Maybe they changed the settings in it over time and that’s why the first server is doing fine and the others have this problem. Although… it was working fine before.