How to stop ping on the command line. Meet the Ping team

“Ahh, help, everything is gone!” – if your inner voice reacts to a loss of connection with the server something like this, this material is definitely for you. :) Of course, for our part, we do everything possible every day to ensure that nothing interferes with your work in the cloud, but if force majeure happens, we will sort it out. And in order to quickly navigate the situation and understand on whose side the error is, here is a minimum task for you - during a break, first of all, trace the route and ping intermediate nodes. Now we’ll tell you how to do all this.

Route tracing

During tracing, data packets are sent between the local computer and the server. This helps to trace the path of the request to the server and determine at what stage the break occurs. Tracing is quite easy.

1. Launch cmd command: Win+R > write down cmd > OK.

tracert X.X.X.X(where X.X.X.X is the server IP address or domain) and click Enter.

In the example, we made a trace for google.com.

tracert google.com

It turned out like this:

1 2 1 ms 1 ms 1 ms 193.151.89.254
3 5 ms 4 5 1 ms 6 1 ms 7 1 ms 3 ms 1 ms bearline-ic-324086-ffm-b4.c.telia.net
8 1 ms 1 ms 1 ms 108.170.251.129
9 13 ms 13 ms 15 ms 66.249.94.135
10 13 ms 13 ms 13 ms fra15s12-in-f46.1e100.net

As you can see, our packets have overcome ten (there may be fewer or more) nodes, and have overcome them successfully. Otherwise, if the packets “stumbled” on one of the nodes, on it (and subsequent nodes) we would see:

* * * Timed out request.

But even in this case, it is not time to draw conclusions yet - this entry may mean either packet loss or the fact that the network node is simply closed by security settings. Sometimes providers specifically configure nodes so that they do not respond to trace packets in order to reduce the load. To find out for sure whether a break is actually occurring, and, if so, where exactly, you need to ping each of the nodes. During tracing, we received the IP of each of them, which means we can move on to ping.

Ping intermediate nodes

Ping is designed to check the integrity and quality of connections. It's also easy to do. In this case, you need to start ping to all intermediate nodes in separate windows. This way, immediately at the moment of a connection failure, it will be visible at which node the packets are being lost and how long these failures last.

On Windows, only four packets are transmitted by default, which is not enough if the problem occurs only briefly. Therefore, you need to remove this limitation with the parameter -t(to stop exchanging packets later, click CTRL+C).

Now, in order.

1. Run cmd command: Win+R > write down cmd > OK.

2. In the opened command line enter ping -t Х.Х.Х.Х(where X.X.X.X is the address of one of the intermediate nodes that we learned during tracing) and click Enter.

In our case, during tracing, we identified ten nodes, which means the ping needs to be performed ten times in ten separate windows.

Healthy!
If you need to constantly monitor the quality of your connection, for Windows you can use convenient program PingPlotter.

So, let's ping - in ten separate command line windows we enter commands with the IP addresses of the nodes that we identified during tracing. In our case there will be the following commands:

ping -t 10.1.1.1
ping -t 193.151.89.254
ping -t 85.195.75.129
ping -t 213.248.79.29
ping -t 62.115.139.50
ping -t 62.115.120.8
ping -t 62.115.153.215
ping -t 108.170.251.129
ping -t 66.249.94.135
ping -t 216.58.208.46

If in any of the windows you see “Waiting interval exceeded” from the very first seconds, do not rush to shout: “Gotcha!” If the following nodes ping normally, then this one is simply closed by the settings. In our case, for example, the penultimate node (66.249.94.135) immediately says that the interval has been exceeded, but there are no problems with the ping of the tenth node.

On whose side is the mistake?

So, the break happened again. But this time the launched ping of intermediate nodes will help “expose” the culprit. Everything is simple here - whichever node started giving you “Waiting interval exceeded” is the weak link.

It’s clear who is to blame; now you need to understand what to do in specific situations.

