Static ipv4 addresses are not getting set


Currently i am working on a POC. My test environment is:

OpenWRT VM (in virtual box) --> 2 LXC Containers (1 alpine, 1 openwrt)

I am able to create lxc containers, start, stop, etc…

Dynamic IP addresses are assigned to the containers ( and

I want to set static IP addresses. I modified the /srv/lxc/alpine1/config file and set the following parameters: = = auto

Restarted the containers. But, static IP addresses are not getting assigned

Am i missing something.

Note: lxc-net service is not available in OpenWRT.


That should work, but it assumes that you don’t have something in your container going and either resetting the interface or running a DHCP client or something.

As @stgraber mentioned, its likely that Alpine’s default config is removing the static IP configuration setup by LXC during its DHCP request.

Inside the alpine container you can set /etc/network/interfaces as so to disable DHCP:

auto eth0
iface eth0 inet manual
hostname $(hostname)

Thanks @stgraber and @tomp

It is fine now. Changing dhcp to manual worked.