Can you only use ping to test the network? Senior network workers will still use this

Today let's talk about the PING command. As a network engineer, you should be familiar with it. As one of the ICMP protocol tools, PING is a command with a high usage rate.

What it does:

  • Used to detect network connectivity and analyze network speed

  • Get the server IP according to the domain name

  • According to the TTL value returned by ping, determine the operating system used by the other party and the number of data packets passing through the router

In the manufacturer certification, there are also courses for learning PING, which are generally designed as a must-learn technology for elementary courses.

edit

Add picture annotations, no more than 140 words (optional)

If you feel that you don’t have a deep understanding of the PING command, or you want to learn the basics of the network more systematically, you are also welcome to chat privately and discuss it together.

Having said that, network workers usually use this command to directly PING the IP address to test the connectivity of the network.

But you know, besides this usage, what else can PING be used for?

Today let's discuss other usages of PING, how many have you used, and how many have not yet been used.

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

01 Use of ping-t

Ping the specified computer without interruption, until the administrator interrupts.

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

This shows that the computer is connected to the router and the network effect is good. Next, hold down the keyboard's Ctrl+c to terminate it and continue to ping, and it will stop, and it will summarize how many packets are running and how many are on and off.

02 Use of ping-a

Ping-a resolves the computer name and NetBios name. That is, the host name can be resolved by pinging its IP address.

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

03 Use of ping-n

By default, only 4 data packets are generally sent. Through this command, you can define the number of packets to be sent, which is very helpful for measuring the network speed.

For example: if you want to test the average return time of sending 10 data packets, what is the fastest time, and what is the slowest time, you can get the following information:

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

From the above operations, you can know that in the process of sending 10 data packets to 47.93.187.142, 10 data packets were returned without loss. Among the 10 data packets, the fastest return speed was 32ms, the slowest was 55ms, and the average speed was 37ms.

Description: The network is good.

For some bad networks, such as the monitoring system is very stuck, the returned results of this test may show a part of the loss. If the loss is relatively large, then it means that the network is not good.

Through this, you can intuitively judge the network situation.

04 Use of ping-I size

-l size: Send a data packet of the specified size to the target host.

By default, the size of the data packet sent by Windows ping is 32 bytes, and the maximum size can be 65500 bytes.

When the data packet sent at one time is greater than or equal to 65500byte, it may cause the receiver's computer to crash. So Microsoft has limited this value; this parameter is very harmful when combined with other parameters.

For example, an attacker can combine the -t parameter to implement a DOS attack. (So ​​it is dangerous, don't easily use it on other people's computers).

For example, ping -l 65500 -t 211.84.7.46

The ping command will be continuously executed on the IP address until interrupted by the user with Ctrl+C.

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

In this way, it will continuously send data packets with a size of 65500 bytes to the 211.84.7.46 computer.

If you only have one computer, maybe it won't work.

But if you have a lot of computers, you can completely paralyze the other party and cause serious network congestion, which shows that the power is not trivial.

05 Use of ping-r count

Record the route of outgoing and return data packets in the "Record Route" field, and detect the number of routes passed, but only 9 routes can be traced at most.

ping -n 1 -r 9 202.102.224.25 (send a data packet, record up to 9 routes)

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

All 9 routes will be displayed, as shown in the figure above.

These 6 are the most commonly used Ping commands, and you may use them in projects. Here is a less commonly used but useful ping method.

06 Batch ping network segments

For a network segment with many IP addresses, if a single detection is too troublesome, then we can directly ping the network segment detection in batches, and it will be clear at a glance which IP address has a problem.

Look at the code first, enter directly in the command line window: for /L %D in (1,1,255) do ping 10.168.1.%D, change the IP address segment to the IP address segment you want to check.

Edit toggle to center

Add picture annotations, no more than 140 words (optional)

When the batch command is input, it will automatically ping all the IP addresses in the network segment.

So what does this "for /L %D in(1,1,255) do ping 10.168.1.%D" code mean?

The (1,1,255) in the code is the beginning and the beginning of the network segment, which is to detect all the IP addresses between the network segment 192.168.

Finishing: Lao Yang 丨 8-year senior network engineer , more network workers to improve dry goods, please pay attention to the official account: Network Engineer Club

Guess you like

Origin blog.csdn.net/SPOTO2021/article/details/122823849