Redirect traffic from docker container into localhost

I have a Docker host with a tunnel listening on 127.0.0.1. There is a container that sends out traffic. I need to get this traffic into the tunnel.

The Docker host is running CentOS 7.2 and I have made the service inside the Docker container send everything to 172.17.42.1, which is the IP of the docker0 interface.

  • Authenticating Jupyter Notebook inside Docker keeps resulting in invalid token
  • Dockerfile build using complex powershell script on windows container
  • Jenkins build an image for Docker?
  • architechtetural thoughts about dockerizing the exsting services
  • Launch docker container for each user
  • Unable to run rabbitmq using marathon mesos
  • In firewalld, I have created a docker zone which looks like this:

    docker (active)
      interfaces: docker0
      sources: 
      services: 
      ports: 
      masquerade: yes
      forward-ports: port=514:proto=udp:toport=514:toaddr=127.0.0.1
      icmp-blocks: 
      rich rules: 
    

    Checking with tcpdump, there is traffic on docker0 on port 514 but there’s no traffic on lo on port 514.

    What am I doing wrong?

  • How to set the Docker IP the same as your computer (local) IP address
  • Jenkins and Docker
  • Configure Dockerfile to use impdp command when the container is created
  • Proper workflow for web development with Docker
  • how to update docker in coreos
  • getting to the files system of the Alpine linux which runs Docker-for-mac
  • One Solution collect form web for “Redirect traffic from docker container into localhost”

    Check that your Docker version plays well with firewalld.
    It was fixed just recently: https://github.com/docker/docker/issues/16137

    RedHat still recommends to disable firewalld with Docker version included in their repository (1.10.3 currently): https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/version-7/getting-started-with-containers/#setting_up_to_deploy_docker_containers_with_kubernetes

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.