How to Use Ping
What is Ping? Well, Ping is a legacy program that will send a short message to a network client, and then wait for a reply back from the client. It uses the old ICMP protocol. Will will help you solve your network problems by verifying connectivity across the network. Ping is the key to your solution. Almost any network endpoint will reply back to a ping, unless they have disabled it in the firewall. In Windows 7/10 parlance, the so called network discovery feature in the firewall is used to enable or disable it. Many network administrators disable ping for security reasons, although it won’t matter, because real hard core hackers can find your endpoint regardless. For security hardening such as for HIPAA, we would recommend turning it off. See our checklist in the HIPAA section. Anybody who specializes in IT Consulting should know how to use ping by now.
Ping Command Syntax:
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target [/?]
Tip: See How To Read Command Syntax if you’re not sure how to interpret the ping command syntax above.
-t = Using this option will ping the target until you force it to stop using Ctrl-C.
-a = This ping command option will resolve, if possible, the hostname of an IP address target.
-n count = This option sets the number of ICMP Echo Request messages to send. If you execute the ping command without this option, four requests will be sent.
-l size = Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527. The ping command will send a 32 byte echo request if you don’t use the -l option.
-f = Use this ping command option to prevent ICMP Echo Requests from being fragmented by routers between you and the target. The -f option is most often used to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTL = This option sets the Time to Live (TTL) value, the maximum of which is 255.
-v TOS = This option allows you to set a Type of Service (TOS) value. Beginning in Windows 7, this option no longer functions but still exists for compatibility reasons.
-r count = Use this ping command option to specify the number of hops between the your computer and the target computer or device that you’d like to be recorded and displayed. The maximum value for count is 9 so use the tracert command instead if you’re interested in viewing all hops between two devices.
-s count = Use this option to report the time, in Internet Timestamp format, that each echo request is received and echo reply is sent. The maximum value for count is 4 meaning that only the first four hops can be time stamped.
-w timeout = Specifying a timeout value when executing the ping command adjusts the amount of time, in milliseconds, that ping waits for each reply. If you don’t use the -w option, the default timeout value is used which is 4000, or 4 seconds.
-R = This option tells the ping command to trace the round trip path.
-S srcaddr = Use this option to specify the source address.
-4 = This forces the ping command to use IPv4 only but is only necessary if target is a hostname and not an IP address.
-6 = This forces the ping command to use IPv6 only but as with the -4 option, is only necessary when pinging a hostname.
target = This is the destination you wish to ping, either an IP address or a hostname.
/? = Use the help switch with the ping command to show detailed help about the command’s several options.
Note: The -f, -v, -r, -s, -j, and -k options work when pinging IPv4 addresses only. The -R and -S options only work with IPv6.
Other less commonly used switches for the ping command exist including [-j host-list] and [-k host-list]. Execute ping /? from the Command Prompt for more information on these two options.