Cisco Systems ASR 9000, A9K24X10GETR, A9KMOD80TR Applying Configuration Templates, 5-15, Examples

Models: A9KMOD80TR A9K24X10GETR ASR 9000

1 142
Download 142 pages 58.88 Kb
Page 117
Image 117
Applying Configuration Templates

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

Examples

In the following example, a simple template is defined. The template contents are then displayed with the show running-config template template-namecommand:

RP/0/RSP0/CPU0:router# configure

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

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

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

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

RP/0/RSP0/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/RSP0/CPU0:router# configure

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

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

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

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

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

template test2 (hostname ) hostname $hostname

end-template

Applying Configuration Templates

To apply a template, type 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.

After a template is applied, the show configuration command displays the target configuration changes. The target configuration must be committed (with the commit command) to become part of the running configuration.

Examples

In the following example, a simple template is defined. The template contents are then displayed with the show running-config template template-namecommand:

RP/0/RSP0/CPU0:router# configure

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

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

Building configuration...

 

 

Cisco ASR 9000 Series Aggregation Services Router Getting Started Guide

 

 

 

 

 

 

OL-17502-01

 

 

5-15

 

 

 

 

 

Page 117
Image 117
Cisco Systems ASR 9000, A9K24X10GETR, A9KMOD80TR manual Applying Configuration Templates, 5-15, Examples