1. Last node. If the last node pinged normally at first (some Windows machines do not respond to ping at all, this is set in the firewall settings)…

...and after the break it started showing “Timeout interval exceeded”, the break is happening on your server.

In this case, go to the control panel, launch the console and log into the operating system to figure out why the server is not working. If the operating system appears to be frozen, reboot the server.

2. Any nodes except the last one. In this case, contact technical support of both the cloud and Internet provider at the same time. In this case, be sure to indicate what the route trace initially looked like, and make a list of nodes indicating which of them had ping interrupted during the break and which did not. Be careful, this important information, make no mistake.

3. All nodes simultaneously. If all your ping windows start showing “Timeout Exceeded,” the problem is with your computer or the network it is connected to.

Bonus!

Well, to make it completely comfortable for you, we have selected utilities with which you can trace and ping intermediate nodes in one simple move without launching fifteen different windows.

For OS Windows family this optimization is carried out by the utility Winmtr. It does not require installation and is ready to use immediately after unpacking from the archive.

In field Host specify the destination server with which the connection will be checked and click Start:

In our example, the route trace and all intermediate nodes are visible. At the same time, ICMP packets are sent to each of them, by which the quality of communication can be determined.

Actually, this is the main advantage of the utility - its output is constantly updated, this allows you to collect statistics, track averages, trends and any changes in network quality.

Since we are checking the connection to the server, we are interested in the columns Sent(packets sent) and Recv(packets received). If the values ​​in these columns do not match, it means that the quality of communication with the node has deteriorated. What to do? Contact the appropriate technical support.

The Loss column will help you view the dynamics of losses as a percentage.

The utility also allows you to copy text in convenient formats ( .txt And .html) to clipboard ( Copy to clipboard) or to a separate file ( Export).

Double-clicking an intermediate node will provide additional information about it.

It is important to know!

To detail the problem, technical support specialists can request additional pings with special settings. To do this, just enter them in the window Options, which will allow you to specify:

  1. Interval (sec)– data update time in seconds.
  2. Max host in LRU list– maximum number of hosts (or IP addresses, if the option is not active Resolve names) to the end point.
  3. Ping size (bytes) – ICMP packet size.
  4. Resolve names– ability to convert an IP address to a hostname.

What about Linux?

For OS family Linux utility called simply MTR. If it's not in yours operating system, you can install it in one of the following ways:

Debian/Ubuntu/Mint:

$ apt-get install mtr

CentOS/RedHat/Fedora:

$ yum install mtr

MTR has the same functionality as Winmtr, and also similar GUI. You can run the utility with the command:

where X.X.X.X is the destination server's IP address or hostname.

In this case, the following columns are of interest:

  • Loss % – percentage of lost packets between the sending computer and intermediate nodes.
  • SNT – total number of packets sent.

As soon as something is lost somewhere, the utility signals us about this by coloring the node red and calculating the percentage of losses.

Separately, we note the ability to launch the utility in text (console) mode. To do this, just add the -t or --curses option:

mtr --courses site

Let's look at a few more important MTR options that can be extremely useful in the network diagnostic process.

R or --report

Initiates report mode in which MTR will process the specified number of cycles (defined by the -c option) and then display statistics and automatically exit. This mode is useful for collecting statistics about network quality.

C COUNT or --report-cycles COUNT

Allows you to set the number of cycles after which MTR will terminate.

P BYTES or --psize BYTES

Sets the packet size in bytes.

I SECONDS or --interval SECONDS

Sets the interval between sent packets.

N or --no-dns

Allows not to use DNS, displays host IP addresses.

A X.X.X.X or --address X.X.X.X

Allows you to specify the address of the computer interface from which ICMP requests will be sent.

Total

Of course, commands in the console give a more accurate result, since they record even single packet losses (short breaks), but Winmtr and MTR are compact and more convenient to use. It’s up to you to decide what to choose. :)

