Ubuntu how to stop pinging

ubuntuusers.de

This article has been tested on the following versions of Ubuntu:

For the most part, this article applies to all versions of Ubuntu.

ping is a program / command for checking the accessibility of other computers or devices via any network. The "pinged" network participant answers the short request with an equally short reply. This shows that the participants can basically be reached among each other. ping uses the ICMP protocol for this.

The ping command is a basic (network) command that is available on virtually all operating systems. Other network devices such as printers or routers also usually respond to a ping request.

Note:

You can configure a computer or its firewall so that it does not respond to ping requests. However, this computer can still be reached. Almost all computers / servers that deliver public data (Internet pages, etc.) in any form usually respond to ping. Switching off does not bring any safety benefits.

Installation¶

The programs ping and ping6 are already included in every Ubuntu installation and in the package

integrated.

Use¶

There are two variants of the ping command:

  • ping - for IPv4 addresses

  • ping6 - for IPv6 addresses

The options are identical for both variants, so ping is always used in the following.

The command has the following general syntax:

A host name can also be specified instead of the IP address. An attempt is then made to resolve this into a DNS address.

ping OPTIONS example.com

This is also a very easy way to find out the DNS address for a domain, since ping also outputs it, see example below. If you call ping without any options, the command runs indefinitely and sends a ping request every second. That means you either have to stop ping manually (with Ctrl + C) or limit the number of packets sent with the corresponding option.

Options¶

ping knows the following options, among others:

Options of ping
option description
NUMBER indicates how many ping requests are to be sent, after which ping stops automatically
END is specified in seconds. ping is ended after this time, regardless of how many inquiries have been (un) answered.
TIMEOUT is specified in seconds and indicates how long ping waits for a response before it stops automatically
INTERVAL is specified in seconds and specifies the intervals at which the ping requests are sent. The default is one second.
defines the interface via which the ping requests are sent

ping knows a number of other options, all of which are described in great detail in the man page. The man page is also worth reading because of the additional background information on ping. An output from ping can look like this, for example:

PING ubuntuusers.de (213.95.41.13) 56 (84) bytes of data. 64 bytes from lisa.ubuntu-eu.org (213.95.41.13): icmp_seq = 1 ttl = 53 time = 202 ms 64 bytes from lisa.ubuntu-eu.org (213.95.41.13): icmp_seq = 2 ttl = 53 time = 99.6 ms 64 bytes from lisa.ubuntu-eu.org (213.95.41.13): icmp_seq = 3 ttl = 53 time = 62.7 ms 64 bytes from lisa.ubuntu-eu.org (213.95.41.13): icmp_seq = 4 ttl = 53 time = 84.8 ms --- ubuntuusers.de ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min / avg / max / mdev = 62.737 / 112.448 / 202.547 / 53.652 ms

Here ubuntuusers.de was pinged four times. The first line contains uu.de's IP address, followed by the four successful ping requests / responses. The last entry in the line is the time that has elapsed from the request to the response. The following lines show how many packets were sent, received and lost, and there are also some statistical values ​​about the response times.

on the other hand, checks whether you have a) IPv6-capable Internet access and b) the availability of Google.

In the case of "correctly" reachable computers, one can assume that there will be a response to all outgoing packets. If you keep seeing lost packets with a connection, you should investigate further here, why this is (e.g. hardware error of the target computer, too "long" connection, etc.)

Keyboard shortcuts¶

In addition to the option of manually ending a continuous ping with the key combination Ctrl + C, there is the option of using Ctrl + | (vertical line / pipe) to display an intermediate result of the statistics.

Left¶

This revision was created on April 15, 2020 16:29 by Heinrich_Schwietering.
The following keywords were assigned to the article: Shell, Internet, Network