7

I have a docker container running a java application which is listening for UDP multicast packets. I am not receiving the packets inside the container, however they appear on the host machine on eth0.

Is there a way for docker to automatically pick up these packets and forward them to the container?

Thanks

Sohail
  • 4,506
  • 2
  • 38
  • 42
  • does privileged of cap-add=NET_ADMIN help? https://docs.docker.com/reference/run/#runtime-privilege-linux-capabilities-and-lxc-configuration – Greg Feb 26 '15 at 15:28
  • @Greg Yes, I tried and nothing happens (as a matter of fact, the container is running in privileged mode) – Sohail Feb 27 '15 at 06:00

2 Answers2

4

After a lot of frustrating days of trying out a number of things... finally something worked:

Using Pipework (https://github.com/jpetazzo/pipework), the following command worked but there is a catch -

pipework eth2 $(docker run -d hipache /usr/sbin/hipache) 50.19.169.157/24

running a docker container by only running the above command did not quite help me. I had to run tcpdump -i eth2 on my host to capture packets on eth2 interface, which then started to forward the packets to the docker container.

Any idea why is worked and not just running the command??

Chris Huang-Leaver
  • 6,059
  • 6
  • 41
  • 67
Sohail
  • 4,506
  • 2
  • 38
  • 42
  • Running tcpdump likely put the interface into promiscuous mode. Try `ip link set eth2 promisc on` instead of `tcpdump -i eth2`. – mdonoughe Dec 14 '15 at 18:22
3

You may want to try --net host as it seems to be the only work around for getting multicast traffic outside of the host to reach the container according to the discussions on #3043.

Roberto Andrade
  • 1,793
  • 1
  • 21
  • 27
  • 1
    thanks but actually that would not work for me. I am also doing --link to link up other container so cant use --net=host along with --link. – Sohail Mar 14 '15 at 05:07