linux加入组播失败

linux加入组播失败,第1张

What does "IP_ADD_MEMBERSHIP: No such device" mean?

It means that the tool is trying to use multicast but the network interface doesn't support it There are two likely causes:

·Your machine doesn't have multicast support enabled. For example, on Linux and FreeBSD it is possible to compile a kernel which doesn't support multicast.

·You don't have a route for multicast traffic. Some systems don't add this by default, and you need to run:

route add -net 224.0.0.0 netmask 224.0.0.0 eth0(or similar). If you wish to use RAT in unicast mode only, it is possible to add the multicast route on the loopback interface.

我一般都这样写:

mreq.imr_interface.s_addr = htonl(localIP)

先ping确认通不通,然后用traceroute IP

看看能通到哪,如果中间短了,可能是路由数据不完整。如果最后一跳短了,很可能是最后一跳缺乏回程路由或者访问的设备有防火墙保护,需要调整防火墙规则。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7389294.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-05
下一篇 2023-04-05

发表评论

登录后才能评论

评论列表(0条)

保存