-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
area/networkingNetworkingNetworking
Description
I have three containers.
- container1 is on the
bridge
- container2 is on the
bridge
and myisolated_nw
bridge - container3 is on the
isolated_nw
I expected to be able to ping 1/3 from inside 2 but I can only ping 3. Is this expected?
ubuntu@ip-172-31-36-118:~$ docker inspect --format='{{json .NetworkSettings.Networks}}' container1 | python -m json.tool
{
"bridge": {
"EndpointID": "3e056893bc83fd0996700e5fb557a064d0ca8e3c5ef416e25a486128d7f3b0c0",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03"
}
}
ubuntu@ip-172-31-36-118:~$ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | python -m json.tool
{
"bridge": {
"EndpointID": "9e31f4eb4d0a39b4e94a16bbcdfaa72508dd4bd1d878968be642464bc51a19bc",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.4",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:04"
},
"isolated_nw": {
"EndpointID": "b2924ec83b1458a4d0627bdb3b709912083797be7270310a445161cb399c13a9",
"Gateway": "172.22.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.22.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:16:00:02"
}
}
ubuntu@ip-172-31-36-118:~$ docker inspect --format='{{json .NetworkSettings.Networks}}' container3 | python -m json.tool
{
"isolated_nw": {
"EndpointID": "56ac55779690a263b402a3f64ff3ba8408a080e008c0506b05e57703cb7b401f",
"Gateway": "172.22.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.22.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:16:00:03"
}
}
ubuntu@ip-172-31-36-118:~$ docker attach container2
/ # cat /etc/hosts
172.17.0.4 4ba26d272c15
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.22.0.3 container3
172.22.0.3 container3.isolated_nw
/ # ping container3
PING container3 (172.22.0.3): 56 data bytes
64 bytes from 172.22.0.3: seq=0 ttl=64 time=0.084 ms
64 bytes from 172.22.0.3: seq=1 ttl=64 time=0.067 ms
64 bytes from 172.22.0.3: seq=2 ttl=64 time=0.070 ms
^C
--- container3 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.067/0.073/0.084 ms
/ # ping container1
ping: bad address 'container1'
/ # ping ubuntu@ip-172-31-36-118:~$ docker --version
Docker version 1.9.0-rc4, build e6f5a3c
ubuntu@ip-172-31-36-118:~$
Metadata
Metadata
Assignees
Labels
area/networkingNetworkingNetworking