Chapter 10
Configuring Command Macros
You can delete a global macro-applied configuration on a switch only by entering the no version of each
command that is in the macro. You can delete a macro-applied configuration on an interface by entering
the default interface interface-id interface configuration command.
This example shows how to apply the user-created macro called snmp, to set the hostname address to
test-server, and to set the IP precedence value to 7:
Switch(config)# macro global apply snmp ADDRESS test-server VALUE 7
This example shows how to debug the user-created macro called snmp by using the macro global trace
global configuration command to find any syntax or configuration errors in the macro when it is applied
to the switch.
Switch(config)# macro global trace snmp VALUE 7
Applying command...'snmp-server enable traps port-security'
Applying command...'snmp-server enable traps linkup'
Applying command...'snmp-server enable traps linkdown'
Applying command...'snmp-server host'
%Error Unknown error.
Applying command...'snmp-server ip precedence 7'
This example shows how to apply the user-created macro called desktop-config and to verify the
configuration.
Switch(config)# interface gigabitethernet0/2
Switch(config-if)# macro apply desktop-config
Switch(config-if)# end
Switch# show parser macro description
Interface
--------------------------------------------------------------
Gi0/2
--------------------------------------------------------------
This example shows how to apply the user-created macro called desktop-config and to replace all
occurrences of VLAN 1 with VLAN 25:
Switch(config-if)# macro apply desktop-config vlan 25
Displaying Command Macros
To display the command macros, use one or more of the privileged EXEC commands in
Table 10-1
Commands for Displaying Command Macros
Command
show parser macro
show parser macro name macro-name
show parser macro brief
show parser macro description [interface
interface-id]
78-17058-01
Macro Description
desktop-config
Purpose
Displays all configured macros.
Displays a specific macro.
Displays the configured macro names.
Displays the macro description for all interfaces or for a specified
interface.
Cisco ME 3400 Ethernet Access Switch Software Configuration Guide
Displaying Command Macros
Table
10-1.
10-5