Last active
October 23, 2023 18:21
-
-
Save suuhm/c2190ee3dc6d465df70f99082a72ba40 to your computer and use it in GitHub Desktop.
Oneliner - Get a list of all joined multicast/broadcast members
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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