So, in fact, everyone who is to blame found out what to do, too. :) We hope the material was useful to you, and if you still have additional cloud-related questions, contact us for competent advice.

I think any administrator knows the ping command, which is used to check the availability of hosts. If you are an experienced administrator, you most likely won't learn anything new from this article. If your knowledge is limited to the banal ping ya.ru, I advise you to read the article to the end.

Example 1: Changing the time interval between sending packets

By default, packets are sent at intervals of one second. You can change this interval using the -i option.

Increasing interval

Example: Wait 5 seconds before sending the next packet.

$ ping -i 5 IP

Reducing the interval

Example: Wait 0.1 second before sending the next packet.

# ping -i 0.1 IP

The note: Only the superuser can specify an interval less than 0.2 seconds. Otherwise you will see a message like this.

$ ping -i 0.1 127.0.0.1 PING 0 (127.0.0.1) 56(84) bytes of data. ping: cannot flood; minimal interval, allowed for user, is 200ms

Example 2: Checking the local interface

Before checking the remote host, it is first recommended to check if everything is ok with your local interface. You can use the following 3 methods for this.

Ping zero (0)

This is the simplest and quick way:

$ ping 0 PING 0 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.024 ms ^C

Ping by name

$ ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.051 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.055 ms ^C --- localhost ping statistics -- - 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.051/0.053/0.055/0.002 ms

Ping via IP

$ ping 127.0.0.1 2 packets transmitted, 2 received, 0% packet loss time 999ms rtt min/avg/max/mdev = 0.051/0.053/0.055/0.002 ms

There should be no packet loss.

Example 3. Send N packets and exit

To automatically end ping after sending the number of packets you specify, use the -c option.

In the following example we will send 5 packets.

$ ping -c 5 google.com PING google.com (74.125.45.100) 56(84) bytes of data. 64 bytes from yx-in-f100.google.com (74.125.45.100): icmp_seq=1 ttl=44 time=731 ms 64 bytes from yx-in-f100.google.com (74.125.45.100): icmp_seq=2 ttl =44 time=777 ms 64 bytes from yx-in-f100.google.com (74.125.45.100): icmp_seq=3 ttl=44 time=838 ms 64 bytes from yx-in-f100.google.com (74.125.45.100 ): icmp_seq=4 ttl=44 time=976 ms 64 bytes from yx-in-f100.google.com (74.125.45.100): icmp_seq=5 ttl=44 time=1071 ms --- google.com ping statistics -- - 5 packets transmitted, 5 received, 0% packet loss, time 4216ms rtt min/avg/max/mdev = 731.039/879.129/1071.050/126.625 ms

Example 4. Version of the ping command

Using the -V option we can view the current version of the command.

$ ping -V ping utility, iputils-sss20071127

Example 5. Flood on the network

The superuser can send thousands or more packets in a short time using the -f option.

As shown below, ping -f sent over 400,000 packets in a few seconds.

# ping -f localhost PING localhost (127.0.0.1) 56(84) bytes of data. .^C --- localhost ping statistics --- 427412 packets transmitted, 427412 received, 0% packet loss, time 10941ms rtt min/avg/max/mdev = 0.003/0.004/1.004/0.002 ms, ipg/ewma 0.025/0.004 ms

Example 6: Beep

This option is rarely used, but can be very useful. You start pinging, there is no response from the host, you figure out what's wrong, and as soon as the problem is resolved and the remote host responds, you will hear a sound.

$ ping -a IP

Example 7: Print only command execution statistics

Using the -q option, you can skip the responses from the remote host and display the resulting statistics directly.

$ ping -c 5 -q 127.0.0.1 PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. --- 127.0.0.1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3998ms rtt min/avg/max/mdev = 0.047/0.053/0.061/0.009 ms

Example 8: Changing the batch size

You can change the size of the packet sent using the -s option.

Example: Let's change the packet size from 56 to 100.

