2

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?

miho
  • 145
  • 1
  • 9
  • You could set the interface names to the old names by default, I'm not sure that this is done in the image. You need to edit /etc/default/grub and set GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0". Then apply the changes in the bootloader - grub-mkconfig -o /boot/grub/grub.cfg . – Alex Aug 24 '21 at 09:03
  • Having a closer look at `/etc/network/if-pre-up.d/cloud_inet6` (the failing script) it seems the failing check for `/proc/sys/net/ipv6/conf/ens18/disable_ipv6` only occurs in the DHCP branch. Disabling DHCP (using statically set IPs anyhow) did the job for me. – miho Sep 11 '21 at 09:55

2 Answers2

0

It seems a fix for this was now implemented by the Debian developers: commit 1f67aed1

Running the latest daily build of the Debian 11 generic cloud images does solve the issue.

miho
  • 145
  • 1
  • 9
0

If you are using ifupdown, installing ifupdown2 instead of ifupdown solved the problem here.

sudo apt-get update 
sudo apt-get install ifupdown2
Fco Javier Balón
  • 1,144
  • 2
  • 11
  • 31