Restrict Internet Access - Docker Container
<p>I have a situation to restrict internet access of the container in load balancer network. for example in that below picture</p>

<p><a href="https://i.stack.imgur.com/tChKt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tChKt.png" alt="easy for your reference"></a></p>

<p>Only <strong>container4</strong> connects to the Internet; other <strong>three</strong> only communicate through <strong>container4</strong> with the outside world. For example if <strong>container1</strong> needs smtp support, it will forward smtp request to <strong>container4</strong> to get access.</p>

<p>No container other than <strong>container4</strong> should be allowed to access the Internet directly! This should be enforced on Docker level.</p>

<p>I believe it will be configurable on <strong>docker network creation</strong>, can any one explain how to achieve this?</p>