The ping command is a command for network diagnosis in Linux system. It can check whether the network is connected. It is usually used to analyze and judge network faults. It is a very used command. Let me introduce you how to use the ping command under Linux. Let's take a look at it.
, by sending ICMP ECHO_REQUEST packets to a network host (send ICMP ECHO_REQUEST to network hosts), and the response of the display, so that we can determine whether the target host can access information according to its output ( But this is not absolute). In order to prevent detection by ping, some servers set a prohibition ping through the firewall or disable ping in the kernel parameters. Therefore, it is impossible to determine whether the host is still open by ping.
The ping under linux is slightly different from the ping under windows. The ping under linux will not be automatically terminated. You need to terminate by ctrl+c or specify the number of responses required by parameter -c.
1. Command format:
ping [parameter] [host name or IP address]
2. Command function:
The ping command is used to: Determine the status of the network and external hosts; track and isolate hardware and software issues; test, evaluate, and manage the network. If the host is running and connected to the network, it responds to the loopback signal. Each echo signal request contains an Internet Protocol (IP) and ICMP header followed by a tim structure and enough bytes to fill in the packet. The default is to continuously send a loopback request until an interrupt signal is received (Ctrl-C).
The ping command sends one datagram per second and prints one line of output for each response received. The ping command calculates statistics on signal round-trip time and (information) packet loss and displays a brief summary after completion. The ping command ends when the program times out or when a SIGINT signal is received. The Host parameter is either a valid host name or an Internet address.
3. Command parameters:
-d Use the SO_DEBUG function of Socket.
-f Limit detection. Send large and fast network packets to a machine to see its response.
-n Only output values.
-q Does not display any information about the transmitted packet, only the last result.
-r Ignore the normal Routing Table and send the packet directly to the remote host. Usually it is a problem to check the network interface of this machine.
-R Records the routing process.
-v Detailed display of the execution of the instruction.
Number of p--c: Stops after sending the specified number of packets.
-i Seconds: Set a few seconds to send a network packet to a machine. The default value is one second.
-I Web Interface: Sends a packet using the specified web interface.
-l Preload: Sets the packet to be sent before sending the request message.
-p Template Style: Set the template style to fill the packet.
-s Bytes: Specifies the number of bytes of data to be sent. The default value is 56, plus an 8-byte ICMP header, which is a total of 64 ICMP data bytes.
-t Survival value: Set the size of the surviving value TTL.
4. Use case:
Instance 1: ping pass
Command: ping 192.168.120.205
Output:
The code is as follows:
[root@localhost ~]# ping 192.168.120.205
PING 192.168.120.205 (192.168.120.205) 56(84) bytes of data.
64 bytes from 192.168.120.205: icmp_seq=1 ttl=64 time=0.720 ms
64 bytes from 192.168.120.205: icmp_seq=2 ttl=64 time=0.181 ms
64 bytes from 192.168 .120.205: icmp_seq=3 ttl=64 time=0.191 ms
64 bytes from 192.168.120.205: icmp_seq=4 ttl=64 time=0.188 ms
64 bytes from 192.168.120.205: icmp_seq =5 ttl=64 time=0.189 ms“/p” “p”--- 192.168.120.205 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.181/0.293/0.720/0.214 ms
[root@localhost ~]#
Previous123Next 3
on rhel6.3 rhel is the Linux system of Red Hat, and yum is the shell front-end package manager unde
After Kali Linux is installed, many people dont know how to configure the network.
In Linux, OpenVPN is a good open source VPN, so it is widely used. However, many us
Under the Ubuntu system, some users have reported that they cannot find the signal
How Linux changes the MAC address in the virtual machine
Linux geeks need to master the collection of skills
Why does a Linux system have w permissions but cannot delete files?
How Ubuntu uses commands to adjust screen brightness
How Linux prohibits automatic upgrade of system kernel Kernel
How to set command aliases in Linux
Linux uses PXE to install virtual machines
How to clean up swap, buffer and cache in Linux
How to use ext3grep to recover files on Linux
64-bit CentOS 6.4 installation configuration ntopng steps
Linux/Ubuntu 11.10 How to build Android4.0.3 development environment
Win8.1 system IE11 downgraded to IE10 graphic tutorial
Alternative copy shortcuts computer tips
Make good use of disk defragmentation, and leave a space for xp.
Win 7 system directly view the system startup time
How to solve the problem of Win7 local connection IPV4 no access?
e secret krn.exe takes up 100% of the CPU problem
Change the Windows 7 folder settings from default to tile
How does Win7 completely uninstall sql2005? Win7 delete sql2005 skills
How to use the Heiner River Downloader? Heiner Baichuan Downloader Usage Method