In most cases you have a docker container that you expose a port on the host so it can be accessed on to your local network ... what I am trying to do is the exact opposite.

I have an application that is designed to discover and manage IoT devices on a network. I have x1000+ docker containers setup like various IoT devices and would now like to have my windows application (running on a different machine) be able to search the 172.17.x.x virtual network within docker for stress testing.

I could setup a single docker node to act as a pptp vpn that I could have the windows machine connect too ... but I am wondering if there is a simpler solution.


This is not the full answer because technically its not adding a computer to the internal docker network, however, you can communicate with a docker network from a computer on the hosts network.

For example, if you have the following real network devices:

  • - (r1) network router
  • - (h2) random computer
  • - (h3) docker host

and the following docker network:

  • - (d1) docker router (you dont have to set it up ... its just there)
  • - (d2) docker node

by default you can ping (r1),(h2),(h3) from (d2)

if however you want to ping (d2) from (h2) you will need to setup a route for the network. This can be achieved by enabling routing on (h3) with:

sysctl -w net.ipv4.ip_forward=1

and then set a static route in either (h2) or (r1) with:

route add -net netmask gw

The end result will be that (h2) can communicate with any device on the network with out needing to bind ports to the docker host or setup aliases to eth0 on the docker host.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.