10.2.ping command
You can use it to check IP connectivity between two network devices.
Multiple platforms (for example, routers, switches, and hosts) support the ping command.
The ping command uses Internet Control Message Protocol (ICMP), which is a Layer 4 protocol.
The syntax of the ping command:
Parameters for the Windows ping Command
Parameter
Purpose
-t
This option repeatedly sends pings (ICMP echo messages) until you stop it by pressing Ctrl+C.
-n count
This option specifies the number of pings to send.
-f
This option sets the don’t fragment bit in a packet’s header. If the packet tries to cross a router that attempts to fragment the packet, the packet is dropped, and an ICMP error message is returned.
-i TTL
This option sets the TTL value in a packet’s header. The TTL is decremented for each router hop. A packet is discarded when its TTL value reaches 0.
-S srcaddr
If the PC from which you are issuing the ping command has more than one IP address, this option allows you to specify the source IP address from which the ICMP echo messages should be sent.
target_name
This option specifies the name or the IP address of the device to which you are sending ICMP echo messages.
Sample Output from the Windows ping Command
Example 1:
If you issue a ping command from your PC, your PC sends an ICMP echo message to the specified destination host. Assuming the destination host is reachable, the host responds with an ICMP echo reply message.
Example 2:
Other ICMP messages can be returned to your PC, from your PC’s default gateway, to indicate that a destination host is unreachable, that an ICMP echo timed out, or that a Time To Live (TTL) value (which is decremented by 1 at each router hop) has expired (decremented to a value of 0).
Last updated
Was this helpful?