Cisco IOS devices support a number of banners that are presented to users when they use the console line or when they connect remotely using telnet or SSH. They are often used to inform users about their legal rights. It might be a good idea to present a banner to users who are trying to connect to your device, here are some items you might want to think about:
- To show that only authorized users are allowed to connect.
- That all traffic will be monitored.
- That there is no expectation of privacy.
- Don’t use anything that says “welcome”.
- Don’t add any contact information or information about the router in the banner.
here’s a good example on the website of the California Technology Agency that gives you more information about what a good banner should contain and some sample texts. Before you implement any banners, make sure to check your legal council first. Having said that, let’s look at the different banners…
Cisco IOS routers support a number of banners, here they are:
- MOTD banner: the “message of the day” banner is presented to everyone that connects to the router.
- Login banner: this one is displayed just before the authentication prompt.
- Exec banner: displayed before the user sees the exec prompt.
- Incoming banner: used for users that connect through reverse telnet.
We’ll take a look at how to configure these different banners now.
We’ll start with the message of the day banner that will be presented to anyone accessing the router:
R1(config)#banner motd # Enter TEXT message. End with the character '#'. Authorized users only, violaters will be shot on sight! #
The # symbol is a start and stop character. You can use any other character if you want. This is what the MOTD banner looks like:
R1#exit R1 con0 is now available Press RETURN to get started. Authorized users only, violaters will be shot on sight!
A nice and welcome banner that everyone will see…let’s move on to the login banner now.
The login banner is presented to users that access the router remotely using telnet or SSH:
R1(config)#banner login $ Authenticate yourself! $
Let’s try it out:
R1#telnet 188.8.131.52 Trying 184.108.40.206 ... Open Authorized users only, violaters will be shot on sight! Authenticate yourself!
Above you see that the login banner is displayed after the MOTD banner. It would have been better if I added some empty lines so that the login banner would show up below the MOTD banner.
The exec banner is shown just before the exec prompt:
R1(config)#banner exec # Enter TEXT message. End with the character '#'. You are connected to line $(line) at router $(hostname) #
This time I added an extra line in the banner and I also used some operators like $(line) and $(hostname). Let’s see what that looks like: