title: How do i bind Docker container to a specific external IP address, if i need to allocate many ports?
body: <p>related to <a href="https://stackoverflow.com/questions/32052975/how-could-i-bind-docker-container-to-specific-external-interface">How could I bind docker container to specific external interface</a> , but a harder case.</p>
  
  <p>i have a server machine with 10 IP addresses (on 1 bonded interface, looking like 10 lo:x interfaces). If i launch docker instances by supplying IP address to bind to like</p>
  
  <p>-p IP:port:port
  or
  -p IP:port:port/udp</p>
  
  <p>it works, and i get expected results, incoming connection to specified IP address go to the specified docker container.</p>
  
  <p>but the problem is, i need the containers to operate a wide range of UDP ports (16K), for WebRTC media streaming, that Docker can't allocate so many ports, it just hangs (a well-known and well-described problem, -p with a range of ports works only as long is range is under 1000-2000, 16000 won't work).</p>
  
  <p>i can work around it with --net=host, but it breaks the IP thing: every container binds to every IP then.</p>
  
  <p>is there any way around that? or all i can do is installing a full virtualization system and use virtual machines instead of docker containers (which will be a headache to do and pain in the ass to maintain, especially since i will need several servers).</p>
  
  <p>effectively, i am looking for a way to completely redirect some network interface to the Docker instance. what shall i do if i have a Docker instance "fe2ce5b3de59", launched with --net=none (which provides a clean sheet), interface lo:0, and i want everyting that comes into any TCP or UDP port of lo:0 to go into the same port of container's interface, and back, with the container being fully in the open?</p>