The command ping is used to test whether your computer can communicate with another device (computer/server/printer) connected to your network or the internet.
To initiate a ping test in Mac OS X:
-
Open Terminal by navigating to /Applications/Utilities.
- In the Terminal window type ping <server> , where <server> is the hostname or IP address of the server that you want to ping. The command should look like this:
ping www.vmware.com
or
ping 192.168.x.x
- Press Enter.
A successful ping response is similar to the following:
[root@server]$ ping myservername
PING myservername (10.0.0.1) 56(84) bytes of data.
64 bytes from myservername (10.0.0.1): icmp_seq=0 ttl=64 time=0.025 ms
64 bytes from myservername (10.0.0.1): icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from myservername (10.0.0.1): icmp_seq=2 ttl=64 time=0.032 ms
64 bytes from myservername (10.0.0.1): icmp_seq=3 ttl=64 time=0.028 ms
--- server ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3092ms
rtt min/avg/max/mdev = 0.025/0.028/0.032/0.005 ms, pipe 2
[root@server]$
The successful response has a few notable elements:
- repeating lines showing that bytes were sent, and the time the trip took (in milliseconds (ms)).
- Statistics that the packets transmitted were also received, with minimal to no packet loss
NOTE: The default ping count in Mac OS X is not set. However, if you want to change its default count to set number, use the command below.
ping -c [count]<space>[IP address or Hostname]
An unsuccessful ping response is similar to the following:
[root@server]$ ping myservername
PING myservername (10.0.0.1) 56(84) bytes of data.
--- server ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3017ms
[root@server]$
The unsuccessful response is determined by the following::
- no response from the remote server, after sending the command
- Statistics that no packets were transmitted were received, with complete packet loss
- To stop the ping, after seeing enough results, press Ctrl + C.
Note: If you do not see a response when pinging by the hostname of the server, initiate a ping to the IP address. Initiating a ping to the IP address instead allows you to determine if the problem is a result of an issue with hostname resolution.