Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. subnet=$(./internal_ip.sh | cut -d '.' -f 1-3)
  2. #echo $subnet
  3. #for i in {1..10}; do ping -c 1 -W 1 $subnet.$i | echo ; done
  4. #for i in `seq 1 254`; do ping -c 1 $subnet.$i | tr \\n ' ' | awk '/1 received/ {print $2}'; done
  5. (prefix=$subnet && for i in `seq 254`; do (sleep 0.5 && ping -c1 -w1 $prefix.$i &> /dev/null && arp -n | awk ' /'$prefix'.'$i' / { print $1 " " $3 } ') & done; wait)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement