title: How to restrict docker network access between containers in same network?
body: <p>My situation is as follows:<br />
  I have traefik as http proxy for multiple webs. And I have a network, let's call it a &quot;proxy-net&quot; that links together traefik with these webs.<br />
  So this network is obviously required to each web to be proxied by traefik. Issue I have is that containers of those webs can connect to each other via this &quot;proxy-net&quot; network.<br />
  How do I restrict that? How to allow each web to connect to traefik but restrict connection between other containers in this same network?<br />
  And also keeping each web to have access to internet (for npm, composer, apis etc.)? Cause I saw some possibilities to add dns or similar stuff to containers which didn't work with my issue here.</p>
  <p>I tried these, no luck:<br />
  <a href="https://sodocumentation.net/docker/topic/6331/restricting-container-network-access" rel="nofollow noreferrer">https://sodocumentation.net/docker/topic/6331/restricting-container-network-access</a><br />
  <a href="https://stackoverflow.com/questions/39913757/restrict-internet-access-docker-container">Restrict Internet Access - Docker Container</a></p>