• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



ping Sends ICMP ECHO_REQUEST packets to network hosts.
ping [-DdfLnqRrv] [-c <count>] [-I <ifaddr>] [-i <wait>] [-l <preload>]
[-p <pattern>] [-s <packetsize>] [-T <tos>] [-t <ttl>] [-w <maxwait>]

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.
-D Sets the Don't Fragment bit.
-d Sets the SO_DEBUG option on the socket being used.
-f Flood ping. Outputs packets as fast as they come or one hundred times per second, whichever is more. Only root may use this option. This option can be very hard on a network and should be used with caution.
-L Disables the loopback so that the transmitting host does not see the ICMP requests. This option is for multicast pings.
-n Displays numeric output only. Does not make any attempt to lookup symbolic names for host addresses.
-q Enables quiet output. Displays only the summary lines at startup time and when finished.
-R Includes RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. The IP header is large enough for only nine such routes. Many hosts ignore or discard this option.
-r Bypasses the normal routing tables and sends directly to a host on the attached network. 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.
-v Enables verbose output. Lists ICMP packets received other than ECHO_RESPONSE packets.
-c <count> Stops after sending and receiving <count> ECHO_RESPONSE packets.
-I <ifaddr> Specifies the interface to transmit from on machines with more than one interface. For unicast and multicast pings.
-i <wait> Sets the interval between sending each packet to <wait> seconds. Default is to wait one second. This option is incompatible with the -f option.
-l <preload> Sends <preload> number of packets as fast as possible before falling into its normal mode of behavior. Only root may set a preload value.
-p <pattern> Up to 16 pad bytes can be specified to fill out a packet that is sent. This is useful for diagnosing data-dependent problems in a network. For example, -p ff causes the sent packet to be filled with all 1s.
-s <packetsize> Specifies the number of data bytes to be sent. The default is 56, which translates to 64 ICMP data bytes when combined with the 8 bytes of ICMP header data. If -D or -T is specified, or -t for a unicast destination, a raw socket is used and the 8 bytes of header are included in <packetsize>.
-T <tos> Uses the specified type of service.
-t <ttl> Uses the specified time-to-live.
-w <maxwait> Sets the number of seconds to wait for a response to a packet before transmitting the next one to <maxwait>. Default is 10.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint