Due to my issues getting static IPv6 addresses to work, I want to test SLAAC instead.
Since I think it doesn’t seem right to have these random-looking SLAAC addresses mixed with statically assigned IPv4 addresses, I want to switch to DHCP for IPv4.
I recall this being the “just works” default in LXD, but maybe that’s with Ubuntu containers. The host is running LXD 3.21 snap btw.
To be sure, I deleted my old bridge and created a new one without any customizations.
lxc network delete lxdbr0
lxc network create lxdbr5
lxc init images:alpine/3.11/amd64 a2
lxc network attach lxdbr5 a2
lxc start a2
The container unreliably acquires and IPv6 (presumably SLAAC) without me doing anything. The container does not however acquire an IPv4 address.
a2/etc/network/interfaces (default):
auto eth0
iface eth0 inet dhcp
hostname $(hostname)
When I restart a2’s network, it looks like it gets no DHCP response:
rc-service networking restart
* Stopping networking ...
* eth0 ... [ ok ]
* Starting networking ...
* eth0 ...
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc failed to get a DHCP lease
udhcpc: no lease, forking to background
It then keeps sending BOOTPC queries in the background to no avail.
Setting a static IP in a2/etc/network/interfaces works fine:
iface eth0 inet static
address 10.42.0.88
netmask 255.255.255.0
gateway 10.42.0.1
Any idea what’s going on? Do Alpine containers require additional manual configuration? As I mentioned, I recall LXD forcing random addresses (IPv4 included) onto my containers in the past, and now I can’t even coax it to do so.