Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

Implementing Banners

Problem

You want to implement a banner message to display a security warning.

Solution

The following commands configure various types of banners on a router:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#banner exec  # This is an exec banner #
Router1(config)#banner login # This is a login banner #
Router1(config)#banner motd  $ This is a motd banner  $
Router1(config)#end
Router1#

Notice that the router accept almost any delimiter character, as long as the start and end delimiter is identical. These delimiters allow you to make your banner message several lines long. Our first two examples use the pound symbol, #, while the last example uses the dollar sign, $, as a delimiter. You have to be slightly careful that you don’t use the delimiter character within the banner message itself or the router will accept only part of the message.

Discussion

Cisco routers support three main types of banners and display them in strict order. First the Message of the Day (motd) and then the login banner appear before the login prompt, and the router prints the exec banner after successful authentication:

Freebsd% telnet Router1
Trying 172.22.1.4...
Connected to Router1.
Escape character is '^]'.
 This is a motd banner  
 This is a login banner 

User Access Verification

Username: ijbrown
Password: <xxxxxxxxx>
 This is an exec banner 
Router1>

Login banners are mainly used to display a warning message for security purposes, which we will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

Brad Edgeworth, Aaron Foss, Ramiro Garza Rios
Cisco Software-Defined Access

Cisco Software-Defined Access

Srilatha Vemula, Jason Gooley, Roddie Hasan

Publisher Resources

ISBN: 0596527225Supplemental ContentErrata Page