no default gateway on OCI container with dhcp

komacke

New Member
Nov 23, 2025
3
0
1
I'm trying out the new OCI image feature. It's very cool!

I use DHCP to manage IP addresses across services from the network. When I launch turnkeylinux templates, IP addressing works fine.

I've tried launching the nginx:latest image from docker hub. It gets an IP address but does not get a gateway. It is not accessible from outside the subnet. It is accessible from within the subnet.

If I assign it a static IP address and gateway, the container is accessible outside the subnet.

I've verified the missing gateway by using lxc-attach, installing iproute2 package, and checking 'ip route'. The gateway is missing. If I manually add the gateway with " ip route add def via <gateway ip address>" then connectivity is enabled and the container is accessible. (Note: to install the ip route package, I had to temporarily assign a static ip address/gateway so the container could get internet connectivity.)

I believe I need to enable "Host-Managed" since the container does not have a dhcp-client. Is this perhaps a difference between turnkeylinux templates? They seem to have udhcpc in them, so maybe this points to the issue.

Dave
 
I believe I need to enable "Host-Managed" since the container does not have a dhcp-client. Is this perhaps a difference between turnkeylinux templates? They seem to have udhcpc in them, so maybe this points to the issue.
Yes, "host-managed" needs to be enabled, when the container does not run its own internal DHCP client on that network interface.
 
Sounds good. However the issue remains. No default route is assigned to the container in host-managed mode.

Is this a bug with the new OCI support?
 
Are you using IPv4 or IPv6?
Proxmox VE still uses isc-dhcp-client for host-managed interfaces, while turnkeylinux templates use udhcpc as their DHCP client. These two clients behave slightly differently.

Could you please test with the debian-13-standard LXC template? It also uses isc-dhcp-client, so it will show whether the gateway issue appears on regular system containers as well.
 
Last edited:
Hi Filip

This is ipv4 on an OCI-based container. I used the docker ngnix:latest image. It does not have a dhcp client installed so host-managed is necessary (which you confirmed)

The IP address gets set as provided by my external dhcp server. However the default gateway does not get set.

I only mentioned turnkey templates above to confirm they work fine with my external dhcp server, suggesting it is not a problem with my dhcp server. As you request I've tried it with the Debian lxc template and udhcp works fine.

I think proxmox has a bug with OCI images and host-managed set using dhcp where the default gateway does not get set in the container.

Dave