Next: , Up: ping: Packets to network hosts   [Contents][Index]


7.1 Command line options

Selection of packet type is handled by these first options:

--address

Send ICMP_ADDRESS packets, thus requesting the address netmask in use by the targetted host.

--echo

Send ICMP_ECHO requests. This is the default action.

--mask

Identical to --address.

--timestamp

Send ICMP_TIMESTAMP packets, thereby requesting a timed response from the targetted host.

In successful cases three time values are returned. All are expected to state the number of milliseconds since midnight UTC. The first of these, ‘icmp_otime’, contains the original time of sending the request. Then comes ‘icmp_rtime’, the time of reception by the target, and finally, ‘icmp_ttime’, the time of transmitting an answer back to the originator.

-t type
--type=type

Send type packets. Accepted values are ‘address’, ‘echo’, ‘mask’, and ‘timestamp’.

The following options are available for all packet types:

-c n
--count=n

Stop after sending and receiving answers to a total of n packets.

-d
--debug

Set the SO_DEBUG option on the socket being used.

-i n
--interval=n

Wait n seconds until sending next packet. The default is to wait for one second between packets. This option is incompatible with the option -f.

-n
--numeric

Numeric output only. No attempt will be made to resolve symbolic names for host addresses.

-r
--ignore-routing

Bypass the normal routing tables and send directly to a host on an 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 (e.g., after the interface was dropped by routed).

-T num
--tos=num

Set type-of-service, TOS field, to num on transmitted packets.

--ttl=n

Set the specified number n as value of time-to-live when transmitting packets. Acceptable values are 1 to 255, inclusive.

-v
--verbose

Produce more verbose output, giving more statistics.

-w n
--timeout=n

Stop after n seconds.

-W n
--linger=n

Maximum number of seconds n to wait for a response.

Finally, these last options are relevant only for sending echo requests, allowing many variations in order to detect various peculiarities of the targeted host, or the intermediary routers for that matter.

-f
--flood

Flood ping. Outputs packets as fast as they come back or one hundred times per second, whichever is more. For every ECHO_REQUEST packet sent, a period ‘.’ is printed, while for every ECHO_REPLY received in reply, a backspace is printed. This provides a rapid display of how many packets are being dropped. Only the super-user may use this option. This can be very hard on a network and should be used with caution.

--ip-timestamp=flag

Include IP option Timestamp in transmitted packets. The value flag is either ‘tsonly’, which only records up to nine time stamps, or ‘tsaddr’, which records IP addresses as well as time stamps, but for at most four hosts.

-l n
--preload=n

If n is specified, ping sends that many packets as fast as possible before falling into its normal mode of operation.

-p pat
--pattern=pat

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.

-q
--quiet

Do not print timing for each transmitted packet.

-R
--route

Record route. Includes the RECORD_ROUTE field 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.

-s n
--size=n

Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes, taking the 8 bytes of ICMP header data into account.


Next: Using ping for network fault isolation, Up: ping: Packets to network hosts   [Contents][Index]