$ ping -s 100 localhost PING localhost (127.0.0.1) 100(128) bytes of data. 108 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.022 ms 108 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.021 ms 108 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.020 ms ^C --- localhost ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.020/0.021/0.022/ 0.000 ms

Example 9. Command execution duration

Using the -w option, we can specify the command execution time in seconds.

In the following example we will ping the localhost for 5 seconds.

$ ping -w 5 localhost

The note: If the -w and -c options are used simultaneously, the utility will terminate when the first constraint is triggered.

Example 10: Quick Statistics with SIGQUIT

Without interrupting the ping command, you can view execution statistics. To do this you need to click CTRL + |

$ ping -w 100 localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.021 ms 64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.022 ms 11/11 packets, 0% loss, min/avg/ewma/max = 0.020/0.022/0.022/0.024 ms 64 bytes from localhost (127.0.0.1): icmp_seq=12 ttl=64 time=0.021 ms 64 bytes from localhost (127.0.0.1): icmp_seq=13 ttl=64 time=0.022 ms 64 bytes from localhost (127.0.0.1): icmp_seq=14 ttl=64 time=0.021 ms 64 bytes from localhost (127.0.0.1): icmp_seq=15 ttl=64 time=0.021 ms 19/19 packets, 0% loss, min/avg/ewma/max = 0.020/0.022/0.022/0.024 ms 64 bytes from localhost (127.0.0.1): icmp_seq=31 ttl=64 time=0.022 ms 64 bytes from localhost (127.0.0.1): icmp_seq=32 ttl=64 time=0.022 ms 32/32 packets, 0% loss, min/avg/ewma/max = 0.020/0.022/0.022/0.027 ms 64 bytes from localhost (127.0.0.1): icmp_seq=33 ttl=64 time=0.023 ms ..

The best tableware from world brands in the online store: BergHOFF, Luminarc, Vitesse

PING is a basic Windows command line utility for testing connections on TCP/IP based networks. The PING command uses ICMP echo request messages to verify an IP-level connection to another TCP/IP-enabled computer. After each transmission, a corresponding message with an echo response is displayed.

Ping is perhaps the most basic TCP/IP command among Windows users, used for troubleshooting and testing Internet access.

The Ping command, run without parameters, displays help. Works equally effectively for everyone Windows versions, including Windows 10.

You can also use the following commands to check the network:

  • TRACERT - determines the path to the destination by sending echo messages;
  • PATHPING - provides information about data loss on intermediate nodes.

Syntax parameters important keys of the PING command

ping [-t] [-a] [-n counter] [-l size] [-f] [-i TTL] [-v type] [-r counter] [-s counter] [(-j host_list | - k node_list)] [-w interval] [target_machine_name], where

  • -t - Sets the ping command to send echo request messages to the destination until the command is aborted. To interrupt the command and display statistics, press CTRL-BREAK. To interrupt and exit the ping command, press CTRL-C.
  • -a - Sets reverse name resolution to the destination IP address. If successful, the name of the corresponding node is displayed.
  • -n counter - Sets the number of echo request messages to be sent. Default is 4.
  • -l size - Sets the length (in bytes) of the data field in sent echo request messages. Default is 32 bytes. The maximum size is 65527.
  • -f - Sets echo request messages to be sent with the "Don"t Fragment" flag in the IP header set to 1. Echo request messages are not fragmented by routers on the way to their destination. This setting is useful for troubleshooting problems encountered with the maximum block data for the channel (Maximum Transmission Unit).
  • -i TTL - Sets the value of the TTL field in the IP header for echo request messages sent. The default is the node's default TTL. For Windows XP hosts this value is typically 128. The maximum TTL value is 255.
  • -v type - Sets the value of the Type of Service (TOS) field in the IP header for echo request messages sent. The default value is 0. The type is a decimal value from 0 to 255.
  • -r counter - Specifies the Record Route option in the IP header to record the path taken by the echo request message and its corresponding echo reply message. Each hop in the path uses a route entry parameter. Whenever possible, the counter value is set to be equal to or greater than the number of hops between the source and destination. The counter parameter has a value from 1 to 9.
  • -s counter - Specifies an Internet Timestamp option in the IP header to record the arrival time of the echo request message and its corresponding echo reply message for each hop. The counter parameter has a value from 1 to 4.
  • -j node_list - Specifies that echo request messages use the free routing option in the IP header with the set of intermediate destinations specified in host_list. In free routing, successive intermediate destinations can be separated by one or more routers. The maximum number of addresses or names in a host list is 9. A host list is a collection of IP addresses (in dotted decimal notation) separated by spaces.
  • -k node_list - Specifies that echo request messages use the strict routing option in the IP header with the set of intermediate destinations specified in host_list. In strict routing, the next intermediate destination must be directly reachable (it must be adjacent on the router interface). The maximum number of addresses or names in a host list is 9. A host list is a collection of IP addresses (in dotted decimal notation) separated by spaces.
  • -w interval - Specifies, in milliseconds, the time to wait to receive an echo reply message that corresponds to an echo request message. If an echo reply message is not received within the specified interval, a "Request timed out" error message is issued. The default interval is 4000 (4 seconds).
  • destination_computer_name - Specifies a destination identified by an IP address or hostname.

