Checking Connections with ping


Checking Connections with ping

Think of using ping as saying "Are you there?" to a remote computer. For example, suppose you're trying to connect to a Web page but are getting no response from the computer. Rather than wait and wonder what's going on, type ping to find out if the computer is up and functional (Code Listing 12.5).

Code Listing 12.5. Using ping, you can find out whether or not you can connect to a specific computer.

[ejr@hobbes ejr]$ ping www.raycomm.com PING www.raycomm.com (204.228.141.12): 56 data bytes 64 bytes from 204.228.141.12: icmp_seq=0 ttl=251 time=190.3 ms 64 bytes from 204.228.141.12: icmp_seq=1 ttl=251 time=197.7 ms 64 bytes from 204.228.141.12: icmp_seq=2 ttl=251 time=166.5 ms 64 bytes from 204.228.141.12: icmp_seq=3 ttl=251 time=157.5 ms -- www.raycomm.com ping statistics -- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 157.5/178.0/ 197.7 ms [ejr@hobbes ejr]$ 

To Check a Computer with ping:

  • ping www.raycomm.com

    At the shell prompt, type ping and the host name to test the connection to a specific host, as shown in Code Listing 12.5.

    Depending on your Unix system, it may check the connection one time and report the results. Or, it may continue to pester the other computer every second or so until you tell it to stop. If that's the case, just press to stop it.

Tips

  • If you're having problems connecting to a particular computer, you might consider using traceroute, which pings all the computers on the path between point A and point B. While ping tells you if a host responds or not, TRaceroute will give you an idea of where the problem might lie. See the next section for more details about TRaceroute.

  • The ping command doesn't provide a definitive answer to the status of the remote computer. Some systems are configured not to respond to pings for security reasons. If you get a response from ping, the system is definitely up and you can communicate with it; however, a lack of response from ping may not mean anything about that system's status.





Unix(c) Visual Quickstart Guide
UNIX, Third Edition
ISBN: 0321442458
EAN: 2147483647
Year: 2006
Pages: 251

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net