Sunday, January 18, 2009

banner tokens

There are the 3 banner commands: motd, login and exec. motd is displayed upon arriving at the router, login when prompted for login, and exec when arriving at the exec prompt. Pretty self explanatory.

Commands to enter the banners are
i) banner motd
ii) banner login
iii) banner exec

The message is then delimited by the control character of your choice.

However did you know there are a few dynamic messages or 'tokens' that can be added to the message!


$(hostname) Displays the host name for the router.

$(domain) Displays the domain name for the router.

$(line) Displays the vty or tty (asynchronous) line number.

$(line-desc) Displays the description attached to the line.


By way of an example
Router_1(config)#banner login @
Enter TEXT message. End with the character '@'.
you are on router $(hostname)
@


So telnetting onto the router, the output is as follows :

Router_1>1.1.1.1
Trying 1.1.1.1 ... Open

you are on router Router_1


User Access Verification

Password:

3 comments:

Anonymous said...

How do you set the line description, so as to use $(line-desc), on a VTY line? Cheers.

richsd1 said...

Thanks for the question. I tried using the location command under the line vty, and this seems to do the trick.

E.G.
line vty 0 4
location ON_R3

Regards
Rich

Anonymous said...

Thanks! Nice blog by the way, some good stuff here.