IOS Break Sequence

The Problem:

There are 2 parts to this problem really:

1. You know how sometimes you want to just stop the router from doing its current task in the console, probably because you made a mistake or fat fingered the keyboard? Normally this includes things like ping, trace route or the dreaded DNS lookup (that moment you realize you forgot to put the no ip domain-lookup command on the router), well you’d press the break sequence.

By default Cisco sets the break sequence on all its devices to CTRL+SHIFT+6 and then X

Not sure about you, but I personally feel this takes to long and you need to be a bit of a wizard with your hands – which I am not!

2. The other issue is that if you are using a Cisco Terminal Server and are consoled on to a router, you press the break sequence and it throws you straight back to the Terminal Server – not at all what you wanted to do!

As an example (R1 is mapped to port 2001 for reverse telnet):

AccessServer#show run int lo 0
Building configuration...

Current configuration:
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
end

AccessServer#telnet 1.1.1.1 2001
Trying 1.1.1.1, 2001 ... Open

So now I am connected to R1’s console through reverse telnet and try pinging something that isn’t possible

R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
...

Pressing the break sequence now quits me back to the Access Server, and doesn’t just kill the ping session.

The Solution:

It would be soo much easier if we could say, just use a simple CTRL+C and Boom! the job on the console is cancelled.

Well you can, and its very simple to do!

Remotely access the router you want to put a different break sequence on – lets say R1 for example.

Enter in to Line Configuration mode for the console and change the escape character to 3.

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#line con 0
R1(config-line)#escape-character 3

Changing the configuration on the console is more relevant to Access Servers using reverse telnet as you are connected to the console of the device.

Repeat the same sequence for the VTY lines, if you telnet directly to devices from PuTTY or other network devices.

Now to kill a process such as ping, just press CTRL+C and it will kill it for you

R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
...
Success rate is 0 percent (0/3)

Boom – Job done!

Write the config to change it permanently.

If you want to change it back to the default, that is just as simple. Use the default escape-character command:

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#line con 0
R1(config-line)#default escape-character
R1(config-line)#

Make sure you write the configuration changes to make them permanent.

Print Friendly, PDF & Email