ping
was not blocked, it just didn't showed you the failed transmissions while it was running.
Take a look at the statistics when you stopped it.
10 packets transmitted, 0 received, 100% packet loss, time 9071ms
You see packets were transmitted but not received. You ran it for ~10 seconds and it transmitted 10 packets and waited for 1 second for the timeout period you mentioned before sending the next packet.
If you want to visualize the failed transmissions you can use the -f
option with a suitable ping interval using the option -i interval
. The value of interval
should be greater than 0.2 seconds. You can find more details of it the manual page of ping by running man ping
.
ping -f -i .5 -W 1 1.1.1.1
Will produce an output like this.
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
.......^C
--- 1.1.1.1 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 3048ms
Where each .
represents a transmission without any reply and in case of a reply one backspace will be printed removing a .
.
I think this is the kind of solution you are looking for. An automated script for periodically checking the connectivity.