Hi Rob,
In my case when I create stack with use of docker-compose each service is named.
In the same network each container is having its network alias.
If you would invoke docker network insepct then you would see all containers.
For example :
[user@host]# docker network inspect bridge
[
{
“Name”: “bridge”,
“Id”: “c84060e75b4469605c261f0d3dd46da3f3de14260e690dc5139d23f7f0320de9”,
“Created”: “2017-04-05T13:03:53.104783046-05:00”,
“Scope”: “local”,
“Driver”: “bridge”,
“EnableIPv6”: false,
“IPAM”: {
“Driver”: “default”,
“Options”: null,
“Config”: [
{
“Subnet”: “172.17.0.0/16”,
“Gateway”: “172.17.0.1”
}
]
},
“Internal”: false,
“Attachable”: false,
“Containers”: {
“09ecc824a1250807ce03e5bd1109c50c289f37bc3cf9ed0f4b9db195556a714a”: {
“Name”: “r-network-services-metadata-1-99db119e”,
“EndpointID”: “9d9c5ff69b7a613aea2050f6a98f9ba258cddade9bbc1f4067a92761b5be671c”,
“MacAddress”: “02:48:e6:a2:b9:ff”,
“IPv4Address”: “172.17.0.9/16”,
“IPv6Address”: “”
},
“f1ec4f75e141a065584ba1fdceb475272177f8b5c486d50f58ad90c33bef9263”: {
“Name”: “proxy-test”,
“EndpointID”: “e11cefce46d6c238cf701188e4c635d1f9bd09af90e601bd4655932acc5a49cf”,
“MacAddress”: “02:42:ac:11:00:08”,
“IPv4Address”: “172.17.0.8/16”,
“IPv6Address”: “”
},
“fa2a22b4c12d834240039b3dcb6668424a27a95e6441383e92169bb2535f9270”: {
“Name”: “storage”,
“EndpointID”: “a25e6badacbd26682ec0cd60bf8835d5c5f18199f94d7e357572381339ab46ba”,
“MacAddress”: “02:42:ac:11:00:03”,
“IPv4Address”: “172.17.0.3/16”,
“IPv6Address”: “”
}
},
“Options”: {
“com.docker.network.bridge.default_bridge”: “true”,
“com.docker.network.bridge.enable_icc”: “true”,
“com.docker.network.bridge.enable_ip_masquerade”: “true”,
“com.docker.network.bridge.host_binding_ipv4”: “0.0.0.0”,
“com.docker.network.bridge.name”: “docker0”,
“com.docker.network.driver.mtu”: “1500”
},
“Labels”: {}
}
]
So in this example if you would log on via ssh to container “storage”, and you tried to “ping” container “proxy-test”, it would be resolved to “172.17.0.8” . This is basic docker networking which is used by Rancher.
Unfortunately if you would like to create stack with custom bridge network (custom name of the network which is bridge type), then I guess Rancher doesn’t supports it. This is actually my case.
EDIT: I just noticed that you’re asking for connectivity between 2 separate hosts (like vm’s or bare metal). Honestly I don’t know how it’s handled by docker/rancher. Maybe specific IP Table is created. Don’t know but it might be done this way. Maybe tunnel between 2 separate hosts is also solution.