Testing VPS/Server network connectivity with the ping command on a Mac Print

  • ping, mac, mac os, macbook, ping command, vps, server
  • 2

For troubleshooting purposes, it may be necessary to test network connectivity between different components of your network or between the Mac and the virtual machine. This article provides you with the steps to perform a preliminary test on your network from your Mac.

The command ping is used to test whether your computer can communicate with another device (computer/server/vps) connected to your network or the internet.

To initiate a ping test in Mac OS X:

1. Open Terminal by navigating to /Applications/Utilities.

2. 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.google.com or ping 112.168.2.40

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
  1. 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.
 

Was this answer helpful?

« Back