Linux commands: Ping command-send packets to a network host

Source: Internet
Author: User

ping command

Function description

Ping is the most commonly used network connection command, and Ping sends a special network packet IMCP echo_request to the specified network host. Most network devices will respond by receiving the packet, which makes it difficult for the network connection to work properly and is used as follows:

ping [parameters] [host name or IP]

Common parameters

Options Description
-C Stop after sending a specified packet
-S Specifies the number of data bytes sent, with a preset value of 56
-T Set the size of the Live value TTL
-I. Set the number of seconds, send packets every few seconds, default is 1 seconds

Example

test connectivity

[[email protected] ~]# ping z.cn

Ping z.cn (54.222.60.252) bytes of data.

bytes from 54.222.60.252:icmp_seq=1 ttl=243 time=12.6 ms

bytes from 54.222.60.252:icmp_seq=2 ttl=243 time=5.01 ms

bytes from 54.222.60.252:icmp_seq=3 ttl=243 time=5.66 ms

3 packets transmitted, 3 Received, 0% packet loss, time 2003ms

Rtt Min/avg/max/mdev = 5.016/ 7.785/12.680/3.472 ms


The size of the BYTES:ICMP package, this value is a preset value

Icmp_seq=0: Number of detections, sorted sequentially

ttl=243: Time To Live

Time: Response times

     ping after no parameter, will be the contract, press the CTRL-C key to terminate the ping program. 0% packet loss packet loss 0% indicates that the network is functioning properly.

Use the-c parameter, specify the number of times, and the following indicates the sending of a packet

[Email protected] ~]# ping-c 1 z.cn

PING z.cn (54.222.60.252) bytes of data.

Bytes from 54.222.60.252:icmp_seq=1 ttl=243 time=11.4 ms


---z.cn ping statistics---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

RTT Min/avg/max/mdev = 11.464/11.464/11.464/0.000 ms

Specify the number of times, and the time, below, to send 2 packets, interval time 3 seconds

[Email protected] ~]# ping-c 2-i 3 z.cn

Multi-parameter use,-C 2 send times,-I 2 interval 2 seconds,-s 1024 send packet size 1024,-t 255TTL value is 255

[Email protected] ~]# ping-c 2-i 2-s 1024-t 255 z.cn


Reference:

Http://www.cnblogs.com/peida/archive/2013/03/06/2945407.html


This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1880292

Linux commands: Ping command-send packets to a network host

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.