Docker network changes ip after reboot

Hello! I’m having a problem when running networks in my host. I create a network using

docker network create name

After that I added the containers to the network by compose.yml, all works great, i’ve different containers in the networks and all can communicate between them and with the host, but after a docker service reboot or a host machine reboot is when the problem comes. Just after the reboot if i put ifconfig on the host, i obtained the correct config to the network

br-93aeb64e21d1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        inet6 fe80::42:a4ff:fe86:bce  prefixlen 64  scopeid 0x20<link>
        ether 02:42:a4:86:0b:ce  txqueuelen 0  (Ethernet)
        RX packets 436  bytes 12208 (11.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1090  bytes 369287 (360.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But after some seconds if i rerun ifconfig, i obtain this:

br-93aeb64e21d1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.251.214  netmask 255.255.0.0  broadcast 169.254.255.255
        inet6 fe80::42:a4ff:fe86:bce  prefixlen 64  scopeid 0x20<link>
        ether 02:42:a4:86:0b:ce  txqueuelen 0  (Ethernet)
        RX packets 3630  bytes 160808 (157.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 19000  bytes 26628297 (25.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The ip has changed, and the containers are isolated of the host and it does not have connection to external network.

This is the docker version I have

Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)

I’m running it on a terramaster NAS so I cant update the version.

What can be happening?

Thanks for your help.

Stop and disable dhcpcd daemon on system boot since we going to start it manually with /etc/rc.local

NB: we do so, cause ‘docker’ when building or running a container sets up a ‘bridge’ interface which interferes ‘failover’

systemctl stop dhcpcd
systemctl disable dhcpcd

Start dhcpcd daemon on each interface we are interested in

dhcpcd eth0
dhcpcd eth1
dhcpcd wlan0

Start dhcpcd daemon on every reboot

sed -i -e ‘s/^exit 0$//g’ /etc/rc.local
echo “dhcpcd eth0” >> /etc/rc.local
echo “dhcpcd eth1” >> /etc/rc.local
echo “dhcpcd wlan0” >> /etc/rc.local
echo “” >> /etc/rc.local
echo “exit 0” >> /etc/rc.local

Also DNS servers for docker (probably, not necessary)

cat >> /etc/docker/daemon.json << EOF
{
    "dns": ["8.8.8.8", "8.8.4.4"]
}
EOF
service docker restart

That was! Thanks a lot!