ping:测试主机和网络的连通性

一、语法

onlylove@ubuntu:~$ ping -help

Usage
  ping [options] <destination>

Options:
  <destination>      dns name or ip address
  -a                 use audible ping
  -A                 use adaptive ping
  -B                 sticky source address
  -c <count>         stop after <count> replies
  -D                 print timestamps
  -d                 use SO_DEBUG socket option
  -f                 flood ping
  -h                 print help and exit
  -I <interface>     either interface name or address
  -i <interval>      seconds between sending each packet
  -L                 suppress loopback of multicast packets
  -l <preload>       send <preload> number of packages while waiting replies
  -m <mark>          tag the packets going out
  -M <pmtud opt>     define mtu discovery, can be one of <do|dont|want>
  -n                 no dns name resolution
  -O                 report outstanding replies
  -p <pattern>       contents of padding byte
  -q                 quiet output
  -Q <tclass>        use quality of service <tclass> bits
  -s <size>          use <size> as number of data bytes to be sent
  -S <size>          use <size> as SO_SNDBUF socket option value
  -t <ttl>           define time to live
  -U                 print user-to-user latency
  -v                 verbose output
  -V                 print version and exit
  -w <deadline>      reply wait <deadline> in seconds
  -W <timeout>       time to wait for response

IPv4 options:
  -4                 use IPv4
  -b                 allow pinging broadcast
  -R                 record route
  -T <timestamp>     define timestamp, can be one of <tsonly|tsandaddr|tsprespec>

IPv6 options:
  -6                 use IPv6
  -F <flowlabel>     define flow label, default is random
  -N <nodeinfo opt>  use icmp6 node info query, try <help> as argument

For more details see ping(8).
onlylove@ubuntu:~$

二、参数说明

参数说明
< destination >域名或 IP 地址
-a
-A使用自适应 ping
-B粘性的源地址
-c < count >< count > 回复后停止
-D打印时间戳
-d使用SO_DEBUG套接字选项
-f泛滥
-h打印帮助并退出
-I < interface >接口名称或地址
-i < interval >发送每个数据包之间的秒数
-L抑制多播数据包的环回
-l < preload >在等待回复时发送预加载数量的包
-m < mark >标记出站的数据包
-M < pmtud opt >定义mtu发现,可以是<do|dont|want>
-n无 DNS 名称解析
-O报告未完成的答复
-p < pattern >填充字节的内容
-q安静的输出
-Q < tclass >使用服务质量< tclass >位
-s < size >< size > 用作要发送的数据字节数
-S < size >< size > 用作SO_SNDBUF套接字选项值
-t < ttl >定义生存时间
-U打印用户到用户的延迟
-v详细输出
-V打印版本和退出
-w < deadline >回复等待期限以秒为单位
-W < timeout >等待响应的时间
-4使用 IPv4
-b允许 ping 广播
-R记录路线
-T < timestamp >定义时间戳,可以是<tsonly|tsandaddr|tsprespec> 之一
-6使用 IPv6
-F < flowlabel >定义流标签,默认为随机
-N < nodeinfo opt >使用 icmp6 节点信息查询,尝试< help >作为参数

3、man ping

PING(8)                                                  iputils                                                 PING(8)

NAME
       ping - send ICMP ECHO_REQUEST to network hosts

              将 ICMP ECHO_REQUEST 发送到网络主机

SYNOPSIS
       ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark]
            [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s packetsize]
            [-S sndbuf] [-t ttl] [-T timestamp option] [hop...] {destination}

DESCRIPTION
       ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (“pings”) have an IP and ICMP header, followed by a struct timeval and then an arbitrary number of “pad” bytes used to fill out the packet.

       ping works with both IPv4 and IPv6. Using only one of them explicitly can be enforced by specifying -4 or -6.

       ping can also send IPv6 Node Information Queries (RFC4620). Intermediate hops may not be allowed, because IPv6 source routing was deprecated (RFC5095).

       ping 使用 ICMP 协议的强制ECHO_REQUEST数据报从主机或网关引发 ICMP ECHO_RESPONSE。ECHO_REQUEST数据报("pings")具有IP和ICMP标头,后跟一个结构时间段,然后是用于填充数据包的任意数量的"pad"字节。

       ping 适用于 IPv4 和 IPv6。通过指定 -4 或 -6,可以强制仅显式使用其中一个。

       ping 还可以发送 IPv6 节点信息查询 (RFC4620)。可能不允许使用中间跃点,因为 IPv6 源路由已弃用 (RFC5095)。

