Assign port to already running LXC containers

Hi.

I’d like to know whether is it possible to assign port to already running containers? If thats not feasible,
can we stop and restart container with new ports? thanks

Hi!

If you are using LXD (version 3.0 or newer), then you can create a proxy device to forward TCP ports. No need to restart the container when you add/remove proxy devices.
See this post for more, https://blog.simos.info/how-to-use-the-lxd-proxy-device-to-map-ports-between-the-host-and-the-containers/

thanks, will follow those steps.