I have an application which after making some connections using its default ports starts opening(listening) new RANDOM ports to handle just the existing connection and then drops them (Video calls).
It also exchanges its IP address and ports inside the communication protocol, I was able to solve the IP address issue, but still not able to find a way to dynamically tell IPTABLES of the host machine to open same ports when they are being opened inside Docker container, anybody has any ideas?
The
--net=host
option, for thedocker run
command, should enables the behavior you are seeking -- note that it is considered as insecure, but I really don't see any other mean of doing this.See the
docker run
man page: