2
1
This is problem I'm trying to solve for some time now. I've tried as many resources as I could try, but nothing has yet worked for me. :/
Here's what I'm trying to tackle:
I want to be able to deploy Docker containers and access them from a machine that resides in the same local network. That means that the IP addresses that Docker handouts to the containers have to be reachable from a client computer on the same LAN as the computer that host Docker.
Ideally, people would just have to add a route that points to the Docker host as a gateway for the Docker network, like:
client@lan$ sudo route add -net <docker-network>/<mask> gw <docker-host>
And boom, they can access the containers just by typing their IP. This route can also be set up from the router, of course.
I've seen that network bridges help doing this, but I could not get one to work this way.
How do you get all of this to work ?
That route you show above should not reside on the clients, but in your LAN router's routing table instead. If it is not in your LAN router, traffic to this net block will go to the default route (possibly the internet). – diametralpitch – 2017-05-11T19:32:30.797
Have you seen this one? http://stackoverflow.com/questions/25036895/how-to-expose-docker-containers-ip-and-port-to-outside-docker-host-without-port
– diametralpitch – 2017-05-11T19:33:21.623@diametralpitch I've read your link, the second answer is closer to what I'm looking for (bridging), but I can't get it to work. Does the containers linked to the bridge need to have an IP address on the same network as the LAN or not? My goal is that, without any intervention that goes further than the network setup, the containers that gets created are given a unique IP address that people on my private network can access. – iiPLD – 2017-05-12T10:03:33.827