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?
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?