Chapter 6 CLI Tips, Techniques, and Shortcuts

Wildcards, Templates, and Aliases

 

Command or Action

Purpose

Step 5

 

 

commit

Applies the target configuration commands to the running

 

 

configuration.

 

Example:

 

 

RP/0/RP0/CPU0:router(config-TPL)# commit

 

Step 6

 

 

show running-config template template-name

Displays the details of the template.

 

Example:

 

 

RP/0/RP0/CPU0:router# show running-config

 

 

template tmplt_1

 

 

 

 

Examples

In the following example, a simple the show running-config template

template is defined. The template contents are then displayed with template-namecommand:

RP/0/RP0/CPU0:router# configure

RP/0/RP0/CPU0:router(config)# template jbtest

RP/0/RP0/CPU0:router(config-TPL)# hostname test

RP/0/RP0/CPU0:router(config-TPL)# end-template

RP/0/RP0/CPU0:router(config)# commit

RP/0/RP0/CPU0:router(config)# show running-config template jbtest

template jbtest

hostname test end-template

In the next example, a template is defined, and the template requires a parameter. The template contents are then displayed with the show running-config template template-namecommand:

RP/0/RP0/CPU0:router# configure

RP/0/RP0/CPU0:router(config)# template test2 (hostname)

RP/0/RP0/CPU0:router(config-TPL)# hostname $hostname

RP/0/RP0/CPU0:router(config-TPL)# end-template

RP/0/RP0/CPU0:router(config)# commit

RP/0/RP0/CPU0:router(config)# show running-config template test2

template test2 (hostname ) hostname $hostname

end-template

Applying Configuration Templates

To apply a template, enter the apply-templatetemplate-name[(parameter)] command in global configuration mode and consider the following guidelines:

Only one template can by applied at a time.

If the same template is applied multiple times, the most recent application overwrites the previous ones.

Provide the exact number of parameters for the template.

Templates are applied as a “best effort” operation; only valid changes are committed. If any command in the template fails, that command is discarded.

 

Cisco IOS XR Getting Started Guide

6-14

OL-10957-02

Page 170
Image 170
Cisco Systems Cisco IOS XR Applying Configuration Templates, Applies the target configuration commands to the running