# ============================================================================= # WUC Technologies — IPv4 Field Guide # CLI cheat sheet: Multicast — 224.0.0.0/4 # Source: https://www.wuctechnologies.com/resources/field-guides/ipv4-address-analyzer/ # License: CC0 1.0 Public Domain (https://creativecommons.org/publicdomain/zero/1.0/) # Released: 2026-05-22 # # 224.0.0.0/4 = the entire IPv4 multicast range. Sub-divisions: # 224.0.0.0/24 local-link, never forwarded by routers # 224.0.1.0 – 238.255.255.255 internetwork control + globally scoped # 239.0.0.0/8 administratively scoped (RFC 2365) — your enterprise # ============================================================================= # ----------------------------------------------------------------------------- # Inspect multicast group membership on a host # ----------------------------------------------------------------------------- # Show groups the host has joined on each interface: ip -4 maddr show # Equivalent classic syntax: cat /proc/net/igmp # ----------------------------------------------------------------------------- # Join / leave a multicast group manually (smcroute / mtest) # ----------------------------------------------------------------------------- # Join a group (one-shot, requires smcroute): sudo smcroutectl join eth0 239.1.1.1 # Leave it: sudo smcroutectl leave eth0 239.1.1.1 # Alternative — Python one-liner to subscribe and read multicast packets: python3 -c ' import socket, struct g = "239.1.1.1" s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind(("", 5000)) mreq = struct.pack("4sl", socket.inet_aton(g), socket.INADDR_ANY) s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) while True: print(s.recv(2048)) ' # ----------------------------------------------------------------------------- # Send to a multicast group # ----------------------------------------------------------------------------- # Using socat — send "hello" to 239.1.1.1:5000 with TTL 32: echo "hello" | socat - UDP4-DATAGRAM:239.1.1.1:5000,ip-multicast-ttl=32 # Send from a specific interface: echo "hello" | socat - UDP4-DATAGRAM:239.1.1.1:5000,ip-multicast-if=192.168.1.10 # ----------------------------------------------------------------------------- # Packet capture — multicast traffic only # ----------------------------------------------------------------------------- sudo tcpdump -i any -nn 'multicast' # Specific group: sudo tcpdump -i eth0 -nn 'host 239.1.1.1' # IGMP control plane (group join/leave signaling): sudo tcpdump -i eth0 -nn -e 'igmp' # ----------------------------------------------------------------------------- # Common well-known multicast addresses (link-local 224.0.0.0/24) # ----------------------------------------------------------------------------- # 224.0.0.1 all hosts on the subnet # 224.0.0.2 all routers on the subnet # 224.0.0.5 OSPF — All OSPF routers (AllSPFRouters) # 224.0.0.6 OSPF — All Designated Routers (AllDRouters) # 224.0.0.9 RIPv2 routers # 224.0.0.13 PIM routers # 224.0.0.18 VRRP routers # 224.0.0.22 IGMPv3 # 224.0.0.102 HSRPv2 # 224.0.0.251 mDNS (.local resolution) # 239.255.255.250 SSDP / UPnP discovery # These are NEVER forwarded by routers — they stay on the link. Firewalls # that block multicast on a LAN break OSPF adjacencies, HSRP failover, # Bonjour/mDNS, and UPnP service discovery silently. # ----------------------------------------------------------------------------- # Router-side configuration (Cisco IOS reference) # ----------------------------------------------------------------------------- # Enable PIM sparse mode globally: # (config)# ip multicast-routing # (config-if)# ip pim sparse-mode # # Configure an RP (Rendezvous Point): # (config)# ip pim rp-address 10.1.1.1 # # Show multicast routing table: # # show ip mroute # # Show PIM neighbors: # # show ip pim neighbor # # Show IGMP groups joined by hosts: # # show ip igmp groups # ----------------------------------------------------------------------------- # Address range reference # ----------------------------------------------------------------------------- # 224.0.0.0/4 = 224.0.0.0 through 239.255.255.255 # Total addresses: 268,435,456 (entire former Class D space) # Not routable on the public internet by default. Enterprise multicast # deployments require explicit PIM, IGMP, and (across ASes) MSDP. # =============================================================================