0

The host machine has an agent running on port 2000 I would like my docker running on bridge network sent data to the agent on the host machine. What changes do I have to do with the docker to that it can communicate with host,

kumar
  • 8,207
  • 20
  • 85
  • 176
  • Does this answer your question? [From inside of a Docker container, how do I connect to the localhost of the machine?](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach) – tgogos Jun 18 '20 at 14:00

1 Answers1

0

If you want to share the entire host network stack with your container you can run it with Host Networking enabled by passing the following argument: --network host.

Documentation Summary: https://docs.docker.com/network/host/

And a tutorial: https://docs.docker.com/network/network-tutorial-host/

Some other options include:

  1. Modifying the iptables rules on the host: iptables -A INPUT -i docker0 -j ACCEPT

  2. Routing all traffic to the docker0 interface.

TJ Zimmerman
  • 3,100
  • 25
  • 39