How to Check Internet Connectivity in Linux Terminal

submited by
Style Pass
2021-06-10 05:56:37

As an example, we will try to send three internet packages to the Google server and check the internet connectivity if we will be able to receive the internet packets from the Google server.

In the output, you can also witness that the three packages are transmitted and received. Again, this is because pinging to the Google server went successful.

The CURL command is used to download, upload, or transfer the data over the network from or to the server. It supports various protocols, and we can use it to check the internet connectivity by connecting to linuxhint.com and fetch the headers. If the headers are fetched successfully, that means the internet is working; otherwise, there is a problem.

If the internet is not connected using any of the above methods, you can use the IP command to check whether there is a problem in the gateway settings or network interface.

If pinging goes unsuccessful, it means there is a problem with the gateway settings, and you need to reconfigure them. Otherwise, the gateway settings are fine, but the internet is not working from the internet service provider end.

Leave a Comment