banner

Cisco IOS banner tokens

Since Cisco IOS Release 12.0(3)T there is an option to use tokens when configuring different types of banner messages on routers.  The tokens are replaced with the respective parameter value when the banner is displayed, and they can reference different parameters of the device and/or configuration.

The table below lists the possible tokens and their support in different banner messages:

Банер\token
motd
login
exec
incoming
slip-ppp
Description
$(hostname)
YES
YES
YES
YES
YES
Hostname of the device
$(domain)
YES
YES
YES YES YES Domain
$(peer-ip)
NO
NO
NO
NO
YES IP Address of the peer device
$(gate-ip)
NO
NO
NO
NO
YES
IP Address of the gateway
$(encap)
NO
NO
NO
NO
YES Encapsulation type
$(encap-alt)
NO
NO
NO
NO YES Encapsulation shown as SL/IP instead of SLIP.
$(mtu)
NO
NO
NO
NO
YES
MTU
$(line)
YES
YES
YES
YES NO Number of the line hosting the incoming connection
$(line-desc)
YES
YES
YES
YES
NO Description of the line hosting the incoming connection

Here’s an exmaple of using the $(hostname) token when configuring a login banner:

R1(config)#banner login # You are connected to $(hostname). Authorized users only! #

This option comes in quite handy in cases of a global rollout including banner configuration on multiple devices (using a tool for configuration management/automated rollout, such as Expect, or a commercial one such as CiscoWorks).

Tags: , ,

Saturday, January 17th, 2009 General No Comments