networking - Send a ping to each IP on a subnet -


Is there a command line based method for sending pings to each computer in the subnet? As for

  (int i = 1; i & lt; 254; i ++) ping (192.168.1.i);  

To apply the arc resolution?

I would recommend using Finging with the mask option, since you Are not restricted to ping themselves.

  fping -g 192.168.1.0/24  

The response will be easy to parse in a script:

  192.168. 1.1 is alive 192.168.1.2 is alive 192.168.1.3 is alive 192.168.1.5 is alive ... 192.168.1.4 is unreachable 1920.16.1.6 is unattainable 192.168.1.7 is unattainable ...  

Note: Accessible IP address will be blocked using the logic -a , otherwise you want to use the fingerings otherwise the unknown addresses will also be printed:

 < Code> fping -a -g 192.168.1.0/24  

From man:

Finging Ping , so that you can specify any target on the command line, or specify a file containing the target's lists in Ping. Instead of sending it to a goal until it is answered or else, Finging will send a ping packet to reach the next goal in round-robin fashion.

More info:


Comments