LXD manually set IP for instance over a bridged network

Alternatively, you could create a proxy device that would sort-of enable port-forwarding for connections reaching to the host, getting forwarded to the container.
See, for example, How to use the LXD Proxy Device to map ports between the host and the containers – Mi blog lah! Requires LXD 3.0 or newer.

The very latest LXD, LXD 4.5, is able to create a managed macvlan. That is, the container is accessible from the LAN but the IP address it takes, has been provided by LXD. See more at LXD 4.4 has been released (managed macvlan).

All in all, I suggest the proxy device, possibly with the NAT option.

1 Like