Examples of using the PING command

  • To display command prompt help for a command, type: ping /?;
  • To check the connection of the ya.ru address before manual termination, enter: ping ya.ru -t;
  • To send an ICMP echo request message to destination 192.168.1.1 and match it to its hostname, enter: ping -a 192.168.1.1;
  • To send an ping message to 10.0.99.221 with ten ping messages, each with a 1000-byte data field, enter: ping -n 10 -l 1000 10.0.99.221;
  • To send a ping message to destination 10.0.99.221 and record the route for 4 hops, enter: ping -r 4 10.0.99.221;
  • To send a ping message to 10.0.99.221 and set free routing to destinations 10.12.0.1-10.29.3.1-10.1.44.1, enter: ping -j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221.

Video - How to use the PING utility

I already wrote about, today I would like to focus your attention on the ping command. System administrators use the Ping command most often, although its potential is very limited. In this article I will tell you how to use the ping command and what problems it will help you solve.

Let's see what the Ping program can do, to do this, click start => run => type cmd => click OK => type the command in the black window

Ping /? => press enter.

You will see a list of commands that can be executed using the Ping program.

Ping [-t] [-a] [-n<число>] [-l<размер>] [-f] [-i ] [-v ] [-r<число>] [-s<число>] [[-j<список узлов>] | [-k<список узлов>]] [-w<тайм-аут>] [-R] [-S<адрес источника>] [-4] [-6] end_node Options -t Test communication with the specified node before terminating. To display statistics and continue checking, press the key combination CTRL+BREAK; To stop, press CTRL+C. -a Determine hostnames from addresses. -n<число>The number of echo requests sent. -l<размер>Send buffer size. -f Sets a flag in the packet that disables fragmentation (IPv4 only). -i Setting the packet lifetime. -v Set the service type (IPv4 only. This option is not available and does not affect the TOS field in the IP header). -r<число>Record a route for a specified number of hops (IPv4 only). -s<число>Timestamp for the specified number of hops (IPv4 only). -j<список_узлов>Free choice of route from a list of hosts (IPv4 only). -k<список_узлов>Hard route selection based on a list of hosts (IPv4 only). -w<тайм-аут>Timeout for each response (in milliseconds). -R Use the header to check the return route as well (IPv6 only). -S<адрес источника>The source address to use. -4 Forced use of IPv4 protocol. -6 Forced use of IPv6 protocol.

Let's look at some of them.

Practical use:

The t key is used when it is necessary to ping a resource for a long time, so as not to enter the command every time:

Ping site

can be entered like this:

Ping 27susday.ru -t

