Skip to content

Instantly share code, notes, and snippets.

@suuhm
Last active October 23, 2023 18:21
Show Gist options
  • Select an option

  • Save suuhm/c2190ee3dc6d465df70f99082a72ba40 to your computer and use it in GitHub Desktop.

Select an option

Save suuhm/c2190ee3dc6d465df70f99082a72ba40 to your computer and use it in GitHub Desktop.
Oneliner - Get a list of all joined multicast/broadcast members
# Just enter the wished device you wanr to list your broadcast and multicast member ip's
D=eth0 ; B=$(ip a s dev $D | grep -E "^.*i.*brd \d" | cut -d ' ' -f8); echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts; F=/tmp/mcout; rm $F; clear; while true; do ping $B -W2 -c2 | grep from | cut -d " " -f4 | cut -d ":" -f1 >> $F; ping 224.0.0.1 -W2 -c2 | grep from | cut -d " " -f4 | cut -d ":" -f1 >> $F; clear; echo "BROAD/MULTICAST [$B] (END CTRL^C)"; echo; cat $F | sort -u; sleep 2; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment