Docker Community Forums

Share and learn in the Docker community.

Transparent proxy one container with another using iptables


(Technosites) #1

I am running a tor container, as described here: Routing traffic through tor docker container

The iptables script listed works great for routing my host traffic through to the tor container (which runs with -host net) but it doesn’t route the traffic from another container (running with default docker networking).

This article suggests I should be using the PREROUTING chain, but I’m not sure how the default docker iptables for forwarding across docker0 works (I’m not great with iptables in general).

How do I configure iptables on the host to transparently proxy traffic from the docker0 interface to the tor container?