Different Docker 1.9 networks talk to each other?

I want to create two Docker 1.9 networks. Network A runs a web server, an application server, and a Postgres server (all containers). Network B runs a SMTP server and other containers. I need containers on Network A to get to Network B. Is it possible?

  • How to make nginx-docker container running always
  • Determine if new docker container available on docker hub
  • How to transfer large files between dockerized services?
  • Deploying Docker to AWS Elastic Beanstalk — how to forward port to host? (port binding)
  • How to avoid copying all the docker context directory?
  • How to move docker containers using device mapper to another machine without using docker commands
  • Multi-Node Hadoop in kubernetes
  • Some paths of cgroup of a docker container are missing
  • Failed to initialize libdc1394 when running caffe docker image
  • docker bridge network using docker-compose can't access VPN resources [closed]
  • Permission denied error when using docker import
  • How do I share the contents of a file two-way between host and container?
  • One Solution collect form web for “Different Docker 1.9 networks talk to each other?”

    The libnetwork implementation includes an overlay mode:

    The overlay driver implements networking that can span multiple hosts using overlay network encapsulations such as VXLAN. For more details on its design, please see the Overlay Driver Design.

    The new native overlay network driver supports multi-host networking natively out-of-the-box.
    This support is accomplished with the help of libnetwork, a built-in VXLAN-based overlay network driver, and Docker’s libkv library.

    This tutorial explains how to make containers talk to each other even if they are on different machines, provided they are registered to the same overlay network.

    That will involve setting up first a K/V (Key/Value) store:


    Now that your three nodes are configured to use the key-value store, you can create an overlay network on any node. When you create the network, it is distributed to all the nodes.

    When you create your first overlay network on any host, Docker also creates another network on each host called docker_gwbridge. Docker uses this network to provide external access for containers.

    Every container in an overlay network also gets an eth interface in the docker_gwbridge which allows the container to access the external world.
    The docker_gwbridge is similar to Docker’s default bridge network, but unlike the bridge it restricts Inter-Container Communication(ICC).
    Docker creates only one docker_gwbridge bridge network per host regardless of the number of overlay networks present.

    Docker added an entry to /etc/hosts for each container that belongs to the RED overlay network.
    Therefore, to reach container2 from container1, you can simply use its name. Docker automatically updates /etc/hosts when containers connect and disconnect from an overlay network.


    At this point, container2 and container3 can communicate over the RED overlay network.
    They are both on the same docker_gwbridge but they cannot communicate using that bridge network without host-port mapping. The docker_gwbridge is used for all other traffic.

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