Docker Community Forums

Share and learn in the Docker community.

Can't access udp ports remotely

Hi,

I need to bind to the host a udp port range, the ports are accessible from the host running the container but not when accessing it from another computer. With this command:

sudo docker run --privileged=true --name bbb --rm -p 80:80 -p 9123:9123 -p 1935:1935 -p 16384-16600:16384-16600/udp my_image

Ports seem to be correctly configured on the container:

$ sudo docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                                                                                          NAMES
3fa07261faf3        my_image                  "/start.sh"          4 minutes ago       Up 4 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:1935->1935/tcp, 0.0.0.0:9123->9123/tcp, 0.0.0.0:16385->16385/udp   my_container

Testing access to udp ports using nmap, on the host where the container runs:

$ sudo nmap -sU -p 16385 192.168.1.103                                                                                        bbb-1.0 

Starting Nmap 7.12 ( https://nmap.org ) at 2017-01-04 00:45 COT
Nmap scan report for meet.example.com (192.168.1.103)
Host is up.
PORT      STATE         SERVICE
16385/udp open|filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 2.11 seconds

nmap on another host on the same LAN:

 [juancho@centella ~]$ sudo nmap -sU -p 16385 192.168.1.103

Starting Nmap 6.25 ( http://nmap.org ) at 2017-01-04 00:30 COT
Nmap scan report for 192.168.1.103
Host is up (0.050s latency).
PORT      STATE  SERVICE
16385/udp closed unknown
MAC Address: 18:5E:0F:FF:7C:C9 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.18 seconds

As you can see, when testing remote connectivity the UDP ports are closed and the application doesn’t work.
Am I missing something to be able to access udp ports remotely ?

I’m using docker 1.12 on ubuntu 16.10.
Thanks