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