
"Ping" doesn't work properly
I only want to send one packet to another host to check whether it is
connected or not. I want to have 2 seconds timeout.
I use, ping -c 1 -w 2 192.168.0.2
If host is not connected, it fails correctly. BUT summary says.
PING 192.168.0.2 from 192.168.0.1 : 56(84) bytes of data
--------192.168.0.2 ping statastics --------
2 packets transmitted, 0 received, 100% loss, time 999ms
Why 2 packets are sent instead of 1 (specified) and why it only waits
for 999 ms instead of 2 seconds.
Even if I use: ping -c 5 -w 2 192.168.0.2, it has the same result. Here
I wanted to send 5 packets but, again 2 packets were sent?
What is wrong here? Please help me.
Thanks a lot