OPTIONS
       -4
           Use IPv4 only.

           仅使用 IPv4。

       -6
           Use IPv6 only.

           仅使用 IPv6。

       -a
           Audible ping.

           可听见的 ping。

       -A
           Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probe is present in the network. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially equivalent to flood mode.

           自适应 ping。数据包间间隔适应往返时间,因此网络中实际上不会存在一个(或更多,如果设置了预加载)未应答的探测器。对于非超级用户,最小间隔为 200 毫秒。在 rtt 较低的网络上,此模式实质上等效于泛洪模式。

       -b
           Allow pinging a broadcast address.

           允许 ping 广播地址。

       -B
           Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.

           不允许 ping 更改探测器的源地址。该地址绑定到 ping 启动时选定的地址。

       -c count
           Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.

           发送计数ECHO_REQUEST数据包后停止。使用截止时间选项,ping 将等待数据包ECHO_REPLY计数,直到超时过期。

       -d
           Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.

           在正在使用的套接字上设置SO_DEBUG选项。从本质上讲,Linux 内核不使用此套接字选项。

       -D
           Print timestamp (unix time + microseconds as in gettimeofday) before each line.

           在每行之前打印时间戳(unix时间+微秒,如gettimeofday)。

       -f
           Flood ping. For every ECHO_REQUEST sent a period “.” is printed, while for ever ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.

           泛洪 ping。对于发送的每个ECHO_REQUEST,都会打印句点".",而永远ECHO_REPLY收到一个空格。这样可以快速显示丢弃的数据包数。如果未给出间隔,则将间隔设置为零,并输出与数据包返回的速度一样快或每秒一百次,以更多者为准。只有超级用户可以使用此选项,间隔为零。

       -F flow label
           IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.

           仅限 IPv6。在回显请求数据包上分配和设置 20 位流标签(十六进制)。如果值为零,则内核分配随机流标签。

       -h
           Show help.

           显示帮助。

       -i interval
           Wait interval seconds between sending each packet. The default is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less than 0.2 seconds.

           发送每个数据包之间的等待间隔秒。默认设置是在每个数据包之间正常等待一秒钟,或者在泛洪模式下不等待。只有超级用户才能将间隔设置为小于 0.2 秒的值。

       -I interface
           interface is either an address, or an interface name. If interface is an address, it sets source address to specified interface address. If interface in an interface name, it sets source interface to specified interface. NOTE: For IPv6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) can be used but it is no longer required.

           接口可以是地址,也可以是接口名称。如果接口是地址,则将源地址设置为指定的接口地址。如果接口名称为接口,则将源接口设置为指定的接口。注意:对于 IPv6,在对链路本地作用域地址执行 ping 操作时,可以使用链路规范(通过目标中的"%"表示法或通过此选项),但不再需要。

       -l preload
           If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.

           如果指定了预加载,则 ping 将发送大量不等待回复的数据包。只有超级用户可以选择预加载超过 3。

       -L
           Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.

           抑制多播数据包的环回。仅当 ping 目标是多播地址时,此标志才适用。

       -m mark
           use mark to tag the packets going out. This is useful for variety of reasons within the kernel such as using policy routing to select specific outbound processing.

           使用标记标记传出的数据包。这对于内核中的各种原因非常有用,例如使用策略路由来选择特定的出站处理。

       -M pmtudisc_opt
           Select Path MTU Discovery strategy.  pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).

           选择"路径 MTU 发现策略"。pmtudisc_option可以是执行(禁止碎片,甚至是本地),想要(执行 PMTU 发现,当数据包大小较大时在本地进行碎片),也可以不执行(不要设置 DF 标志)。

       -N nodeinfo_option
           IPv6 only. Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required.

           仅限 IPv6。发送 ICMPv6 节点信息查询 (RFC4620),而不是回显请求。需要CAP_NET_RAW能力。

           help
               Show help for NI support.

               显示 有关 NI 支持 的帮助。

           name
               Queries for Node Names.

               节点名称查询。

           ipv6
               Queries for IPv6 Addresses. There are several IPv6 specific flags.

               查询 IPv6 地址。有几个特定于 IPv6 的标志。

               ipv6-global
                   Request IPv6 global-scope addresses.

                   请求 IPv6 全局范围地址。

               ipv6-sitelocal
                   Request IPv6 site-local addresses.

                   请求 IPv6 站点本地地址。

               ipv6-linklocal
                   Request IPv6 link-local addresses.

                   请求 IPv6 链路本地地址。

               ipv6-all
                   Request IPv6 addresses on other interfaces.

                   在其他接口上请求 IPv6 地址。

           ipv4
               Queries for IPv4 Addresses. There is one IPv4 specific flag.

               查询 IPv4 地址。有一个特定于 IPv4 的标志。

               ipv4-all
                   Request IPv4 addresses on other interfaces.

                   在其他接口上请求 IPv4 地址。

           subject-ipv6=ipv6addr
               IPv6 subject address.

               IPv6地址。

           subject-ipv4=ipv4addr
               IPv4 subject address.

               IPv4地址。

           subject-name=nodename
               Subject name. If it contains more than one dot, fully-qualified domain name is assumed.

               使用者名称。如果它包含多个点,则假定为完全限定的域名。

           subject-fqdn=nodename
               Subject name. Fully-qualified domain name is always assumed.

               使用者名称。始终假定使用完全限定的域名。

       -n
           Numeric output only. No attempt will be made to lookup symbolic names for host addresses.

           仅限数字输出。不会尝试查找主机地址的符号名称。

       -O
           Report outstanding ICMP ECHO reply before sending next packet. This is useful together with the timestamp -D to log output to a diagnostic file and search for missing answers.

           在发送下一个数据包之前报告未完成的 ICMP ECHO 回复。这与时间戳 -D 一起非常有用,可以将输出记录到诊断文件并搜索缺少的答案。

       -p pattern
           You may specify up to 16 “pad” bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet to be filled with all ones.

           您最多可以指定 16 个"pad"字节来填写您发送的数据包。这对于诊断网络中与数据相关的问题非常有用。例如,-p ff将导致发送的报文全部为1。

       -q
           Quiet output. Nothing is displayed except the summary lines at startup time and when finished.

           静音输出。除了启动时和完成时的摘要行之外,不显示任何内容。

       -Q tos
           Set Quality of Service -related bits in ICMP datagrams.  tos can be decimal (ping only) or hex number.

           In RFC2474, these fields are interpreted as 8-bit Differentiated Services (DS), consisting of: bits 0-1 (2 lowest bits) of separate data, and bits 2-7 (highest 6 bits) of Differentiated Services Codepoint (DSCP). In RFC2481 and RFC3168, bits 0-1 are used for ECN.

           Historically (RFC1349, obsoleted by RFC2474), these were interpreted as: bit 0 (lowest bit) for reserved (currently being redefined as congestion control), 1-4 for Type of Service and bits 5-7 (highest bits) for Precedence.

           在 ICMP 数据报中设置与服务质量相关的位。 tos 可以是十进制(仅限 ping)或十六进制数。

           在 RFC2474 中,这些字段被解释为 8 位差分服务 (DS),由以下单独数据的位 0-1(2 个最低位)和差分服务代码点 (DSCP) 的位 2-7(最高 6 位)组成。在 RFC2481 和 RFC3168 中,位 0-1 用于 ECN。

           从历史上看(RFC1349,已被 RFC2474 淘汰),这些被解释为:位 0(最低位)表示保留(当前被重新定义为拥塞控制),1-4 表示服务类型,位 5-7(最高位)表示优先。

       -r
           Bypass the normal routing tables and send directly to a host on an attached interface. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it provided the option -I is also used.

           绕过普通路由表,直接发送到连接的接口上的主机。如果主机不在直连网络上,则返回错误。此选项可用于通过没有路由的接口 ping 本地主机,前提是也使用选项 -I。

       -R
           ping only. Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option.

           仅 ping。记录路线。在ECHO_REQUEST数据包中包括RECORD_ROUTE选项,并在返回的数据包上显示路由缓冲区。请注意,IP 标头仅足够容纳九个此类路由。许多主机忽略或放弃此选项。

       -s packetsize
           Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.

           指定要发送的数据字节数。默认值为 56,当与 8 个字节的 ICMP 标头数据组合时,将转换为 64 个 ICMP 数据字节。

       -S sndbuf
           Set socket sndbuf. If not specified, it is selected to buffer not more than one packet.

           设置套接字 sndbuf。如果未指定,则选择它来缓冲不超过一个数据包。

       -t ttl
           ping only. Set the IP Time to Live.

           仅 ping。将 IP 时间设置为生存。

       -T timestamp option
           Set special IP timestamp options.  timestamp option may be either tsonly (only timestamps), tsandaddr (timestamps and addresses) or tsprespec host1 [host2 [host3 [host4]]] (timestamp prespecified hops).

           设置特殊的 IP 时间戳选项。时间戳选项可以是 tsonly(仅时间戳)、tsandaddr(时间戳和地址)或 tsprespec host1 [host2 [host3 [host4]]](时间戳预先指定的跃点)。

       -U
           Print full user-to-user latency (the old behaviour). Normally ping prints network round trip time, which can be different f.e. due to DNS failures.

           打印完整的用户到用户延迟(旧行为)。通常,ping 打印网络往返时间,由于 DNS 故障,这些时间可能会有所不同。

       -v
           Verbose output.

           详细输出。

       -V
           Show version and exit.

           显示版本并退出。

       -w deadline
           Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered or for some error notification from network.

           指定 ping 退出前的超时(以秒为单位),无论已发送或接收多少数据包。在这种情况下,ping 不会在发送计数数据包后停止,它会等待截止时间到期或等待计数探测器得到应答或来自网络的某些错误通知。

       -W timeout
           Time to wait for a response, in seconds. The option affects only timeout in absence of any responses, otherwise ping waits for two RTTs.

           等待响应的时间,以秒为单位。该选项仅在没有任何响应的情况下影响超时,否则 ping 将等待两个 RTT。

       When using ping for fault isolation, it should first be run on the local host, to verify that the local network interface is up and running. Then, hosts and gateways further and further away should be “pinged”. Round-trip times and packet loss statistics are computed. If duplicate packets are received, they are not included in the packet loss calculation, although the round trip time of these packets is used in calculating the minimum/average/maximum/mdev round-trip time numbers.

       使用 ping 进行故障隔离时,应首先在本地主机上运行,以验证本地网络接口是否已启动并正在运行。然后,应"ping"越来越远的主机和网关。计算往返时间和数据包丢失统计信息。如果收到重复的数据包,则它们不包括在数据包丢失计算中,尽管在计算最小/平均/最大/mdev 往返时间数时使用了这些数据包的往返时间。

       Population standard deviation (mdev), essentially an average of how far each ping RTT is from the mean RTT. The higher mdev is, the more variable the RTT is (over time). With a high RTT variability, you will have speed issues with bulk transfers (they will take longer than is strictly speaking necessary, as the variability will eventually cause the sender to wait for ACKs) and you will have middling to poor VoIP quality.

       总体标准差 (mdev),本质上是每个 ping RTT 与平均 RTT 相距多远的平均值。由于RTT可变性很高,您将遇到批量传输的速度问题(严格来说,它们花费的时间将超过严格要求的时间,因为可变性最终将导致发送者等待ACK),并且您的VoIP质量将中等到较差。

       When the specified number of packets have been sent (and received) or if the program is terminated with a SIGINT, a brief summary is displayed. Shorter current statistics can be obtained without termination of process with signal SIGQUIT.

       当发送(和接收)指定数量的数据包时,或者如果程序以 SIGINT 终止,则会显示一个简短的摘要。无需终止信号 SIGQUIT 的过程即可获得更短的电流统计。

       If ping does not receive any reply packets at all it will exit with code 1. If a packet count and deadline are both specified, and fewer than count packets are received by the time the deadline has arrived, it will also exit with code 1. On other error it exits with code 2. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is alive or not.

       如果 ping 根本没有收到任何回复数据包,它将以代码 1 退出。如果同时指定了数据包计数和截止时间,并且在截止时间到达时收到的数据包少于计数,则它还将以代码 1 退出。在其他错误中,它以代码2退出。否则,它将以代码 0 退出。这样就可以使用退出代码来查看主机是否处于活动状态。

       This program is intended for use in network testing, measurement and management. Because of the load it can impose on the network, it is unwise to use ping during normal operations or from automated scripts.

       该程序旨在用于网络测试、测量和管理。由于它可以对网络施加负载,因此在正常操作期间或从自动化脚本中使用ping是不明智的。

