Skip to content

cloud-images don't work for static network configuration.

I have updated my cloud-init to cloud-init_20.1-2~bpo10+1_all.deb from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=947351 to get static networking working. 20.1 includes https://github.com/canonical/cloud-init/commit/a6faf3acef02bd8cd4d46ac9efeebf24b3f21d81 which is required to get the config accepted at all by debian.

Now the generated cloud-config interfaces looks like this:

cat /etc/network/interfaces.d/50-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 172.22.3.1
    dns-search bap.lan

auto eth0
iface eth0 inet static
    address 172.22.3.201/24
    gateway 172.22.3.1

While the IP stuff is working, DNS is not set in /etc/resolv.conf as this would require resolvconf to be installed. Would it be possible to include this in the default images? If not how is DNS configuration supposed to get applied when not using DHCP?