Tags

,

When there is no explicitly specified preference, default bridge will be used in container networking. In this configuration, docker will create a bridge in host, and guest  running in bridge mode would have an interface connected to this bridge. Therefore they would have an isolated network inside the host. Container in the same host can talk with each other through this bridge, and default route in host will enable the container to reach outside.

single-host-bridge

Recently I tried setting docker in a laptop having a wireless interface and faced with an issue that docker0 looses its ip address consistently.

Lets startv with trying docker system restart

sudo systemctl restart docker.service

docker0-ip-failure-restart-docker-service

docker0-ip-failure-docker0-with-ip

Good. docker0 interface gets ip after decker service restart. However, we see that it looses again after the running container exists.

docker0-ip-failure-docker0-without-ip

We can have a look to syslogs.

docker0-ip-failure-var-log-syslog

Here we see some logs during container exit, around wicd that seems strange. Lets look where docker0 is configured in wicd configuration.

sifa@sifa:/etc$ sudo grep -r docker0 ./
./wicd/manager-settings.conf:wired_interface = docker0

sifa@sifa:/etc$ sudo head wicd/manager-settings.conf
[Settings]
backend = external
wireless_interface = None
wired_interface = docker0
wpa_driver = wext
always_show_wired_interface = False
use_global_dns = False
global_dns_1 = None
global_dns_2 = None
global_dns_3 = None

After removing docker0 from wicd configuration (replacing it with eth0) and restarting wicd and docker services, the problem is finally fixed.

sudo systemctl restart wicd.service
sudo systemctl restart docker.service

docker0-ip-failure-successful-ping-inside-container