Cisco Systems A9K24X10GETR Aliases, Syntax, Specifies that the Alias Is Created for, alias-name

Models: A9KMOD80TR A9K24X10GETR ASR 9000

1 142
Download 142 pages 58.88 Kb
Page 118
Image 118
Aliases

Chapter 5 CLI Tips, Techniques, and Shortcuts

Wildcards, Templates, and Aliases

F I N A L D R A F T — C i s c o C o n f i d e n t i a l

hostname test end

In the next example, a template with one parameter is applied and the show configuration command displays the result:

RP/0/RSP0/CPU0:router# configure

RP/0/RSP0/CPU0:router(config)# apply-template test2 (router)

RP/0/RSP0/CPU0:router(config)# show configuration

Building configuration...

hostname router end

Aliases

Cisco IOS XR software lets you define command line aliases for any physical or logical entity in a router. After you define the alias, it can be used in the CLI to reference the real entity.

To create a command alias, type the alias command in global configuration or administration configuration mode:

alias alias-name [(parameter1 parameter2...)] command-syntax [$parameter1] [command-syntax [$parameter2]}

Table 5-5defines the alias command syntax.

Table 5-5 alias Command Syntax

Syntax

Specifies that the Alias Is Created for

 

 

alias-name

Name of the command alias. An alias name can be a single word or

 

multiple words joined by a dash (–).

 

 

command-syntax

Original command syntax. Valid abbreviations of the original

 

command syntax can be entered for the command-syntaxargument.

 

 

(parameterx)

Argument or keyword that belongs to the command you specified for

 

the command-syntaxargument. When the parameter is entered in

 

parenthesis after the alias name, the alias requires a parameter name.

 

To associate the parameter with a command within the alias, type the

 

$ character preceding the parameter name.

 

 

Multiple commands can be supported under a single command alias, and multiple variables can be supported for each command. If multiple commands are specified under a single alias, then each command is executed in the order in which it is listed in the alias command.

In the following example, an alias named my-cookieis created for the Management Ethernet interface, and then the new alias is specified to enter interface configuration mode:

RP/0/RSP0/CPU0:router(config)# alias my-cookie mgmtEth 0/0/CPU0/0

RP/0/RSP0/CPU0:router(config)# interface my-cookie

RP/0/RSP0/CPU0:router(config)# interface mgmtEth 0/0/CPU0/0

RP/0/RSP0/CPU0:router(config-if)#

After you enter a command with an alias, the router displays the command you entered with the alias value so that you can verify that alias value.

 

Cisco ASR 9000 Series Aggregation Services Router Getting Started Guide

5-16

OL-17502-01

Page 118
Image 118
Cisco Systems A9K24X10GETR Aliases, Syntax, Specifies that the Alias Is Created for, alias-name, command-syntax, 5-16