No internet connection inside Docker containers

After several manipulations with system hardening my containers lost internet connection. How to fix the problem?

Stop docker service:

$ sudo service docker stop

Flush NAT table on the host machine:

$ sudo iptables -t nat -F

Turn off docker bridge:

$ sudo ifconfig docker0 down

Remove docker bridge:

$ brctl delbr docker0

Start docker service:

$ service docker start

Docker will recreate network interfaces and fill the NAT table with required values.

Leave a Reply

Your email address will not be published. Required fields are marked *