IPV6 setting gone on reboot?

SYSTEM INFORMATION
OS type and version Debian Linux 11
Usermin version 2.202
Virtualmin version 7.30.7
Theme version 23.02
Apache version 2.4.62

Hi,

I setup ipv6 on Webmin/virtualmin and it worked flawless. However, the IPV6 address is gone on reboot.

I got:
Webmin → Network Configuration → Network Interfaces → Activated at Boot → ens6 →
Activate at boot: yes
IPv6 addresses: Static configuration: the-ipv6-address / netmask 64

But after a reboot the setting IPv6 addresses is back to radio box: IPv6 disabled.

I got another server with same setup, here it works on reboot. What am I missing here?

Hello,

Thanks for the heads-up!

Could you provide more details about the ip a command output, and the contents of the /etc/network/interfaces file before and after the change?

Hi,

Thanks for looking into this.

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:

auto ens6
allow-hotplug ens6

iface ens6 inet dhcp

iface ens6 inet6 static
        pre-up /sbin/modprobe -q ipv6 ; /bin/true
        address bbbb:3333:111:5555:1::1
        netmask 64

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.

@Jamie, I think this is the scenario we discussed. It’s not uncommon to mix auto with static configurations.

@Mikky23 You should switch all interfaces to static configuration—then Webmin will be able to handle it properly, but only with Webmin 2.303 and up.

Hi,

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?

Followup: I did remove the all record. Set both ipv4 and ipv6 to static addresses. Saved and rebooted, but all is gone and back to dynamic DCHP again.

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.