and the process can only be stopped manually by pressing ctrl+c

The i key is needed to set the lifetime of the sent packet, the default is 128. You send the packet and it starts searching through remote nodes, passing the node, one is subtracted, and so on until there is zero. Then the package is destroyed and displays a corresponding notification to you.

The w– key is needed to increase the waiting time for a response from the resource you are accessing. There are cases when you send a ping to a node, and it gives you a message that the specified node is not available, so you think that the node is down. The conclusion is correct, but not always. It happens that it is available, but it is overloaded and does not have time to answer you, to avoid this, the key w is set.

It happens that the remote node seems to be working, i.e. you can go to it, you are one hundred percent sure of its functionality, but it doesn’t respond to ping, even if you set a delay using the w key. This is explained by the fact that the system administrator set up a firewall and prohibited responding to ICMP packets. This is done so that it is impossible to storm servers that look on the Internet with echo requests. The server will not crash, but its performance will decrease.

Advice: If you are a novice system administrator, I advise you to close the ICMP port on your servers that access the Internet.

In this article you learned about the three main keys for the Ping program.

Video tutorial on reducing ping in games:

Team Windows string, as a rule, is not used by most users, perhaps because not everyone knows what commands to use in this or that case, how useful it can sometimes be, or even what it is?

If you are one of those users, I hope this article will help you get started using it. Perhaps you just forgot some command, and here I hope to help you.

At first glance, rj may seem like a boring, complicated or useless tool, but I assure you, it is not so!

This article is intended solely as an introduction to some of the many useful commands.

Basic cmd commands.

1. Forced stop running process Ctrl+C

The first command you should know is pressing two keys Ctrl and C at the same time. This combination stops almost any team. If you find an error in the command you entered, you can simply erase unnecessary characters using the backspace button, but if you have already run the wrong thing, you can use the Ctrl+C combination.

Attention! This command is not a magic wand! It will not be able to cancel processes that cannot be canceled, so be careful!

2. Call help using the command /?

The second command you should remember is /? . By typing these two characters after another command, you will see help for the command you are interested in. For example:

3. Information about your network connection

This command will display information about your connection by local network:

You can find out more complete information about your computer by typing the command.

4. Ping check (connection check) ping

Let's say you have two computers connected via an Ethernet cable (we have already discussed how to crimp a cable to create a local network earlier). You need to be sure that there is a connection between them. To do this, you need to run ping 192.168.0.5 from a computer whose IP address is 192.168.0.1 (where 192.168.0.5 is the IP address of the second computer).

If everything is in order, then pings will appear in front of you. If something is done wrong, you will see the message The specified node is unavailable. You can stop this command with Ctrl+C.

5. Exit the command line exit .

You can close the command line window with the exit command.

6. Copying files xcopy.

A very useful tool for copying files. Let's say you want to copy photos from drive C to an external drive.

Dial xcopy c:photo f:photo /s /e(where f is the external drive).

6. Checking time time.

If you need to adjust by typing time you will be presented with the current time. And here you will be offered to change the time to the correct one.

7. Open a new command line window cmd or start .

Enter the cmd or start command and a new command prompt window will open in front of you. You can also simply clear the current window. To do this, type the command cls (clear screen).

8. Check system files sfc /scannow.

Malware sometimes tries to replace system kernel files with modified versions in order to gain control of the system. System File Checker can be used to check the integrity of Windows system files. If any files are damaged or deleted, they will be replaced.

9. Information about installed drivers driverquery.

If you want to see what drivers are installed on your PC, you can do so by running the driverquery command. This command provides information about each driver you have.

If you need a little more information, you can add the Latin letter V (here's what driverquery-V would look like).

10. Find out the IP address of the site nslookup site.ru

Type nslookup site.ru in the command line to find out the IP address of site.ru.

11. Insert text

In order to paste text into the command line, you need, as usual, to copy it from the source, and then simply right-click once in the black screen area.

Publications on the topic