Multicast - Linux

OS: 
Description

To access multicast service on a Linux host requires configuring at least one network interface, configuring a default route for the host, and configuring a route for class D (224.0.0.0/8) traffic). The msend and mreceive utilities can be used to send and receive multicast traffic for diagnostic purposes.

Example Commands

Configuring multicast on a Linux host

To access multicast services on a Linux host requires configuring a network interface, a default route for the host, and a route for class D traffic. Following is an example:

ifconfig eth0 10.10.10.10/24

route add default gw 10.10.10.20

route add -net 224.0.0.0/8 dev eth0

msend and mreceive

The msend and mreceive utilities can be used to send and receive multicast traffic for diagnostic purposes. Following are examples of their use (see "man msend" and "man mreceive" for more details):

PC1% msend -g 224.1.1.1 -p 1111 -t 8 -text "PC1"

PC1% msend -g 224.2.2.2 -p 2222 -t 8 -text "PC1"

PC1% mreceive -g 224.3.3.3 -p 3333

 

PC2% msend -g 224.3.3.3 -p 3333 -t 8 -text "PC2"

PC2% msend -g 224.1.1.1 -p 1111 -t 8 -text "PC2"

 

PC3% msend -g 224.2.2.2 -p 2222 -t 8 -text "PC3"

PC3% msend -g 224.3.3.3 -p 3333 -t 8 -text "PC3"

 

PC4% mreceive -g 224.1.1.1 -p 1111

PC4% mreceive -g 224.2.2.2 -p 2222

PC4% mreceive -g 224.3.3.3 -p 3333

 

Commands to query IP multicast group membership

WARNING: using ping to multicast groups seems to kill multicast forwarding in GNS3!

The ping command can be used to query a subnet for IP multicast group membership:

PC1% msend -g 224.3.3.3 -p 3333 -join

PC2% msend -g 224.3.3.3 -p 3333 -join

PC2% mreceive -g 224.3.3.3 -p 3333

PC3% ping 224.3.3.3