Cisco Colour Banners

It’s True… It's not quite a April Fool's joke but yes you can actually have colour banners on Cisco IOS devices.

Banner login: (Before Login)

Cisco banner exec color

Banner exec: (After Login)

Cisco banner login color

I stumbled across this as I was sent a link to an ASCI/telnet movie in which it was in colour and wondered if such could be done with the banners.

I guess it’s one way to spruce up the Cisco command line interface from the traditional Black n White. I had some fun with my colleagues at work with a few WTF moments as they logged into an updated device.  (“Cough” New IOS version lol)

After doing some research, some people where actually using the banners to colour code their routers, for instance using Red text for Core, Blue for Distribution and Green for access devices so you instantly know which layer of devices you are on.

From the testing I have performed this will virtually work on any type of console access into the Cisco IOS device, whether it be SSH, Serial Console or Telnet (hopefully you are not using Telnet in production network for security reasons). 

I haven’t come across a client that does not support it yet.

Anyway here is a guide on how to do it:


Escape Characters:

The hardest part creating the config is trying to enter the escape character into the configuration.
Not all terminal clients support the commend so if nothing works, don't sweet, try a different console client.
On most good clients you can enter in the esc character by pressing the CTRL + V buttons together, release, then press  the ESC key.  A ^[ should show up in the client to indicate this has been successful.  You will now know why CTRL + V never works when trying to directly paste in config into the terminal client. Some clients might have a shortcut via the menu to ESC in more easily.

Colour Change codes:

After the ESC character is the code the changes the colour.
In this case the code for blue is [34;1m, 34 is the colour code and 1 means bright.
The colour code is the second digit. In this case it's number 4. See the table below.
If you want green the code will need to be [32;1m where 2 is the code for green
The 1m part of the code is required to set the text to bright otherwise everything will stay grey.
The Colour Table:
Configuration Step by Step:
  1. Enter into config mode by entering in config t and hit enter.

  2. Enter in banner motd ^ and hit enter. ^ is the delimiting character to escape out of the banner config which will be one of the last steps.

  3. Enter the esc character by pressing the CTRL + V buttons together, release, then press  the ESC key.  A ^[ should show up in the client. Do not press enter yet.

  4. Next enter in [34;1m which is the commands for the colour change, in this case is colour Blue. Do not press enter yet, there should be double [[ which is normal.

  5. Next type in some text of your choice Some Sample Text, This text will turn blue and press enter.

  6. Enter in ^ and this will quit out of the banner config.

  7. Type in Exit then enter to exit out of config mode.

  8. To see the changes show run | begin banner motd. The text should now be blue.

The complete code will look something similar to below:

Cisco#config t
Enter configuration commands, one per line. End with CNTL/Z.
Cisco(config)#banner motd ^
Enter TEXT message. End with the character '^'
^[[32;1m This text will turn green
Cisco#sh run | beg banner motd
banner motd ^C
 This text will turn green
Note: Any text after the banner will now show as green. When doing a show run you will not be able to see the entered ESC or colour config. The only way to see the Full config with the ESC characters etc is to dump the config to a TFTP server.
TFTP Method:
For the complete source code for the banner in the images above click here.
Please Right click on the link & select Save As. Dont copy out from browser otherwise the ESC characters will be lost.
All you need to do is edit the file in notepad for your needs. TFTP the file to the running config (copy tftp: running-config) on the Cisco device.
Note: You may notice in the file that the boarders of the banner have been pushed to the right side due to extra config. As soon as this is entered into the configuration and a show run is preformed this will disappear and the correct borders will show.
This method will only overwrite the banner config and not the rest of the config.
Do a sh run | beg banner to view the updated config or re-logon to the device. All going well you should see the colourful result.