Docker Community Forums

Share and learn in the Docker community.

How to UDP broadcast to external network without host mode?

Having read multiple topics that relate to UDP traffic, I have not found a solutions for my (Wake-on-LAN) broadcast issue.

Inside a container I want to send WoL magic packets (UDP broadcasts) to devices on an external network (the network subnet that the Docker host is also part of). Obviously, when using network_mode: host it works, but using either the default Docker bridge or creating a bridge of my own, the broadcast doesn’t get forwarded from the Docker network to to host network.
From a network perspective that makes sense, since it is a different subnet after all.

So, basically my question is: how can I forward UDP broadcast messages from a Docker bridge network to the host local network?

1 Like

I have the same question. I’ve setup Home Assistant docker on my Openmediavault server. When I run it in host mode I can send WOL command to my LG WebOS tv with no issues. However I’m struggling to get this to work on my custom docker bridge network (I need the Home Assistant docker on this bridge, host mode isn’t an option)

Jan 2021 and there is still now answer to this?

I am running Linux containers on a Windows host.

Is it not possible to send a UDP Broadcast signal to the host network?

You should either run the service defined in your docker-compose.yml file with network_mode: host.

Alternatively you can publish the port of the container you intended to communicate with by publishing it using the following configuration. Note that the /udp is required for UDP communication to work.

service:
ports:
- “8080:8080/udp”