...

/

Test the Overlay Network

Test the Overlay Network

Let's test the overlay network we just created.

The figure below shows the current setup with two containers running on different Docker hosts but connected to the same overlay.

Press + to interact
Single overlay network spanning two Docker hosts on separate networks
Single overlay network spanning two Docker hosts on separate networks

The following steps will walk you through obtaining the container names and IP addresses and then seeing if they can ping each other.

The docker network inspect command

Switch back to node1 and run a docker network inspect to see the overlay network’s subnet information and any IP addresses it’s assigned to service replicas.

$ docker network inspect uber-net
[
{
"Name": "uber-net",
"Id": "vdu1yly429jvt04hgdm0mjqc6",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.0.0.0/24", <<---- Subnet info
"Gateway": "10.0.0.1" <<---- Subnet info
}
"Containers": {
"Name": "test.1.tro80xqwm7k1bsyn3mt1fjkgk", <<---- Replica ID
"IPv4Address": "10.0.0.3/24", <<---- Container IP
<Snip>
},
<Snip>
Listing the details of the uber-net overlay network

We’ve snipped the output and highlighted the subnet info and the IPs of ...