What switches can be used with PING?

John Savill

March 31, 1999

2 Min Read
ITPro Today logo in a gray background | ITPro Today

A. PING is used to test TCP/IP connectivity with another host andgives information about the length of time test data takes to be sent to thehost and a reply received.

Its most basic use is as follows:

C:>ping

Pinging 160.82.52.11 with 32 bytes of data:

Reply from 160.82.52.11: bytes=32 time=10ms TTL=252
Reply from 160.82.52.11: bytes=32 time<10ms TTL=252
Reply from 160.82.52.11: bytes=32 time<10ms TTL=252
Reply from 160.82.52.11: bytes=32 time<10ms TTL=252

From the above you can see it send 32 bytes to host 160.82.52.11 and eachtime a reply was received in 10ms or less, this shows a good connection.

PING does have a number of option parameters to accomplish differentobjectives.

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-scount] [-k host-list [-w timeout] destination-list

-t

Ping the specifed host until interrupted.

-a

Resolve addresses to hostnames.

-n count

Number of echo requests to send.

-l size

Send buffer size.

-f

Set Don't Fragment flag in packet.

-i TTL

Time To Live.

-v TOS

Type Of Service.

-r count

Record route for count hops.

-s count

Timestamp for count hops.

-j host-list

Loose source route along host-list.

-k host-list

Strict source route along host-list.

-w timeout

Timeout in milliseconds to wait for each reply.

In Windows 2000 you can press Ctrl-Break when running the -t option for alist of statisitics. Press Ctrl-C to actually stop the ping.

It can be useful to have a small batch file ping various hosts and terminalservers at regular intervals to ensure all are still present (although thereare commercial software packages that do this). A simple command like:

C:>ping -f -n 1 -l 1 148.32.43.23

Pinging 148.32.43.23 with 1 bytes of data:

Reply from 148.32.43.23: bytes=1 time<10ms TTL=128

pings a host once with one byte of data.

You should be aware that PING works by sending ICMP echo packets and some routers etc may filterthese out meaning a PING will not work.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like