There are two different types of communication in container environments:
- Communication with the external world
- Inter-container communications
We'll take a look at both of these in this section.
Communication with the external world
There are two features at the host level that are required to allow containers to talk to the external world:
- IP forwarding is required to allow packets from container IP addresses to go outside the containerized environment. This is done at the kernel level and the Docker daemon will manage the required parameters (the ip_forward kernel parameter will be set to 1) to allow this strategy. We can change this default behavior setting with --ip-forward=false in the daemon configuration. This forwarding is required for all kinds of communications between containers in general.
- iptables will manage the required rules to strictly allow only required communications once forwarding is enabled. We can manually set iptables...