Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to linux ping command

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Today, the editor will bring you an article about introducing the linux ping command. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.

The ping command of the Linux system is a commonly used network command, which is usually used to test connectivity with the target host. We often say, "ping a machine to see if it is on" or "try ping gateway address 192.168.1.1 first" when you cannot open a web page.

It sends ICMP ECHO_REQUEST packets to the network host (send ICMP ECHO_REQUEST to network hosts) and displays the response so that we can determine whether the target host is reachable (but not absolutely) based on the information it outputs. In order to prevent detection through ping, some servers set to disable ping through the firewall or disable ping in kernel parameters, so that it is not possible to determine whether the host is still on by ping.

There is a slight difference between ping under linux and ping under windows. Ping under linux will not be terminated automatically. You need to press ctrl+c or use the parameter-c to specify the number of responses required to be completed.

1. Command format:

Ping [parameter] [hostname or IP address]

two。 Command function:

The ping command is used to determine the status of the network and external hosts; to track and isolate hardware and software problems; and to test, evaluate, and manage the network. If the host is running and connected to the network, it responds to the echo signal. Each echo request contains an Internet Protocol (IP) and ICMP header, followed by a tim structure and enough bytes to fill in the packet. By default, echo signal requests are sent continuously until an interrupt signal (Ctrl-C) is received.

The ping command sends a Datagram per second and prints a row of output for each received response. The ping command calculates statistics on signal round-trip time and packet loss, and displays a brief summary when complete. The ping command ends when the program times out or when a SIGINT signal is received. The Host parameter is either a valid hostname or an Internet address.

3. Command parameters:

-d uses the SO_DEBUG function of Socket.

-f limit test. Send a large number of network packets to a machine quickly and see its response.

-n outputs only numeric values.

-Q does not display any information about the delivery packet, only the final result.

-r ignores the normal Routing Table and sends the packet directly to the remote host. Usually check to see if there is something wrong with the local network interface.

-R records the routing process.

-v shows the execution of the instruction in detail.

-C number: stops after the specified number of packets are sent.

-I seconds: set a few seconds interval to send a network packet to a machine, the default value is once a second.

-I network interface: sends out packets using the specified network interface.

-l preload: sets the packet that is sent before the request information is sent.

-p template style: sets the template style that fills the packet.

-s bytes: specify the number of bytes of data to be sent, the default value is 56, plus 8 bytes of ICMP headers, a total of 64ICMP data bytes.

-t survival value: set the size of the survival value TTL.

The above is the knowledge summary of linux ping command, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report