I have a LXC that runs OpenVPN. The container’s network adapter is a NAT bridge run by lxc-net.
Host machine = 192.168.1.103
LXC = 10.0.3.100
On the host, I added this to /etc/ufw/before.rules
*nat :PREROUTING ACCEPT [0:0] -A PREROUTING -i eth0 -p tcp --dport 22220 -j DNAT --to-destination 10.0.3.100:22 COMMIT
That allow me to connect to the LXC by this command:
ssh -p 22220 192.168.1.103
I can ssh into this container just fine when openvpn is not running, but when it connects, the ssh connect is frozen (cannot ctrl+c or do anything). Trying to ssh via another session just timeouts. I am wondering what I can do within the container (also using ufw) to prevent this. The container uses ufw which I setup per this wiki.