The Break Character
For whatever historical reason (I used to know, but I’ve forgotten ) the break character for Cisco IOS command line is Ctrl-Shift-6 and X. Now, that is a pain to type and I often makes mistakes because it takes four fingers in coordinated fashion (lets face it, I’m not a world class athlete, and using four fingers is beyond my physical capability). So I have a habit of repeating it about five times …just to make sure.
Most importantly, when you are using a Cisco terminal server to access a router on a test bench (or study rack) and you hit the break sequence, the session snaps back to terminal server as if you had issued the command there. Annoying right ?
R0#sh run int fa1/0 Building configuration... Current configuration : 95 bytes ! interface FastEthernet1/0 ip address 198.18.1.2 255.255.255.0 duplex auto speed auto end R0#telnet 198.18.1.1 Trying 198.18.1.1 ... Open r1# r1# r1# r1# r1#
So now I have connected over to a neighboring router, and foolishly attempted to ping something that doesn’t exist:
r1#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: ...
Now I hit the break key because I’m impatient and
That right, I have shifted the console back to the first router.
My solution on my test bench has been to change the escape character on the routers (but not on the terminal server).
Works for Telnet/SSH too
A common practice when making routing changes is to telnet to the nearest router, then jump to to remote router and make the routing changes. This way, if the routing doesn’t work exactly right you still have a console session running.
This has the same problem. If you hit break to shut out a ping command, or interrupt a DNS lookup, your console will snap back to the original router.
Changing the Break / Escape Character
There are two ways to change the escape sequence / break character on Cisco IOS.
Change the break character for the current session
This sequence changes it only for current SSH/Telnet session that you are using. Changes are lost when you exit the session.
Router#terminal escape-character ? BREAK Cause escape on BREAK CHAR or <0-255> Escape character or its ASCII decimal equivalent DEFAULT Use default escape character NONE Disable escape entirely soft Set the soft escape character for this line Router#terminal escape-character 23 "^W" is the escape character Router#
See that? My personal choice is Ctrl-W because it’s easy to type and doesn’t conflict with much else in the ASCII characters
Change the break permanently
Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#lin Router(config)#line vty 0 4 Router(config-line)#escape-character ? BREAK Cause escape on BREAK CHAR or <0-255> Escape character or its ASCII decimal equivalent DEFAULT Use default escape character NONE Disable escape entirely soft Set the soft escape character for this line
Router(config-line)#escape-character 23 Router(config-line)#
Changing it back
For those people who will rush off and test this on a live router (oh yes, Elizabeth, they do exist):
Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#line vty 0 4 Router(config-line)#default escape-character Router(config-line)#^Z Router#sh run | beg line line con 0 stopbits 1 line aux 0 stopbits 1 line vty 0 4 login ! end Router#
Closing this out
Generally, I wouldn’t recommend making this a default, because other people will have to work on your network eventually and this is the sort of thing that can have unexpected problems. But the settings for the current session is a neat trick and can save a lot of time in complex networks.
CCIE Mendicants may choose to use this also, but you need to be consistent about putting into your configuration across all devices. Might be a bit tricky.
Hope it’s useful.