Wednesday, September 7, 2011

Banner Exec $(Tokens)


Tokens are variables that can display things like hostnames, which line has been connected to, etc.

There are several banner types that can take advantage of tokens, but for now, I want to configure banner exec.

When I telnet into R2 from R1, I want R2 to display its hostname, which line I am connecting to, the line description and domain name.

I need to add some configuration first:

R2(config)#ip domain-name stupidtroutertricks.com
R2(config)#line vty 0 4
R2(config-line)#location ?
  LINE  One text line describing the terminal's location


R2(config-line)#location VTY LINE
R2(config-line)#exit
R2(config)#

The banner exec tokens are self explanatory. The only one that might leave a doubt is $(line-desc). This variable calls the text associated with the location command under the line configuration.

R2(config)#banner exec ^You are connected to $(hostname) on line $(line), $(line-desc) at $(domain)^

Here's the telnet in action:

R1#telnet 10.1.12.2
Trying 10.1.12.2 ... Open




User Access Verification


Password: 
You are connected to R2 on line 194, VTY LINE at stupidtroutertricks.com
R2>

1 comment:

  1. Very useful if port has non standard parameters (baud rate, flow control, etc).

    ReplyDelete