The ping command sends an ICMP echo request to a target name or IP address, helping you to verify IP-level connectivity.
ping [-?] [-f] [-l size] [-n count] [-i TTL] [-v TOS] [-w timeout] address
-
-?
- Prints a list of the available command-line options. -f
- Sends the Do not Fragment flag, specifying that hosts along the route should not fragment the packets. -l
- Sends a buffer that is the length specified by size. size
- Specifies the size of the buffer. -n
- Sends the number of packets specified by count. count
- Specifies the number of packets to send. -i
- Sets the Time to Live field to the value specified by TTL. TTL
- Specifies a value for the Time to Live field. -v
- Sets the Type of Service field to the value specified by TOS. TOS
- Specifies a value for the Type of Service field. -w
- Sets the time-out interval to the value specified by timeout. timeout
- Specifies the length of the time-out interval, in milliseconds. address
- Specifies the address of the remote computer to which you want to send the ping request.
You should first try pinging the IP address of the target host to see if it will respond, because this is the simplest test. If that succeeds, then try pinging the name. The ping command uses Windows Sockets-style name resolution to resolve the name to an address; therefore, if pinging by address succeeds but pinging by name fails, the problem lies in name resolution, not network connectivity.
See Path Maximum Transmission Unit (PMTU) Discovery for details on using ping to manually determine the PMTU between two computers.
The following example illustrates how to send two pings, each 1450 bytes in size, to address 10.99.99.2:
C:/>ping -n 2 -l 1450 10.99.99.2 Pinging 10.99.99.2 with 1450 bytes of data: Reply from 10.99.99.2: bytes=1450 time<10ms TTL=32 Reply from 10.99.99.2: bytes=1450 time<10ms TTL=32
By default, ping waits 1 second for each response to be returned before timing out. If the remote system being pinged is across a high-delay link such as a satellite link, responses could take longer to be returned. The -w (wait) switch can be used to specify a longer time-out. Computers using Internet Protocol Security (IPSec) may require several seconds to set up a security association before they will respond to a ping.