jl66
asked on
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?
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?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER
Thanks for the info.
michelp: how to adjust the ttl? What is the default value?
michelp: how to adjust the ttl? What is the default value?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you really cant adjust the limit on the round trip time in MS only the number of hops.
ASKER
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?
[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?
ASKER
farzanj: This is an excellent link. Thanks.
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch04_:_Simple_Network_Troubleshooting
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch04_:_Simple_Network_Troubleshooting
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad you liked it :)
ASKER
Thanks a lot for everyone's tips.