Docker Community Forums

Share and learn in the Docker community.

Unable to ssh from container to any node when dockerd is started with --iptables=false

I started the dockerd with iptables=false to restrict the mess with my IPtables. Brought up my container and it it exposes 2 ports - 8081 & 8888.

Both the exposed ports are added manually to the IPTables as

iptables -I INPUT -p tcp -m tcp --dport 8081 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 8888 -j ACCEPT

its a web application and I’m able to bring it up on browser with the above specified rules.

Now the challenge is that I’m not able to SSH/SCP from container to other nodes (these are not containers but other VMs which are reachable), though I’m able to SSH/SCP from the host.

Any suggestions most welcome.

CLI’s used -

dockerd --iptables=false

iptables -I INPUT -p tcp -m tcp --dport 8081 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 8888 -j ACCEPT