AMZ DIGICOM

Digital Communication

AMZ DIGICOM

Digital Communication

Linux ping command: check accessibility of other devices

PARTAGEZ

The Linux ping command lets you check if you can connect to other computers or devices on your network. This technique is compatible with the majority of operating systems and Internet-connected devices.

Linux ping command: what is it?

The ping command is a simple, proven solution that allows you to determine theaccessibility of a computer or device within the network you are using. It allows you to send a request to the relevant device, which responds immediately. You can then assume that a connection is established between these two devices, and that you can use it. This request and response system works on Linux and other Linux distributions such as Ubuntu, but is also supported by all major operating systems. A large majority of devices, including routers, printers or scanners, are also able to respond to a ping request. While it is possible to manually prevent an automatic response to a ping from being sent, there is no security benefit to doing so.

How does the Linux ping command work?

The ping command is filled in and then executed, all from the terminal. It allows you to send a simple signal to a defined target. It responds automatically with another acknowledgment signal. Said target is defined using an IP address or a host name. In the second case, the hostname is usually transformed into a DNS address; the ping command is therefore quite capable of finding such an address. If you don’t interrupt the Linux ping command manually or with an option, it continues endlessly to send a signal per second. There are two different variants for this command: « ping » is used for Ipv4 addresses, while « ping6 » is used for IPv6 addresses.

What does the ping command syntax look like?

The Linux ping command syntax looks like this:

$ ping [Options] [Exemple]

shell

« ping » is the actual command, which you can refine using options. The target can be a concrete IP address or a host name.

What are the ping command options?

There are several options associated with the ping command. Below are the most important of them.

  • -vs [nombre] : it is used to define the total number of requests that should be sent. Once this number is reached, the ping command stops.
  • -I [interface] : it is used to determine the interface through which the ping request is sent.
  • -i [intervalle] : it allows you to specify the interval at which a request must be sent. The default is set to one second; the interval must also be specified in seconds.
  • -W [pause] : it is used to indicate the response time that should be granted after a request before the contact attempt is automatically interrupted. This pause time is also indicated in seconds.
  • -w [fin] : it is used to determine the execution time of a ping request. As soon as the time (indicated in seconds) has elapsed, the contact attempt is terminated, whether or not it was successful.

Ping command: examples

Let us show you some simple examples to illustrate how the Linux ping command works.

This command sends a request to the website example.fr, at one-second intervals and without an end time. The result should contain the DNS address of the website.

$ ping -c 5 exemple.fr

shell

This command sends five signals to the website example.fr and to indicate whether these contact attempts were successful. After these five attempts, the contact is automatically interrupted.

$ ping6 ipv6.exemple.fr

shell

This command checks if you have an Internet connection compatible with Ipv6 and if it is possible to access the website example.fr through this intermediary.

Télécharger notre livre blanc

Comment construire une stratégie de marketing digital ?

Le guide indispensable pour promouvoir votre marque en ligne

En savoir plus

Souhaitez vous Booster votre Business?

écrivez-nous et restez en contact