ICMP PACKET DETAILS ICMP 数据包详细信息
       An IP header without options is 20 bytes. An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth of ICMP header followed by an arbitrary amount of data. When a packetsize is given, this indicated the size of this extra piece of data (the default is 56). Thus the amount of data received inside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes more than the requested data space (the ICMP header).

       If the data space is at least of size of struct timeval ping uses the beginning bytes of this space to include a timestamp which it uses in the computation of round trip times. If the data space is shorter, no round trip times are given.

       如果数据空间至少是结构 timeval 的大小,则 ping 将使用此空间的起始字节来包含它在计算往返时间时使用的时间戳。如果数据空间较短,则不给出往返时间。

DUPLICATE AND DAMAGED PACKETS 重复和损坏的数据包
       ping will report duplicate and damaged packets. Duplicate packets should never occur, and seem to be caused by inappropriate link-level retransmissions. Duplicates may occur in many situations and are rarely (if ever) a good sign, although the presence of low levels of duplicates may not always be cause for alarm.

       ping 将报告重复和损坏的数据包。重复的数据包不应该发生,并且似乎是由不适当的链路级重新传输引起的。重复项在许多情况下都可能发生,很少(如果有的话)是一个好兆头,尽管低水平重复项的存在可能并不总是引起警报。

       Damaged packets are obviously serious cause for alarm and often indicate broken hardware somewhere in the ping packet's path (in the network or in the hosts).

       损坏的数据包显然是引起警报的严重原因,并且通常表示ping数据包路径(在网络或主机中)中的某个位置的硬件损坏。

