I just spent about an hour debugging why a fresh alpine/3.24 container downloaded directly from images.linuxcontainers.org did not pick up the name server distributed by Incus. My network setup in Incus is IPv6 only without DHCPv6.
The problem turned out to be on the instance side: As distributed by images.linuxcontainers.org, the Alpine images use the Linux kernel support for SLAAC only, which does not pick up name servers from the router advertisements. To support that, either the ‘dhcpcd’ package or the ‘rdnssd’ package has to be installed in Alpine Linux.
Note: I did not test with DHCPv6 (either stateless or stateful) enabled in the Incus config, but from the instance setup it will probably not work at all, since that would require either ‘dhcpcd’ or non-standard setup in the Alpine network configuration to use udhcpc6 (which is installed by default as it comes with busybox).
For my use case, I resolved the problem by manually installing rdnssd in the instance (because I don’t intend to use DHCPv6 on that network). For generic support that properly picks up all the combinations of IPv4 DHCP, IPv6 SLAAC and DHCPv6 (stateless or stateful) that can be configured in an Incus managed network, dhcpcd is probably the best choice.
In other images, we usually have systemd-networkd handle RDNSS/DNSSL on top of SLAAC for us but obviously Alpine doesn’t use systemd.
The difficulty may be to do this without regressing IPv4-only deployments though as you don’t want to see systems sitting trying to do DHCPv6 or waiting for an RA when they’ll never get one.
In other images, we usually have systemd-networkd handle RDNSS/DNSSL on top of SLAAC for us but obviously Alpine doesn’t use systemd.
No, Alpine uses OpenRC as init system and ifupdown-ng for network configuration. And ifupdown-ng in turn can use either dhcpcd, dhclient or udhcp for dynamic network configuration, depending on what is installed (preference for each client is as stated above).
The difficulty may be to do this without regressing IPv4-only deployments though as you don’t want to see systems sitting trying to do DHCPv6 or waiting for an RA when they’ll never get one.
That should be no problem, dhcpcd handles both IPv4 and IPv6 and is pretty good at picking up whatever upstream sends to it.