I wasn’t able to find a solution to port-forward connection from host to container with dynamic IP. But I could do it for a container with a static ip using lxc.hook.start
and lxc.hook.stop
hooks and iptables.
I was thinking to use lxc.net.0.script.up
but ip is not assigned to a container at this stage. I tried to use lxc-info
in lxc.hook.start
hook. But in this case lxc-start
hangs.