How to Check Network Connectivity Using Ping Command
The PING (Packet Internet Groper) command is used to check the network connectivity between the host and server/host. This command takes as input the IP address or the URL and sends a data packet to the specified address with the message “PING” and gets a response from the server/host this time is recorded which is called latency. Fast ping with low latency means a faster connection. Ping uses ICMP(Internet Control Message Protocol) to send an ICMP echo message to the specified host if that host is available then it sends an ICMP reply message. Ping is generally measured in milliseconds every modern operating system has this ping pre-installed.
Basic Syntax of the Ping Command:
The basic syntax of the ping command is as follows:
ping [options] host_or_IP_address
Here, “host_or_IP_address” represents the destination you want to ping.
Checking Internet Connection in Linux
To check your internet connection using the ping command, open the terminal and type the following command:
ping www.google.com
Replace “www.google.com” with the desired host or IP address you want to ping. If the connection is successful, you will see a series of responses displaying the round-trip time, indicating that your internet connection is working. To stop pinging we should use ctrl+c otherwise it will keep on sending packets.
Here,
- min: minimum time to get a response
- avg: average time to get responses
- max: maximum time to get a response
The internet connection to www.google.com is working correctly with 0% packet loss, successful transmission and reception of 4 packets, and low round-trip time (RTT) values averaging 1.264 ms, indicating a responsive and stable connection.
Common Options Available in ping Command
- 1. How to Check PING Version
- 2. How to Specify the Number of Pings
- 3. How to Controll the Size of Packets Send Using Ping Command
- 4. How to Change the Time Interval Using Ping Command
- 5. How to Get Only Summary Using Ping Command
- 6. How to Timeout PING
- 7. Flooding with PING
- 8. Add Timestamp to PING
- 9. Time to Wait for Response
- 10. Fill Packet with Data
- 11. Path MTU Discovery
- 12. Specify TTL (Time To Live)
How to Check Network Connectivity in Linux | ping Command
Ensuring a stable and reliable internet connection is crucial for seamless navigation and efficient communication in the world of Linux. The “ping” command is a powerful tool that allows users to check the status of their internet connection and diagnose network-related issues. In this article, we will explore how to use the ping command in Linux to verify internet connectivity and troubleshoot potential problems.