ncarlier / dockerfiles

My dockerfiles.
MIT License
52 stars 15 forks source link

redsocks - Docker Proxy only working for legacy Bridge Network #6

Closed DanielHabenicht closed 6 years ago

DanielHabenicht commented 6 years ago

Hi there,

first off huge shootout to you for providing this amazing docker image. I've searched the whole internet for something that easy to use.

Now the problem: The Docker container does only proxy containers that are connected to the legacy docker bridge network:

  1. Start the redsocks container as stated in your README with: docker run --privileged=true --net=host -d ncarlier/redsocks 1.2.3.4 3128
  2. Start a container outside of the docker bridge network:
    docker network create othernet
    docker run --net=othernet -it ubuntu bash
  3. The container started does not get proxied by your redsocks container.

I will provide a PR shortly.

ncarlier commented 6 years ago

Hello, thanks you for the feedback!

Regarding the use of dedicated Docker networks (like Swarm or Compose), I usually use a "sidekick" script to include or exclude the network from iptables rules. Here an example: https://github.com/ncarlier/kong-integration-samples/blob/master/proxy.sh

Forwarding all the trafic of ALL interfaces can be a problem in some cases (like mines).

Nevertheless I understand the need and I propose you to activate the configuration of this interface. I create another PR for this: https://github.com/ncarlier/dockerfiles/pull/8

Can you take a look at it and validate that it matches your needs.