# Reachability Commands

Use the ping and traceroute commands to determine reachability of destinations in the network.

- Use the ping command to send an ICMP or ICMPv6 echo request packet. In the following example, the request packet is sent to IP address 192.35.42.1, with a packet count of 10 and a timeout value of 10 seconds:
  host1#ping 192.35.42.1 10 timeout 10
- Use the traceroute command to discover routes that router packets follow when traveling to their destination. In the following example, the trace destination IP address is 192.56.20.1, the maximum number of hops of the trace is 20, and the timeout value is 10 seconds:
  host1#traceroute 192.56.20.1 20 timeout 10

ping

- Use to send an ICMP or ICMPv6 echo request packet to the IP address that you specify.
- You can specify a VRF context.
- Use the source interface keywords to specify a source interface other than the one from which the probe originates.
- Use the source address keywords to specify a source IP address other than the one from which the probe originates.
- You can specify the following options:
  - packetCount—Number of packets to send to the destination IP address. If you specify a zero (0), echo requests packets are sent indefinitely.
  - data-pattern—Sets the type of bits contained in the packet to all ones, all zeros, a random mixture of ones and zeros, or a specific hexadecimal data pattern that can range from 0x0–0xFFFFFFFF. The default is all zeros.
  - data-size—Sets the number of bytes comprising the IP packet and reflected in the IP header in the range 0–64000; the default is 100 bytes.
  - extended header attributes—Set the following:
    - A value to be set in the type of service (ToS) byte, in the range 0–255, to support quality of service (QoS) offerings
    - Don’t-fragment bit to prevent IP from fragmenting the packet if it is too long for the MTU of a given link; if the nonfragmented packet cannot be delivered, it is discarded.
    - Strict-source or loose-source routing, including the IP address of the hops the packets must traverse. For loose-source-route, you specify some or all of the hops, but they do not have to be adjacent. For strict-source-route, you must specify every adjacent hop through which the packet must traverse.
    - The IP addresses to be recorded for a specified number of routers that the packets traverse.
    - The time that a packet traverses a router to be recorded for a specified number of routers.
    - An interface type and specifier of a destination address on the router that is connected for external loopback by means of a cable or plug that loops Tx to Rx. The command succeeds only if the specified interface is connected for external loopback and the encapsulation type is ATM, Frame Relay, HDLC, or PPP. The command does not work for Ethernet or VLAN encapsulations.
    - The traffic class value to match in the Traffic Class field of each packet (IPv6 only)
    - The flow label value to match in the Flow Label field of each packet (IPv6 only)
  - sweep-interval—Specifies the change in the size of subsequent ping packets while sweeping across a range of sizes. For example, you can configure the sweep interval to sweep across the range of packets from 100 bytes to 1000 bytes in increments equal to the sweep interval. By default the router increments packets by one byte; for example, it sends 100, 101, 102, 103, ... 1000. If the sweep interval is 5, the router sends 100, 105, 110, 115, ... 1000.
  - sweep-sizes—Enables you to vary the sizes of the echo packets being sent. This capability is useful for determining the minimum sizes of the MTUs configured on the nodes along the path to the destination address. Determining the minimum size reduces packet fragmentation, which contributes to performance problems. The default is not to sweep (all packets are the same size).
  - timeout—Sets the number of seconds to wait for an ICMP echo reply packet before the connection attempt times out.
  - ttl—Sets the time-to-live hop count in the range 1–255; the default is 32.
- The following characters can appear in the display after issuing the ping command:
  - !—Reply received
  - .—Timed out while waiting for a reply
  - ?—Unknown packet type
  - A—Address mask request message
  - a—Address mask reply message
  - D—Router discovery advertisement message
  - d—Router discovery request message
  - H—Host unreachable
  - I—Information request message
  - i—Information reply message
  - L—TTL expired message
  - M—Could not fragment, DF bit set
  - m—Parameter problem message
  - N—Network unreachable
  - P—Protocol unreachable
  - Q—Source quench
  - r—Redirect message
  - T—Timestamp request message
  - t —Timestamp reply message
  - U—Destination unreachable
- Example
  host1(config)#interface serial 5/2:1/1 host1(config-if)#ip address 172.16.1.1 255.255.255.0 host1(config-if)#exit host1#ping 172.16.1.1 extended interface serial 5/2:1/1
- There is no no version.
- See ping

traceroute

- Use to discover the routes that router packets follow when traveling to their destination.
- You can specify:
  - A VRF context
  - Destination IP or IPv6 address
  - Source interface for each of the transmitted packets
  - Source address for each of the transmitted packets
  - Maximum number of hops of the trace and a timeout value
  - Size of the IP packets (not the ICMP payload) in the range 0–64000 bytes sent with the traceroute command. Including a size might help locate any MTU problems that exist between your router and a particular device.
  - Extended IP header attributes, including the ToS byte (IP only), whether to set the DF bit for the transmitted packets (IP only), the traffic class (IPv6 only), and flow label (IPv6 only).
- You can also force transmission of the packets on a specified interface regardless of what the IP address lookup indicates.
- Example
  host1#traceroute 172.20.13.1 20 timeout 10
- There is no no version.
- See traceroute