Container static IP disappears in ~1min after startup

Hi All,

In my setup, I have configured the container’s config to get a static IP. The IP shows up on the veth interface, lxc-ls -f, but it will mysteriously disappear around a minute after starting the container. I’m using lxc-net to setup lxcbr0 and veth pairs. I’m running lxc 3.1.0.

Container’s config: = veth = lxcbr0 = 00:16:3e:1a:14:12 = = = 1500 = up


I’m not sure if the config is wrong or something else is causing this issue. Any help is much appreciated.


@brian is your container running a DHCP client that is periodically getting a dynamic IP from the DHCP server rather than keeping your manually assigned static IP?

@tomp The container isn’t running a DHCP client. I’ve also tried disabling dnsmasq and unplugging the Ethernet from the host machine, and the issue still persists. However, when I manually add the IP to the interface as root user(su) in the container, then the static IP will persist. If the container is started in privileged mode, then perhaps the static IP won’t disappear?

@brian does it happen if you do not connect your LXC container to the bridge, i.e remove the link line?

@tomp I removed the link line from the container’s and default config, but the IP still disappears.

OK @brian so that rules out DHCP I think.

Can you try the same config but with a freshly downloaded image, and can you let me know what distro you’re running?

@brian By chance, are you running cloud-init on this container?

@tomp I’ll give a new image a go and I’m running an Android container.

@rkelleyrtp Nope, no cloud-init.