How to Stop Traceroute or Ping on a Cisco Device

Did you just start an extended ping or trace from the command line of a Cisco switch or router and are now staring at a wall of asterisks wondering when it will stop? You’re not alone. We’ve all been there.

The default behavior for most Cisco devices is to terminate after 30 hops or until it reaches the destination address, whichever is shortest. However, you can interrupt and escape this sequence.

The official solution, from Cisco’s documentation for an IOS, XE, and XR device, is to enter CTRL+SHIFT+6 (hold the Control Key, Shift Key, and number 6 key down together). This key combination can also be written as Ctrl/^ or ^^.

This key combination can be used to abort pings, traces, DNS lookups, and many other processes on most Catalyst, ISR, and ASR switches and routers.

If that combination does not work on its own, you can try the following:

*release the keys*
Press X

I have also had cases where I had to hold down CTRL+SHIFT and hit the 6 key repeatedly. In really odd circumstances, the number pad 6 didn’t work but the 6 key on the top row of the keyboard did.

Stopping Ping or Traceroute with a Non-US-ASCII Keyboard

What happens if you’re not using a US-ASCII keyboard or using a telnet program that can’t recognize control characters or ASCII code symbols?

There are two solutions. One is to re-map the escape character for the current terminal session. To do this, enter the exec-level command:

terminal escape-character char *yourcharacter*

The other solution is to re-map the escape character permanently for that specific networking device. To do this, enter the exec-level command:

escape-character char *yourcharacter*

So, for example:

terminal escape-character char 9

This will remap the escape character to the 9 number key for the terminal session you’re currently in, but not for future sessions, allowing you to stop your ping or traceroute once started.

Admittedly, these need to be set before you start the traceroute or ping. If you’re trying to quit and existing trace, you can restart your terminal session. Unfortunately, that means losing your command history.

Stopping Ping or Traceroute on a Cisco NX-OS Nexus Device

On Cisco Nexus switches you can escape the traceroute sequence by pressing CTRL+C.

How to Speed Up Traceroute on a Cisco Switch or Router

When you initiate a trace on a Cisco IOS device, it performs a DNS broadcast for each hop. You can temporarily disable this using the following command at an exec prompt:

no ip domain-lookup

What Do Asterisks Mean in a Traceroute?

In a trace that completes, hops with asterisks typically indicate that the device that was hit by your traceroute has been configured to not respond to ICMP/UDP traffic. If the trace dies after a hop with asterisks it typically means the packets were dropped.

Recommended for You: Solarwinds Network Performance Monitor (NPM)

Do you know the health of your networking equipment? Know when something goes down before a user reports problems? Know where your bandwidth is going or where you’re losing your packets?

Automate data collection and alerting of your networking infrastructure with Solarwinds NPM so you know exactly what is going on in your network and can sleep easy.

Unlike other tools, NPM is ready to out of the box with most common makes and models of networking equipment. No messing around with custom templates, xml files, or code to extract important information.

Chase Smith, CCNP

Chase Smith, CCNP is a Network Engineer III who has spent the last decade elbow deep in enterprise system administration and networking. He can usually be found trying to warm up behind the storage in the datacenter.

Leave a Reply

Your email address will not be published. Required fields are marked *