You can use the fping
command to ping a block of hosts or a netblock. The fping
command is similar to the ping
command but it allows you to specify a range of IP addresses or a network range to ping multiple hosts at once.
To ping a block of hosts, you can use the following command:
fping -g 192.168.1.0/24
In this example, the -g
option is used to specify a network range to ping. The 192.168.1.0/24
specifies the range of IP addresses to ping. The /24
is the CIDR notation for the subnet mask, which means to ping all IP addresses in the range of 192.168.1.1
to 192.168.1.254
.
If you want to save the output to a file, you can use the redirection operator >
to save the output to a file:
fping -g 192.168.1.0/24 > ping_results.txt
This will save the output of the fping
command to a file called ping_results.txt
.