Open druanoor opened 5 years ago
I'm faced with the same issue. Is there a way to receive multicast traffic which was sent to the host inside a docker container?
Multicast to/from a docker bridge network is currently not possible. This is due to limitations with how linux kernels provide support for multicast routing. Packets are forwarded to the docker bridge using iptables and the unicast routing table, but multicast packets are handled differently in linux kernels. A workaround is to run a tool like smcrouted on the host (or in a container with access to the host network). This process does the work of managing the linux multicast forwarding cache.
Side note: If running docker swarm, and all your multicast communication is happening between nodes you can control, you could use weave net, which apparently has support for multicast.
It would be nice if we could see some multicast support added here... but ultimately it feels like more of a kernel issue.
There is a working solution using virtual ethernet veth
or real physical device with macvlan
or ipvlan
drivers https://github.com/moby/libnetwork/issues/552#issuecomment-1227821940 The veth
can be used for internal multicast side-by-side communication between containers. To work with multicast from outside world (machine) use real physical device in the --opt parent=<device>
option for the docker network create
command. It works in local scope (standalone, compose) or swarm scope (cluster, stack).
...To work with multicast from outside world (machine) use real physical device in the
--opt parent=<device>
option for thedocker network create
command. It works in local scope (standalone, compose) or swarm scope (cluster, stack).
Would you please elaborate on this a bit? I'm not sure how to subset the container<->container multicast setup to work with a {host-or-outside-world}<->container setup. Thanks v. much. @tymonx
I don't know how this can be true for ALL docker containers? I know people running docker containers for Weatherflow2MQTT which is all multicast traffic and it works. Its not within Nomad but it works?
Is there any way to achieve this? I can't use "--net host" since i need more containers to run in the same host and map ports with the host.