#StackBounty: #debian #cloud-init Debian 11 fails to set IPv6 via Cloud-Init: "ens18/disable_ipv6: No such file or directory"

Bounty: 50

When using Cloud-Init to set both a static IPv4 and IPv6 in the latest Debian 11 (generic) cloud image, networking.service throws the following error at boot:

Aug 16 14:28:29 debian ifup[540]: sysctl: cannot stat /proc/sys/net/ipv6/conf/ens18/disable_ipv6: No such file or directory

Which seems about right, as there is no ens18:

$ ls /proc/sys/net/ipv6/conf/
all  default  eth0  lo

And, once the image is booted up, only the static IPv4 address is set:

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:b3:31:24:72:f1 brd ff:ff:ff:ff:ff:ff
    altname enp0s18
    altname ens18
    inet 1.2.3.4/26 brd 1.2.3.1 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::50b3:31ff:fe24:72f1/64 scope link 
       valid_lft forever preferred_lft forever

The /etc/network/interfaces config, however, is generated correctly by Cloud-Init:

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
    dns-nameservers 1.1.1.1 1.0.0.1 2a0d:1234:100::100
    dns-search vie.alwyzon.net

auto eth0
iface eth0 inet static
    address 1.2.3.4/26
    gateway 1.2.3.1

# control-alias eth0
iface eth0 inet6 static
    address 2a00:1234:1234:fee1::1/48
    gateway 2a00:1234:1234::1

The interface already was named ens18 in Debian 10 (and also on other platforms: Ubuntu, CentOS, openSUSE, …) and didn’t make any issues there. (The choice of ens18 is likely related to Proxmox; although I’m not exactly sure where/who made this choice.) However, this alias eth0 pointing towards ens18 seems new in Debian 11. In the Debian 10 images, ens18 was just directly used and no eth0 alias was shown anywhere.

Any idea how I could make these new Debian 11 Cloud-Init images work with the ens18 image?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.