How to ping to a multicast address for testing?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

Issue

  • How to ping to a multicast address for testing?

Resolution

Red Hat Enterprise Linux 5

  1. Run the following to ignore icmp broadcasts :

     # echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    
  2. Check the multicast addresses subscribed to :

     # ip maddr
    
  3. Run ping with the multicast address :

     # ping -L  239.192.104.2
    
     # ping -L  224.0.0.1
    

Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 6 provides the omping package, which can be used to test multicast communication :
  • When using omping specify the cluster ports in the command with -p. The default port of omping is UDP 4321. If this is not allowed in the iptables omping output will not show the multicast reply in the output.

SYNTAX

# omping <remote ip> <own ip>
# omping -p 5404 192.168.122.81 192.168.122.82
192.168.122.82 : waiting for response msg
192.168.122.82 : joined (S,G) = (*, 232.43.211.234), pinging
192.168.122.82 :   unicast, seq=1, size=69 bytes, dist=0, time=0.330ms
192.168.122.82 : multicast, seq=1, size=69 bytes, dist=0, time=0.438ms
192.168.122.82 :   unicast, seq=2, size=69 bytes, dist=0, time=0.609ms
192.168.122.82 : multicast, seq=2, size=69 bytes, dist=0, time=1.211ms
192.168.122.82 :   unicast, seq=3, size=69 bytes, dist=0, time=0.710ms
192.168.122.82 : multicast, seq=3, size=69 bytes, dist=0, time=1.060ms

Note : The omping package is only available via the RHEL High Availability Add-on.

Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.