3

I'm trying to receive on my LInux box multicast frames from hosts on a different subnet. For the experiment, and ONLY for this experiment, i have two machines connected through a network switch:

  • machine A (192.168.10.1/24) runs a simple application having a listening UDP socket (port 10000) joined on a multicast group (ex. 226.0.0.1);
  • machine B (192.168.20.1/24) sends UDP datagrams (destination port 10000) to multicast group 226.0.0.1.

Running tcpdump on machine A I see packets sent by machine B but packets are not delivered to the application layer. The packets are delivered to the application layer only if machine B is on the same subnet of machine A. Which is the correct way to enable reception of multicast frames from different subnets?

MirkoBanchi
  • 152
  • 2
  • 7
  • First, you should not be using Reserved multicast groups, but use something in the Organization-Local scope (`239.0.0.0/8`). Second, multicast routing is very different from unicast routing, and a router must be explicitly configured to route multicast between networks. Also, your switch may be using IGMP snooping. – Ron Maupin Aug 02 '18 at 21:10
  • No IGMP snooping or routers are involved in this scenario. If you read carefully my question, the packets enters machine A but they are not forwarded to application layer, also with reverse path filtering diasabled. – MirkoBanchi Aug 03 '18 at 07:41

2 Answers2

1

The router that is routing traffic between the subnets need to support multicast forwarding. IGMP is one such protocol that will allow multicast traffic to be routed between different IP Subnets, and is supported by Linux and most Cisco routers.

Abu Zaid
  • 499
  • 2
  • 6
  • I don't have any router. Suppose the two machines are connected through a switch. This is only an experiment in order to figure out the reason of this behaviour. I will edit my question to make it clearer. – MirkoBanchi Aug 02 '18 at 20:21
  • Are you able to ping Machine B from Machine A? If yes, there must be a device that is routing packet between the two subnets. Can you post output from netstat -nr and ifconfig -a from both machines? – Abu Zaid Aug 03 '18 at 09:36
  • 1
    Obviously no. I’m simply trying to figure out why Linux doesn’t deliver packets to application layer. Again, no other devices are involved in routing. – MirkoBanchi Aug 03 '18 at 12:05
0

I expect you have multihomed servers. Try adding static route for the remote subnet on each local machine.

on 192.168.10.1/24: route add -net 192.168.20.0/24 <eth#>

on 192.168.20.1/24: route add -net 192.168.10.0/24 <eth#>

Jenny D
  • 27,358
  • 21
  • 74
  • 110
tlw
  • 1