Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receive UDP Multicast in Docker Container

I am using docker compose and hypriotos on a raspberry pi running a node container. I would like to receive udp multicast messages send to 239.255.255.250:1982 in local network. My code is working on other machines outside of docker so I think it's a docker issue.

I already exposed port 1982/udp in the docker file and in the docker-compose file I added "1982:1982" and "239.255.255.250:1982:1982/udp" to ports. I still can't receive anything. Am I missing something?

My concrete plan is to receive advertisement messages from a yeelight. These messages are documented here

Any help would be nice. Thanks.

like image 295
leiropi Avatar asked Feb 23 '17 17:02

leiropi


1 Answers

While you can do udp with -p 1982:1982/udp I don't believe docker's port forwarding currently supports multicast. You may have better luck if you disable the userland proxy on the daemon (dockerd --userland-proxy=false ...), but that's just a guess.

The fast/easy solution, while removing some of the isolation, is to use the host network with docker run --net=host ....

like image 93
BMitch Avatar answered Oct 16 '22 11:10

BMitch