Troubleshoot internet connection problems with the ping command

The ping command

Ping is a command line network utility tool to test network connectivity. ‚ÄčIt tests the connection between a sender and a receiver node. It reports whether the receiver node responds by sending an echo request. The receiving node responds with an echo reply.

Ping simply sends a signal to another computer and waits for a response.

dribbit@ubuntu-dribbit:~$ ping -c 5
PING ( 56(84) bytes of data.
64 bytes from web-001 ( icmp_seq=1 ttl=53 time=20.9 ms
64 bytes from web-001 ( icmp_seq=2 ttl=53 time=19.0 ms
64 bytes from web-001 ( icmp_seq=3 ttl=53 time=19.5 ms
64 bytes from web-001 ( icmp_seq=4 ttl=53 time=21.0 ms
64 bytes from web-001 ( icmp_seq=5 ttl=53 time=21.8 ms

--- ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7010ms
rtt min/avg/max/mdev = 18.954/20.252/21.825/1.017 ms

A -c (count) argument is added to stop the command after 5 requests. When omiting the count argunent on a Linux system, control + c is used to stop the ping command.

How to troubleshoot connectivity problems in 5 steps

Question Yes No
Can you ping Next question There is a problem with the TCP/IP software on the computer.
Can you ping to your local IP Next question Badly configured local IP address or problems with the network adaptor.
Can you ping the default gateway Next question The computer can't communicate with the local subnet. Could be a problem with the cables, wifi, router, switch or hub.
Can you ping an external IP address Next question No connection beyond the local network segment. Could be a problem with the internet modem or the router.
Can you ping an external hostname Network connection should be fine. There is a DNS problem. Could be that the computer can't reach the DNS server or there is a fault is the host file.