Ping a subnet by defining first three octets and return corresponding MAC Addresses for any IP addresses that respond to ICMP Ping on directly attached network. You may have come across this requirement but I use it very often to update the inventory and status of my network. Something I maintain and find very useful to audit the network, find anomilies and know what is allocated to what. Also useful if you manage MAC Address filtering on your Router. ------------------- Begin of script ./multiping ---------------------- #!/bin/bash echo "Usage: ./multiping [subnet e.g. 192.168.1]" CURR=1 SUBNET="$1" FILE=multiping.log touch $FILE function multiping() { ping -c1 -t1 $SUBNET.$CURR 2>&1 >/dev/null if [ "$?" -eq "0" ]; then echo $(arp $SUBNET.$CURR) >> $FILE fi } while [ $CURR -lt 255 ] ; do multiping & let CURR=$CURR+1 let MOD=$CURR%100 #this code is for prevent the saturation of the executable connections if [[ $MOD -eq...
Inspired by infrastructure as code...