66
Macro Commands
FILE LOCATION: C:\Users\gina\Desktop\Checkout_new\CLI Folders\Dell Contax
CLI\files\750_Macro.fm
D E L L C O N F ID E N T IA L – P R E L IM I N A RY 5 / 1 5 /1 2 - F O R P R O O F O N LY
keywords to designate values specific to the interface when creating a macro
that requires the assignment of a unique value.
Keyword matching is case sensitive. All matching occurrences of the keyword
are replaced with the corresponding value. Any full match of a keyword, even
if it is part of a large string, is considered a match and replaced by the
corresponding value.
Some macros might contain keywords that require a parameter value. You can
use the
macro apply macro-name
command to display a list of any required
values in the macro. If you apply a macro without entering the keyword
values, the commands are invalid and are therefore not applied.
When you apply a macro to an interface, the macro name is automatically
added to the interface. You can display the applied commands and macro
names by using the
show running-configuration
interface interface-id user
EXEC mode command.
A macro applied to an interface range behaves the same way as a macro
applied to a single interface. When a macro is applied to an interface range, it
is applied sequentially to each interface within the range. If a macro
command fails on one interface, it is nonetheless applied to the remaining
interfaces.
Example
Switch(config) # interface gigabitethernet 1/0/2
Switch(config-if) # macro trace dup
Applying command… ‘duplex full’
Applying command… ‘speed auto’
Switch(config) # interface gigabitethernet 1/0/2
Switch(config-if) # macro apply duplex $DUPLEX full $SPEED auto
Switch(config-if) # exit
Switch(config) # interface gigabitethernet 1/0/3
Switch(config-if) # macro apply dup
Switch(config-if) # exit