Troubleshooting communication between containers and the external network
Packets can only pass between containers if the ip_forward
parameter is set to 1
. Usually, you will simply leave the Docker server at its default setting of --ip-forward=true
and Docker will set ip_forward
to 1
for you when the server starts up. To check the settings, use the following command:
# cat /proc/sys/net/ipv4/ip_forward 0 # echo 1 > /proc/sys/net/ipv4/ip_forward # cat /proc/sys/net/ipv4/ip_forward 1
By enabling ip-forward
, users can make communication between containers and the external world possible; it will also be needed for inter-container communication if you are in a multiple bridge setup:
ip-forward = true forwards all the packets to/from the container to the external network
Docker will not delete or modify any pre-existing rules from Docker filter chain. This allows users to create rules to restrict access to containers. Docker uses docker0 bridge for packet flow between all containers...