
In fact, Docker daemon creates a lot of iptables rules when it starts to do its magic concerning containers network connectivity. And concerning gateways, routed traffic is not handled by the INPUT table, but by the FORWARD table, which makes the rule posted before uneffective.īut it's not all. They rely on a virtual network in your host, and the host acts as a gateway for this network. Indeed, Docker containers are not host services. It won't work, your containers are still accessible for everyone. $ iptables -A INPUT -i eth0 -p tcp -s -j ACCEPT Then a rule like this should give access to your web services only for IP. At first, you would think that "classic" firewall rules should do the trick.įor example, let's assume that you have configured a nginx-proxy container + several service containers to expose via HTTPS some personal web services.


