从eth0转发到docker0 [英] forward udp multicast from eth0 to docker0

查看:778
本文介绍了从eth0转发到docker0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个docker容器运行一个正在侦听UDP组播数据包的java应用程序。我没有收到容器内的数据包,但是它们出现在eth0上的主机上。



是否有一种方法可以让码头自动拿起这些数据包并将其转发到容器?



谢谢

解决方案

经过很多令人沮丧的日子,尝试了一些事情...终于有一些工作:



使用Pipework( https://github.com/jpetazzo/pipework),以下命令工作,但有一个catch -

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

只运行上述命令运行docker容器并不完全帮我。我必须在我的主机上运行 tcpdump -i eth2 来捕获eth2接口上的数据包,然后它开始将数据包转发到docker容器。



任何想法为什么工作而不只是运行命令??


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

解决方案

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??

这篇关于从eth0转发到docker0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