[lxc-users] ssh the LXC container from outside world

Björn Mittelsdorf bjoern.mittelsdorf at scheer-management.com
Thu Apr 23 12:13:36 UTC 2015


Hi all,

I use the following statement pattern to expose single services inside the container to the outside world

sudo iptables -t nat -I PREROUTING -i eth1 -p TCP -d 1.2.9.1/32 --dport 51422 -j DNAT --to-destination 10.0.2.2:22

I cannot say which solution is the better one.

Best regards

Björn


Wojtek Arabczyk [mailto:arabek at gmail.com] wrote:

> On 16 Apr 2015, at 18:24, Sitesh Behera <sitesh.behera at bankbazaar.com> wrote:

> My issue is i can ping the container and even ssh from the local host. But unable to do so from any other host on the 192.168.13.x network. Please note the machine which hosts LXC is also on 192.168.13.X network.
> You forgot to setup packet forwarding:
> net.ipv4.conf.all.forwarding in sysctl.conf
> 
> Cheers


More information about the lxc-users mailing list