Suppose I have a layer 2 managed switch which can be programmed to have multiple VLANs. Lets say there are 2 configured VLANs as of now vlan-1 and vlan-2. I also have a linux machine with 2 ethernet NIC with each ethernet port 1 and 2 connected to a switch port belonging to VLAN 1 and VLAN 2 respectively. My server is connected to vlan-1 and client connected to vlan-2 .The server is a multicast server. How should I configure the linux machine(to act as a router) to route multicast packets from vlan-1 to vlan-2 and vice-versa?

The diagram of the network looks similar to this (with both the switches being same but with two vlan) enter image description here

and since igmp snooping is not turned on the switch it will broadcast packets hence it will reach the linux machine.

  • You should configure a multicast routing stack, but there isn't any short answer to this general question "how". – drookie Mar 8 at 15:34
  • I understand that my question is vague but can you help me? what do you mean by "multicast routing stack"? I also saw that for routing multicast packets we need software like pimd or mrouted. will that suffice the requirement? @drookie – Tamil Selvan Mar 9 at 5:51
  • "and since igmp snooping is not turned on the switch it will broadcast packets hence it will reach the linux machine." No, multicast does not broadcast. Broadcast must be handled by every device in the broadcast domain, but multicast is sent to a group and is only handled by hosts subscribing to the multicast group. Also, multicast routing is very different than unicast routing, and it uses IGMP to communicate with the multicast router that must be configured for multicast routing. – Ron Maupin Mar 9 at 6:55
  • I do understand that multicast is not broadcast but I read somewhere that switches which are not smart enough(i.e. igmp snooping not turned on in a layer 2 switch) will consider multicast traffic like broadcast traffic and will send packets to all its ports. But anyways apart from that.... How do I configure a linux box to route multicast packets. all I found was regarding unicast routing. – Tamil Selvan Mar 9 at 7:25
  • @RonMaupin could you suggest me a tutorial where I can learn about configuring a linux box to work as multicast router to forward traffic between two vlans? – Tamil Selvan Mar 9 at 8:27

You can use SMCRoute, it's available in most Linux distributions. Either use the client tool or add a line as follows to your /etc/smcroute.conf:

mroute from eth0 group source to eth1 eth2
  • Thanks but I tried using one of your repos - mrouted and voila - it worked without any issues – Tamil Selvan Apr 19 at 11:40
  • Awesome, great to hear back from you! :) – troglobit Apr 19 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.