Docker Community Forums

Share and learn in the Docker community.

Need access to ethernet interface for broadcast UDP

(Scholvin) #1

(second time trying to post this…askimet thinks my first is spam…)

I’m trying to run a server (OLA’s olad) inside a Docker for Mac container. The server works by sending and receiving UDP broadcast data over port 6454 on a particular physical ethernet interface on the host, which is in turn connected to an external device under control. Normally, when starting the olad server, one specifies the interface or IP address on which it should send/receive the broadcast messages.

My struggle is getting the UDP messages to and from the interface from inside the container. I don’t appear to have access to that physical interface or network inside the container, even if I run with --network host . My understanding is that this is because of a quirk of the way Docker for Mac is implemented, with an extra VM between my container and the hardware. That VM sees the hardware, but I don’t.

Simply running the docker container with -p 6454:6454/udp doesn’t work, either, maybe unsurprisingly. I could see where that might allow incoming traffic to the container to find its way to the server, but the server inside still can’t find the outside network/device in the other direction. And I’m not sure how OSX would necessarily get that data from the interface to the docker bridge anyway.

How can I get direct, bidirectional access to that interface or network from inside the container? Or if I cannot, is there some kind of workaround, maybe via socat where I could tunnel that network in through a Unix socket that is shareable between host and container?