-1

can any one pls help me in the following question.

Background : Two PC's(PC1 n PC2) with two VLAN interfaces in each (eth0.2 and eth0.3) respectively.The PC's are connected by WRT54GL router in between.

My aim is to send multicast(by MAC not IP) data from eth0.2(PC1)-->eth0.2(PC2) similarly for eth0.3 interface too.

Now the problem is when I multicast the data eth0.2 receives, but eth0.3 also receives it. I need data to be received on eth0.2 only.

Is it possible to receive data on a particular VLAN interface ? if so please direct me.

Thank you.

arr
  • 19
  • 4

2 Answers2

1

I think if you want to send MAC multicast packets, you may want to configure each interface with a specific MAC multicast address.

The command you'd use to do this is ip maddress add <MAC> <DEV> MAC and DEV are the mac address and device you want to add them to.

NickW
  • 10,263
  • 1
  • 20
  • 27
  • Thank you for your help. I am not clear on how to use ip maddress, can you pls share me a link which explains about this command usage. – arr May 20 '13 at 04:03
0

I will share my understanding for the above problem.

when I run TCPDUMP for both interfaces i.e eth0.2 and eth0.3, only the intended receiver(ie. eth0.2 in the above case) received the packets. There was no packets on eth0.3 interface.

I was using PF_PACKET socket in client to receive the multicast data. As my aim was to receive from a particular interface, I used setsockopt(Sock,SO_BINDTODEVICE,...), to bind to a interface. But after referring to man page of socket, I understood SO_BINDTODEVICE will not be supported for packet sockets. so I used simple bind(), to bind to particular interface. It worked as expected.

Thanks.

arr1
  • 1