TRYING DIFFERENT DATA PATTERNS 尝试不同的数据模式
       The (inter)network layer should never treat packets differently depending on the data contained in the data portion. Unfortunately, data-dependent problems have been known to sneak into networks and remain undetected for long periods of time. In many cases the particular pattern that will have problems is something that doesn't have sufficient “transitions”, such as all ones or all zeros, or a pattern right at the edge, such as almost all zeros. It isn't necessarily enough to specify a data pattern of all zeros (for example) on the command line because the pattern that is of interest is at the data link level, and the relationship between what you type and what the controllers transmit can be complicated.

       (内部)网络层绝不应根据数据部分中包含的数据以不同的方式处理数据包。不幸的是,众所周知,依赖于数据的问题会潜入网络,并且在很长一段时间内都不会被发现。在许多情况下,有问题的特定模式是没有足够的"转换"的东西,例如所有1或所有零,或者位于边缘的模式,例如几乎所有零。在命令行上指定所有零的数据模式(例如)并不一定足够,因为感兴趣的模式位于数据链路级别,并且您键入的内容与控制器传输的内容之间的关系可能很复杂。

       This means that if you have a data-dependent problem you will probably have to do a lot of testing to find it. If you are lucky, you may manage to find a file that either can't be sent across your network or that takes much longer to transfer than other similar length files. You can then examine this file for repeated patterns that you can test using the -p option of ping.

       这意味着,如果您遇到与数据相关的问题,则可能需要进行大量测试才能找到它。如果幸运的话,您可能会设法找到一个无法通过网络发送的文件,或者比其他类似长度的文件需要更长的时间来传输。然后,您可以检查此文件中是否有重复的模式,您可以使用 ping 的 -p 选项进行测试。

