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
Router1(config)#
# This is an exec banner #
banner login
Router1(config)#
# This is a login banner #
banner motd
Router1(config)#
$ This is a motd banner $
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
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:
Router1
Password:
ijbrown
<xxxxxxxxx>
This is an exec banner Router1>
Login banners are mainly used to display a warning message for security purposes, which we will ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.