This article provides instructions on how to run the traceroute command on your switch through the CLI.
In a real-time scenario, a traceroute can be used if the user is having some connectivity problems and the user needs to find whether the packets are delivered to the destination or not. Traceroute can exactly point out where the packets are being dropped if such a problem exists.
Note: To learn how to activate traceroute configuration on your switch through the web-based utility, click here for instructions.
Traceroute can be used to troubleshoot a problem that has occurred across a network connection. When using the Command Line Interface (CLI) of the switch, traceroute discovers and displays the routes that the packets will take when traveling to their destination, allowing the administrator to measure the transit delay of the packets which are traversing through the network. It operates by sending an IP packet to the target host and back to the switch.
Traceroute uses three User Datagram Protocol (UDP) datagrams with Time to Live (TTL) values to operate. TTL is a mechanism that limits the lifespan of data in a network. Every time a packet is sent to a router, the TTL value decrements by one. Once the TTL value reaches 0, the router responds with an Internet Control Message Protocol (ICMP) Time Exceeded Message (TEM) which indicates that the datagram has expired.
At first, traceroute sends three UDP datagrams to the first router with TTL values of one. The first router responds with an ICMP TEM message which provides information for the traceroute feature. Next, traceroute sends three more UDP datagrams with TTL values of two. The second router along the route responds with an ICMP TEM message. This process continues until either of the following are encountered:
To run the traceroute operation on your switch through the CLI, follow these steps:
Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Note: In this example, the switch is accessed through Telnet.
Step 2. In the Privileged EXEC mode of the switch, run the traceroute operation by entering either of the following commands:
SG350X#traceroute ip {{ipv4-address | hostname}} [size packet_size] [ttl max-ttl] [count packet_count] [timeout time_out] [source ip-address]— Use this syntax to traceroute an IPv4 address.
SG350X#traceroute ipv6 {{ipv6-address | hostname}} [size packet_size] [ttl max-ttl] [count packet_count] [timeout time_out] [source ip-address]— Use this syntax to traceroute an IPv6 address.
The description of the parameters are as follows:
Note: In this example, traceroute ip software.cisco.com ttl 20 is used. Once the command is entered, the switch will automatically conduct the trace.
Step 3. (Optional) To abort the trace, press the escape button on your keyboard.
Note: In this example, the trace was aborted after three hops.
You should now have successfully run a traceroute operation through the CLI of your switch.
The following table describes the significant fields shown in the image above:
Field |
Description |
---|---|
1 to 14 |
Indicates the sequence or hop number of the router in the path to the destination. |
192.168.100.1 |
IP address of the router where the switch is connected. |
184.26.111.212 |
Internet IP address of the destination server software.cisco.com |
<190 ms <200 ms <200 ms |
The total operation time to retrieve data from the destination server shown in the last hop. |
The following table shows the characters that can appear in the traceroute command output:
Field |
Description |
---|---|
* |
The probe timed out. |
? |
Unknown packet type. |
A |
Administratively unreachable. Usually, this output indicates that an access list is blocking the traffic. |
F |
Fragmentation required and defragmentation is set. |
H |
Host unreachable. |
P |
Protocol unreachable. |
Q |
Source quench. |
R |
Fragment reassembly time exceeded. |
S |
Source route failed. |
U |
Port unreachable. |
Possible issues indicated by the traceroute hops:
There could be a connection issue with the destination host.
There could be a firewall configured on the destination host to block traceroute requests.
There could be an issue with the return path from the target.
You should now have understood the traceroute results shown on the CLI of your switch.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
12-Dec-2018 |
Initial Release |