How to know the ip reachable quickly.
Posted on 2011-10-23
What is the quickest way to know the ip is reachable. For example, with ping utility,
ping -c 1 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.082 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.082/0.082/0.082/0.000 ms
The above is really fast. However,
ping -c 1 220.127.116.11
PING 18.104.22.168 (22.214.171.124) 56(84) bytes of data.
--- 126.96.36.199 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 10000ms
It took 10000ms to know 188.8.131.52 is no good.
Actually when waiting, I already know this is not good.
My question is that there is any other way to know quickly the ip is unreachable or if I want to give a certain number to cut off, saying after 10ms, if ping can't return, I will say the ip is bad.
How to do it?