The automatically create bridge lost ipv4 address after a reboot

Envrioment

  • Ubuntu20.04LTS server
    (Linux dev-server 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux)
  • Docker Engine - Community v20.10.12
  • host network: 192.168.64.0/24
  • docker network:

NETWORK ID NAME DRIVER SCOPE
c5e70bf2bfe0 bridge bridge local
c9a5f2bcd74a dev_net bridge local
dd5052e7c808 host host local
ed4084e8b233 none null local

Steps to reproduce

  1. I create a custom network with following command
docker network create --subnet 172.20.0.0/16 dev_net
  1. Then attach some service(container) with docker-compose to it.
  2. After reboot the system. All of the containers which attached to the “dev_net” can not access the host. And it turns out to be the lost of ipv4 address of br-c9a5f2bcd74a

br-c9a5f2bcd74a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::42:c8ff:febd:d8c7 prefixlen 64 scopeid 0x20
ether 02:42:c8:bd:d8:c7 txqueuelen 0 (Ethernet)
RX packets 9 bytes 252 (252.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19 bytes 1874 (1.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

  1. I restart the dockerd with command
systemctl restart docker
  1. Then it returns to what it should be like.
    image

What should I do to prevent the same issue? Need help.

I also met, how to solve it?