在多宿主Linux服务器中监听多播的问题
我正在尝试在具有两个网卡的计算机上编写多播客户端,但无法使其工作。我可以用嗅探器看到,一旦启动程序,NIC (eth4) 就开始接收多播数据报: yyyy (some ip) -> zzzz(多播 ip,不是我的 eth4 NIC IP) UDP 源端口:kkk(其他一些端口) 目标端口:xxx(多播端口)
但是,我无法使用我的程序获取这些数据包(侦听 eth4 上的端口 xxx)。
我还添加了:route add 224.0.0.0 netmask 240.0.0.0 dev eth4
在网上搜索了一些示例/解释,但似乎我做了其他人所做的事情。任何帮助将不胜感激。还有其他与路由/iptables 有关的吗?
I am trying to write a multicast client on a machine with two NICs, and I can't make it work. I can see with a sniffer that once I start the program the NIC (eth4) start receiving the multicast datagrams: y.y.y.y. (some ip) -> z.z.z.z (multicast ip, not my eth4 NIC IP) UDP Source port: kkk (some other port) Destination port: xxx (multicast port)
However, I can't get those packets using my program (listening to port xxx on eth4).
I also added: route add 224.0.0.0 netmask 240.0.0.0 dev eth4
Searched the web for some examples/explanations, but it seems like I do what everybody else does. Any help will be appreciated. is there anything else to do with route/iptables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现关闭 rp_filter 允许多播数据进入我的应用程序。当设置为 1 时,它会丢弃在接口处接收的数据。
迈克·格雷厄姆
I found that turning off rp_filter allowed multicast data to come into my application. When set to 1 it discarded the data that was being received at the interface.
Mike Graham