receiving multicast on a server with multiple interfaces (linux)

↘锁芯ラ 提交于 2019-12-03 03:11:55

You appear to be being stung by rp_filter reverse-path filtering. This drops packets if they arrive on an interface that doesn't have a route for the source address.

You can disable it on a per-interface basis with the sysctl /proc/sys/net/ipv4/conf/<if>/rp_filter.

bind the multicast address

That is definitely wrong. You must bind to an actual IP address of a real adapter, or 0.0.0.0.

note that a common error is to bind "0.0.0.0"

That's not an error. THat is correct procedure unless you only want to listen to one IP address.

and then receive on that socket even multicast you are not interested in

I don't know what this means.

in principle I don't know the ip of sender

The IP address of the sender of any UDP datagram is available via the sockets API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!