As per the title, a collection of methods to plotter a range of pings without going ip by ip.
At first, I focused on finding a solution for a bash script to be saved as a .sh file, invoked and parsed a given attribute for the subnet range, but it was too much to remember when I can simply copy/paste a line of a script and modify it on the go as needed.
On Linux for a simple /24:
for octet4 in {1..254} ;do (ping 172.16.20.$octet4 -c 1 -w 5 >/dev/null && echo "172.16.20.$octet4" &) ;done
And if I want to get into /23 or wider subnets... :
for octet3 in {1..254} ;do (for octet4 in {1..254} ;do (ping 192.168.$octet3.$octet4 -c 1 -w 5 >/dev/null && echo "192.168.$octet3.$octet4" &) ;done) ;done
// WIP
On Windows:
for i in {1..254} ;do (ping 192.168.1.$i -c 1 -w 5 >/dev/null && echo "192.168.1.$i" &) ;done
On Mac:
for i in {1..254} ;do (ping 192.168.1.$i -c 1 -w 5 >/dev/null && echo "192.168.1.$i" &) ;done
No comments:
Post a Comment