TTL DETAILS TTL 详细信息
       The TTL value of an IP packet represents the maximum number of IP routers that the packet can go through before being thrown away. In current practice you can expect each router in the Internet to decrement the TTL field by exactly one.

       IP 数据包的 TTL 值表示数据包在被丢弃之前可以经过的最大 IP 路由器数。在当前实践中,您可以期望 Internet 中的每个路由器将 TTL 字段正好减少一个。

       The TCP/IP specification states that the TTL field for TCP packets should be set to 60, but many systems use smaller values (4.3 BSD uses 30, 4.2 used 15).

       TCP/IP 规范规定 TCP 数据包的 TTL 字段应设置为 60,但许多系统使用较小的值(4.3 BSD 使用 30,4.2 使用 15)。

       The maximum possible value of this field is 255, and most Unix systems set the TTL field of ICMP ECHO_REQUEST packets to 255. This is why you will find you can “ping” some hosts, but not reach them with telnet(1) or ftp(1).

       此字段的最大可能值为 255,大多数 Unix 系统将 ICMP ECHO_REQUEST 数据包的 TTL 字段设置为 255。这就是为什么你会发现你可以"ping"一些主机,但不能用telnet(1)或ftp(1)到达它们。

       In normal operation ping prints the TTL value from the packet it receives. When a remote system receives a ping packet, it can do one of three things with the TTL field in its response:

       在正常操作中,ping 会从它收到的数据包中打印 TTL 值。当远程系统收到 ping 数据包时,它可以对其响应中的 TTL 字段执行以下三项操作之一:

           • Not change it; this is what Berkeley Unix systems did before the 4.3BSD Tahoe release. In this case the TTL value in the received packet will be 255 minus the number of routers in the round-trip path.

           不改变它;这是Berkeley Unix系统在4.3BSD Tahoe发布之前所做的。在这种情况下,接收的数据包中的 TTL 值将为 255 减去往返路径中的路由器数。

           • Set it to 255; this is what current Berkeley Unix systems do. In this case the TTL value in the received packet will be 255 minus the number of routers in the path from the remote system to the pinging host.

           将其设置为255;这就是当前的伯克利Unix系统所做的。在这种情况下,接收的数据包中的 TTL 值将为 255 减去从远程系统到 ping 主机的路径中的路由器数。

           • Set it to some other value. Some machines use the same value for ICMP packets that they use for TCP packets, for example either 30 or 60. Others may use completely wild values.

           将其设置为其他值。某些计算机对 ICMP 数据包使用的值与它们用于 TCP 数据包的值相同,例如 30 或 60。其他人可能使用完全狂野的值。

