Docker Community Forums

Share and learn in the Docker community.

Two containers with same network can NOT ping each other

Description

I find that two containers with same network can not ping each other and the bridge network port bring down after the related docker network connected to a container.

But it work well after ifconfig xx up

Steps

  1. Create a network
$ docker network create -o "com.docker.network.bridge.name"="tt" test
  1. Create a container
$ docker run -it -d ubuntu /bin/sh
449xxxxxxxxxxxxxxxx
  1. Remove IP address from the bridge interface
$ ifconfig tt 0.0.0.0

check the interface state
4. Connect the network to the container

$ docker network connect test 449

Check the interface state again

Some information.

OS version

$ uname -a
Linux R710 4.15.0-54-generic #58~16.04.1-Ubuntu SMP Mon Jun 24 13:21:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

Docker versions

$ docker version
Client:
 Version:           18.09.6
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        481bc77
 Built:             Sat May  4 02:35:27 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.6
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       481bc77
  Built:            Sat May  4 01:59:36 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Some logs

  • /var/log/syslog
############################## Create the network #########################
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.3870] manager: (tt): new Bridge device (/org/freedesktop/NetworkManager/Devices/3325)
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.3989] devices added (path: /sys/devices/virtual/net/tt, iface: tt)
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.3989] device added (path: /sys/devices/virtual/net/tt, iface: tt): no ifupdown configuration found.
Jul  9 15:28:58 R710 kernel: [89008.728995] IPv6: ADDRCONF(NETDEV_UP): tt: link is not ready
Jul  9 15:28:58 R710 avahi-daemon[1440]: Joining mDNS multicast group on interface tt.IPv4 with address 172.28.0.1.
Jul  9 15:28:58 R710 avahi-daemon[1440]: New relevant interface tt.IPv4 for mDNS.
Jul  9 15:28:58 R710 avahi-daemon[1440]: Registering new address record for 172.28.0.1 on tt.IPv4.
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4151] device (tt): state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4171] keyfile: add connection in-memory (dbdc696b-7a09-4785-a6be-b5f8e5cadb93,"tt")
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4188] device (tt): state change: unavailable -> disconnected (reason 'connection-assumed') [20 30 41]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4200] device (tt): Activation: starting connection 'tt' (dbdc696b-7a09-4785-a6be-b5f8e5cadb93)
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4205] device (tt): state change: disconnected -> prepare (reason 'none') [30 40 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4210] device (tt): state change: prepare -> config (reason 'none') [40 50 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4213] device (tt): state change: config -> ip-config (reason 'none') [50 70 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4272] device (tt): state change: ip-config -> ip-check (reason 'none') [70 80 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4280] device (tt): state change: ip-check -> secondaries (reason 'none') [80 90 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4283] device (tt): state change: secondaries -> activated (reason 'none') [90 100 0]
Jul  9 15:28:58 R710 NetworkManager[1430]: <info>  [1562657338.4323] device (tt): Activation: successful, device activated.
Jul  9 15:28:58 R710 nm-dispatcher: req:1 'up' [tt]: new request (1 scripts)
Jul  9 15:28:58 R710 nm-dispatcher: req:1 'up' [tt]: start running ordered scripts...
 
 ############################# Remove the IP address ######################## 
Jul  9 15:29:09 R710 avahi-daemon[1440]: Withdrawing address record for 172.28.0.1 on tt.
Jul  9 15:29:09 R710 avahi-daemon[1440]: Leaving mDNS multicast group on interface tt.IPv4 with address 172.28.0.1.
Jul  9 15:29:09 R710 avahi-daemon[1440]: Interface tt.IPv4 no longer relevant for mDNS.
 
######################### Connect network to the container #####################
Jul  9 15:29:33 R710 kernel: [89043.734597] tt: port 1(veth70904fd) entered blocking state
Jul  9 15:29:33 R710 kernel: [89043.734600] tt: port 1(veth70904fd) entered disabled state
Jul  9 15:29:33 R710 kernel: [89044.195153] tt: port 1(veth70904fd) entered blocking state
Jul  9 15:29:33 R710 kernel: [89044.195155] tt: port 1(veth70904fd) entered forwarding state
Jul  9 15:29:33 R710 kernel: [89044.195221] IPv6: ADDRCONF(NETDEV_CHANGE): tt: link becomes ready
Jul  9 15:29:33 R710 NetworkManager[1430]: <info>  [1562657373.8856] device (tt): link connected
Jul  9 15:29:33 R710 NetworkManager[1430]: <info>  [1562657373.8857] device (tt): state change: activated -> unmanaged (reason 'connection-assumed') [100 10 41]
Jul  9 15:29:33 R710 kernel: [89044.206876] tt: port 1(veth70904fd) entered disabled state
Jul  9 15:29:33 R710 kernel: [89044.210100] IPv6: ADDRCONF(NETDEV_UP): tt: link is not ready
Jul  9 15:29:33 R710 nm-dispatcher: req:1 'down' [tt]: new request (1 scripts)
Jul  9 15:29:33 R710 nm-dispatcher: req:1 'down' [tt]: start running ordered scripts...
Jul  9 15:29:33 R710 NetworkManager[1430]: <info>  [1562657373.9189] device (tt): link disconnected