Saturday, July 8, 2017

networking - Can I use routes to influence which interface address multicast listeners use?

I have a server with multiple NICs on it. Each NIC is plugged into a different, isolated network that is serving multicast traffic. I have a program that listens to the multicast traffic on each of these networks. Right now I have to specify in my program which interface to use as part of the multicast join. This is not a big deal, but is slightly inconvenient.



Is it possible to use routes to influence this process? Suppose I have two multicast groups as follows:



A. 224.1.2.32  39312 eth1
B. 224.1.11.19 59328 eth2



Can I add two routes to the routing table such that when I join the multicast group from my code the kernel knows to send group A's join out eth1 and group B's join out eth2? I've been unable to get it to behave the way I want. Adding various routes seems to not affect this process, and the only way I've found to be able to influence which interface is chosen is to specify it in code as part of the multicast_request data structure.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...