BUGS
           • Many Hosts and Gateways ignore the RECORD_ROUTE option.

           许多主机和网关会忽略RECORD_ROUTE选项。

           • The maximum IP header length is too small for options like RECORD_ROUTE to be completely useful. There's not much that can be done about this, however.

           最大 IP 标头长度太小,RECORD_ROUTE等选项无法完全使用。然而,对此无能为力。

           • Flood pinging is not recommended in general, and flood pinging the broadcast address should only be done under very controlled conditions.

           通常不建议使用泛洪 ping,并且只能在非常受控的条件下对广播地址进行泛洪 ping。

SEE ALSO
       ip(8), ss(8).

HISTORY
       The ping command appeared in 4.3BSD.

       The version described here is its descendant specific to Linux.

       As of version s20150815, the ping6 binary doesn't exist anymore. It has been merged into ping. Creating a symlink
       named ping6 pointing to ping will result in the same funcionality as before.

SECURITY
       ping requires CAP_NET_RAW capability to be executed 1) if the program is used for non-echo queries (See -N
       option), or 2) if kernel does not support non-raw ICMP sockets, or 3) if the user is not allowed to create an
       ICMP echo socket. The program may be used as set-uid root.

AVAILABILITY
       ping is part of iputils package.

iputils s20190709                                                                                                PING(8)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值