Problem in listening to multicast in multihomed Linux server

0

1

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?

Lior

Posted 2011-02-27T12:20:44.930

Reputation: 1

Question related to this was already moved to stack overflow, http://stackoverflow.com/questions/5132654/problem-in-listening-to-multicast-in-c-with-multiple-nics

– Olli – 2011-02-27T12:31:18.977

yeh, I want to make sure my Linux configuration is fine. thx. – Lior – 2011-02-27T12:55:18.793

Answers

0

Easiest way to debug this is to run tcpdump on correct interface. If you can receive packets using tcpdump, then your setup is working fine, and problem is with your code.

Programming related questions should go to Stack Overflow (also wait for answers to your previous question).

Olli

Posted 2011-02-27T12:20:44.930

Reputation: 6 704

as I said, tcpdump shows the packets received by multicast IP, not my eth4 NIC static IP. is that how should I see it? shouldn't tcpdump show the packets arriving to my NIC static ip? – Lior – 2011-02-27T12:54:33.673

Sorry, I missed that from your question. Yes, that's how it should work. You receive multicast packets to multicast IP, not to your own IP address. – Olli – 2011-02-27T13:04:19.900