0

I am looking for the best way to allow a container to reach some network ports on my docker host network while maintaining the use of my user defined networks. I was thinking the best way to do this would be to create a specific user defined network and create an iptables rule to allow traffic from that user defined network’s interface to my docker host. Is this the correct way to go about this?

Using iptables -A INPUT -i <some_docker_network_interface> -j ACCEPT worked, but I had to manually find the interface name to create the iptables rule. Is there a way to query docker for the name of the interface it creates on the host for that specific user defined network?

I referenced this to get the idea for just accepting the interfaces traffic via iptables:

How to access host port from docker container

Thanks!

pankid
  • 1

0 Answers0