Bug? Static IP not applied inside OCI/unprivileged LXC containers

vovo500

New Member
Dec 22, 2025
8
1
3

When creating an unprivileged LXC container from an OCI image (e.g. pct create ... --ostype unmanaged) and setting a static IP via:

pct set 129 --net0 "name=eth0,bridge=vmbr1,ip=10.0.0.50/24,gw=10.0.0.1"<br>
The Proxmox config (/etc/pve/lxc/129.conf) correctly shows:

net0: name=eth0,bridge=vmbr1,gw=10.0.0.1,ip=10.0.0.50/24,type=veth<br>
However, the generated LXC config (/var/lib/lxc/129/config) only contains:

lxc.net.0.type = veth<br>lxc.net.0.veth.pair = veth129i0<br>lxc.net.0.hwaddr = BC:24:11:63:69:63<br>lxc.net.0.name = eth0<br>lxc.net.0.mtu = 1500<br>lxc.net.0.script.up = /usr/share/lxc/lxcnetaddbr<br>
Missing: lxc.net.0.ipv4.address, lxc.net.0.ipv4.gateway, and lxc.net.0.flags = up.

The veth pair is created and correctly attached to the bridge (via lxcnetaddbr), but inside the container eth0 remains DOWN with no IP assigned:

2: eth0@if34: &lt;BROADCAST,MULTICAST,M-DOWN&gt; mtu 1500 qdisc noop state DOWN<br> link/ether bc:24:11:63:69:63 brd ff:ff:ff:ff:ff:ff<br>
Root cause: Proxmox does not set lxc.net.0.ipv4.address in the generated LXC config. Instead, it relies on the container's init system to configure networking by writing /etc/network/interfaces (Alpine/OpenRC) or equivalent files into the container's rootfs before start. For OCI image containers, the rootfs comes from the Docker image, which has no such network init — so the IP is never applied.

Workaround: Manually configure the interface after container start:

pct exec 129 -- ip addr add 10.0.0.50/24 dev eth0
pct exec 129 -- ip link set eth0 up
pct exec 129 -- ip route add default via 10.0.0.1
After this, the container is reachable at 10.0.0.50.

Expected behavior: When ip= is set in net0, Proxmox should generate lxc.net.0.ipv4.address and lxc.net.0.flags = up in the LXC config so the IP is applied at the namespace level, independent of the container's init system.
 
Did you try enabling host-managed on the container network interface? That should set the appropriate lxc.net.0.ipv4 configuration.
It can be found in the Web UI in the advanced section of the container network interface.
 
Last edited: