Docker bridge NAT seems to be disabled after a while

Hi,

i have an reoccurring issue with connection from inside an container to ping an host outside of the docker host.
The containers running for a while without issues but out of the sudden the communication stops. Checking the containers shows that they are running. Following situations

  • I can ping from host to container via the bridge
  • i can ping from container to docker0 bridge ip
  • containers are running
  • containers can ping each other
  • container cannot ping any external ip (same host or other)
  • this problem affects all bridge networks
  • this problem does not affect host network
  • i cannot see any obvious issues in ‘iptables -l’

I observed this issue with docker 1.8.0 and also with 1.13.1. In most cases i can try to fix it by

  1. restarting docker engine
  2. stopping docker engine and removing the docker0 bridge and start the engine again
  3. restart the server

most likely the 1. point goes well.

This behavior is happening for sure if i play with the hosts network but may also happen something else happen in the network. I cannot really tell whats the cause here.

Does anybody know why this happen, how to avoid it and how to fix this issue while the containers are running?

1 Like

Hi,

meanwhile i found out that the net.ipv4.ip_forward in sysctl turned off every once in a while.

# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0

why ever this happens i still need to find out. But enabling it also re-enable the container to access other networks.