- 论坛徽章:
- 1
|
不清楚你要的东西,看看下面有没有吧!
ping Command
Purpose
Sends an echo request to a network host.
Syntax
ping [-d] [ -n ] [ -q ] [-r] [-v] [ -R ] [ -c Count ] [ -f | -i Wait ] [ -l Preload ] [ -p Pattern ] [ -s PacketSize ] [ -L ] [ - I a.b.c.d. ] [ -T ttl ] Host [ PacketSize [ Count ] ]
Description
The /usr/sbin/ping command sends an Internet Control Message Protocol (ICMP) ECHO_REQUEST to obtain an ICMP ECHO_RESPONSE from a host or gateway. The ping command is useful for:
Determining the status of the network and various foreign hosts.
Tracking and isolating hardware and software problems.
Testing, measuring, and managing networks.
If the host is operational and on the network, it responds to the echo. Each echo request contains an Internet Protocol (IP) and ICMP header, followed by a timeval structure, and enough bytes to fill out the packet. The default is to continuously send echo requests until an Interrupt is received (Ctrl-C).
The ping command sends one datagram per second and prints one line of output for every response received. The ping command calculates round-trip times and packet loss statistics, and displays a brief summary on completion. The ping command completes when the program times out or on receipt of a SIGINT signal. The Host parameter is either a valid host name or Internet address.
By default, the ping command will continue to send echo requests to the display until an Interrupt is received (Ctrl-C). The Interrupt key can be changed by using the stty command.
Because of the load that continuous echo requests can place on the system, repeated requests should be used primarily for problem isolation.
Flags
-c Count Specifies the number of echo requests, as indicated by the Count variable, to be sent (and received).
-d Starts socket-level debugging.
-f Specifies flood-ping option. The -f flag "floods" or outputs packets as fast as they come back or one hundred times per second, whichever is more. For every ECHO_REQUEST sent, a . (period) is printed, while for every ECHO_REPLY received, a backspace is printed. This provides a rapid display of how many packets are being dropped. Only the root user may use this option.
Note: This can be very hard on a network and should be used with caution. Flood pinging is only permitted by the root user. The -f flag is incompatible with the -i Wait flag.
-I a.b.c.d Specifies that the interface specified by a.b.c.d is to be used for multicasts. The -I flag is an uppercase i.
-i Wait Waits the number of seconds specified by the Wait variable between the sending of each packet. The default is to wait for one second between each packet. This option is incompatible with the -f flag.
-L Disables local loopback for multicast pings.
-l Preload Sends the number of packets specified by the Preload variable as fast as possible before falling into normal mode of behavior (one per second). The -l flag is a lowercase l.
-n Specifies numeric output only. No attempt is made to look up symbolic names for host addresses.
-p Pattern Specifies 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 fills the packet with all 1's.
-q Specifies quiet output. Nothing is displayed except the summary lines at startup time and when finished.
-r Bypasses the routing tables and sends directly to a host on an attached network. If the Host is not on a directly connected network, the ping command generates an error message. This option can be used to ping a local host through an interface that no longer has a route through it.
-R Specifies record route option. The -R flag includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets.
Note: The IP header is only large enough for nine such routes. Also, many hosts and gateways ignore this option.
-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.
-T ttl Specifies that the time-to-live for a multicast packet is ttl seconds.
-v Requests verbose output, which lists ICMP packets that are received in addition to echo responses.
Parameters
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. This parameter is included for compatibility with previous versions of the ping command.
Count Specifies the number of echo requests to be sent (and received). This parameter is included for compatibility with previous versions of the ping command. |
|