Docker Community Forums

Share and learn in the Docker community.

Docker 0 and docker_gwbridge lose ip address after VMWare resume from suspend

hello everyone

I deployed a docker cluster using docker swarm init --advertise-addr 192.168.7.41 on ubuntu 20, with single manager and two workers as shown in the figure below , and i have a container running mysql and another one running portainer.
2020-10-18 11-23-29屏幕截图

After i suspend the three vm machine and then rerun them,i foud i could not connect to portainer and the ip address of docker0 was lost, as shown below

before suspend

2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:50:56:37:f4:94 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.41/24 brd 192.168.7.255 scope global ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe37:f494/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:25:50:ec:63 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:b8:64:0c:ff brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global docker_gwbridge
       valid_lft forever preferred_lft forever
    inet6 fe80::42:b8ff:fe64:cff/64 scope link 
       valid_lft forever preferred_lft forever

After resume

2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:50:56:37:f4:94 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.41/24 brd 192.168.7.255 scope global ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe37:f494/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:25:50:ec:63 brd ff:ff:ff:ff:ff:ff
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:b8:64:0c:ff brd ff:ff:ff:ff:ff:ff
    inet6 fe80::42:b8ff:fe64:cff/64 scope link 
       valid_lft forever preferred_lft forever

i attempt to set ipv4.ip_forward to 1 but it not worked, and then i attempt to deploy docker cluster on Centos7 and to set ipv4.ip_forward to 1 ,the result is shown below , docker_gwbridge still not worked, how to solve this problem?

Before suspend

2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:31:ef:2a brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.51/24 brd 192.168.7.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::6655:72e4:98f3:8ef5/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::e1e5:eae9:a213:8976/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::575b:5a77:8bf6:35e0/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:89:6d:7c:c5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:18:96:83:8b brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global docker_gwbridge
       valid_lft forever preferred_lft forever

After resume

2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:31:ef:2a brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.51/24 brd 192.168.7.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::e1e5:eae9:a213:8976/64 scope link tentative noprefixroute dadfailed 
       valid_lft forever preferred_lft forever
    inet6 fe80::6655:72e4:98f3:8ef5/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::575b:5a77:8bf6:35e0/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:89:6d:7c:c5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
4: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:18:96:83:8b brd ff:ff:ff:ff:ff:ff

I run into this issue as well. The scenario is

Connect to work VPN (we use Cisco AnyConnect)
Start containers (in my case just running eventstore/eventstore)
Sleep machine
Wake machine
VPN disconnects
Containers are non-responsive and attempting restart results in the docker app crashing.
Diagnostic ID: 5EA8A028-1AFD-4A09-9F1C-638CADF50026

Diagnostics Logs:

Docker for Mac: version: 18.03.0-ce-mac59 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
macOS: version 10.13.3 (build: 17D102)
logs: /tmp/5EA8A028-1AFD-4A09-9F1C-638CADF50026/20180328-101512.tar.gz
failure: com.docker.vpnkit is not running
[ERROR] vpnkit
Unexpected error ((Failure
“Error connecting socket to 9p endpoint unix:/Users/chethusk/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ECONNREFUSED, “connect”, “”)”)) connecting to /Users/chethusk/Library/Containers/com.docker.docker/Data/s51
com.docker.vpnkit is not running
vpnkit check failed with: Unix.Unix_error(Unix.ECONNREFUSED, “connect”, “”)
[OK] vmnetd
[OK] dns
[ERROR] driver.amd64-linux
com.docker.driver.amd64-linux is not running
[OK] virtualization VT-X
[OK] app
[OK] moby
[OK] system
[OK] moby-syslog
[OK] kubernetes
[OK] files
[OK] env
[OK] virtualization kern.hv_support
[ERROR] osxfs
com.docker.osxfs is not running
[OK] moby-console
[OK] logs
[ERROR] docker-cli
Connection refused (ECONNREFUSED) connecting to /var/run/docker.sock: check if service is running
Connection refused (ECONNREFUSED) connecting to /Users/chethusk/Library/Containers/com.docker.docker/Data/s60: check if service is running
docker ps failed
[OK] disk