Unable to set LXC with static IP

fizzasist

New Member
Oct 27, 2025
9
0
1
Can't seem to get a static IP to take on one of my containers. I made sure the IP is not in use and I added etho and vmbr0, selected static and put in 192.168.111.80/24 and a gateway of 192.168.111.1 (my ASUS router). When I restart it, it pulls a DHCP address. I even tried adding a reservation for that specific address (the DHCP one) and when I reboot the host proxmox, it pulled a DIFFERENT DHCP address.

Not sure what is going on here.....any help would be much appreciated!
 
What distribution is running in the container?

Can you please provide the output of pct config <container-id> on the host and ip addr inside of the container?
 
root@proxmox:~# pct config 102
arch: amd64
description: 192.168.111.121%0A
hostname: openwrt
memory: 512
mp0: store:subvol-102-disk-1,mp=/data,backup=1,size=8G
net0: name=eth0,bridge=vmbr0,hwaddr=BC:24:11:4E:83:E1,ip=dhcp,type=veth
net1: name=eth1,bridge=vmbr1,firewall=1,hwaddr=BC:24:11:D9:02:D1,ip=dhcp,type=veth
onboot: 1
ostype: unmanaged
rootfs: store:subvol-102-disk-0,size=4G
swap: 512
unprivileged: 1
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir
 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if13: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether bc:24:11:4e:83:e1 brd ff:ff:ff:ff:ff:ff
inet 192.168.111.122/24 brd 192.168.111.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fd12:5634:7a4a:834a:be24:11ff:fe4e:83e1/64 scope global dynamic noprefixroute
valid_lft 1632sec preferred_lft 1632sec
inet6 fe80::be24:11ff:fe4e:83e1/64 scope link
valid_lft forever preferred_lft forever
3: eth1@if14: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether bc:24:11:d9:02:d1 brd ff:ff:ff:ff:ff:ff
inet 10.50.50.1/24 brd 10.50.50.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::be24:11ff:fed9:2d1/64 scope link
valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
link/[65534]
inet 10.6.112.64/24 scope global tun0
valid_lft forever preferred_lft forever
inet6 fe80::cf0:620c:ff04:f4b/64 scope link flags 800
valid_lft forever preferred_lft forever
 
For ostype: unmanaged containers you need to configure the IP inside the container.

Based on the hostname I'm guessing you are running OpenWrt, so you would have to modify /etc/config/network