How to know the ip reachable quickly.

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 128.0.0.1
PING 128.0.0.1 (128.0.0.1) 56(84) bytes of data.

--- 128.0.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 10000ms

It took 10000ms to know 128.0.0.1 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?

 
jl66Asked:
Who is Participating?
 
farzanjCommented:
This link gives you information of network troubleshooting.  Many of these utilities would be useful for you.
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch04_:_Simple_Network_Troubleshooting
0
 
farzanjCommented:
Do you want to check whether a computer is reachable or not?

There are number of ways to do it.

You can check:
1.  Check ports from outside computers. Like nmap
2.  From the machine, check route of some external website  -- like traceroute
3.  From the machine, try querying its own DNS server  -- dig <DNS server> or dig <external website>
0
 
mlchelpCommented:
of course not, if your pinging a pc or server that is not on your network it is going to be over 10MS. You have to wait, you can adjust the time with ttl but if say you are on the east coast and ping a server on the west coast it will take at least 45ms round trip. If you adjusted the ttl to 10ms you would get request timed out and think that there was a issue when there really was not.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
jl66Author Commented:
Thanks for the info.
michelp: how to adjust the ttl? What is the default value?
0
 
mlchelpCommented:
it really more of a hopp counter, se below.

Every IP packet that gets sent out has a TTL field which is set to a relatively high number (in the case of ping a TTL of 255). As the packet traverses the network, the TTL field gets decreased by one by each router it goes through; when the TTL drops to 0, the packet is discarded by the router. The IP spec says that the TTL should be set to 60 (though it's 255 for ping packets). The main purpose of this is so that a packet doesn't live forever on the network and will eventually die when it is deemed "lost." But for ping purposes, it provides additional information. The TTL can be used to determine approximately how many router hops the packet has gone through. If the TTL field varies in successive pings, it could indicate that the successive reply packets are going via different routes, which isn't a great thing.

you can change it with ping -i
0
 
mlchelpCommented:
you really cant adjust the limit on the round trip time in MS only the number of hops.
0
 
jl66Author Commented:
I tried to add option -i , but it did not make any difference.

[root@bare ~]# ping -c 1 -i 1 128.0.0.1
PING 128.0.0.1 (128.0.0.1) 56(84) bytes of data.

--- 128.0.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 10000ms

It seems if I have a timer, after less than 1 sec. I time it out. Does the shell commands on linux OS have this command?
0
 
jl66Author Commented:
0
 
Miguel Angel Perez MuñozCommented:
Remotes computer may have firewall and blocking ICMP responses. This may cause a bad response when you ping to this computer.
0
 
farzanjCommented:
Glad you liked it :)
0
 
jl66Author Commented:
Thanks a lot for everyone's tips.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.