![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/5/b0/5b0416fe-9027-4e74-837f-0eb17e81ee27/5b0416fe-9027-4e74-837f-0eb17e81ee27-bg30.png)
55-48
Catalyst 6500 Series Switch Software Configuration Guide—Release 8.7
OL-8978-02
Chapter 55 Configuring a VoIP Network
Using SmartPorts
• Clearing (deleting) a macro—You can clear a macro when it is no longer needed. When you clear a
macro, only the macro and its definition are cleared from the system; the configuration on the ports
that the macro was applied to is not cleared. To clear a macro, enter the clear macro name command.
• Types of macros—The two types of macros are the global macros and the port-based macros.
Using the CLI to Configure User-Definable SmartPorts Macros
These sections describe how to use the CLI to configure user-definable SmartPorts macros:
• Creating User-Defined Macros, page 55-48
• Modifying Existing User-Defined Macros, page 55-49
• Defining Variables, page 55-49
• Using Special Variables, page 55-50
• Applying a User-Defined Macro, page 55-50
• Displaying Macros, page 55-52
• Displaying Macro Variables, page 55-52
• Clearing Macros and Macro Variables, page 55-53
• Displaying Macro Port Mappings, page 55-54
• Displaying the User-Definable SmartPorts Macro Configuration, page 55-55
• Configuring a Macro within a Macro, page 55-55
Creating User-Defined Macros
To create (define) a macro, use the set macro name name command to enter a list of commands (one
command per line). To end the macro and exit from the macro mode, type the @ break character and
then press Enter. An example is as follows:
Console> (enable) set macro name videophone
Enter macro commands one per line. End with character ‘@’.
set port enable #MODPORT
set vlan $DATAVLAN #MODPORT
set port auxiliaryvlan #MODPORT $AUXVLAN
set qos autoqos
@
Console> (enable)
Follow these guidelines and restrictions when creating user-defined macros:
• The maximum length of a macro name is 16 characters. The maximum number of command lines in
a macro is 64. A macro cannot have the same name as a static macro (such as ciscoswitch or
ciscorouter).
• You can have a macro inside a macro in user-defined and static macros.
• Syntax checking is not done when you create or modify a macro. If you enter incorrect commands
when creating the macro, the incorrect commands fail when the macro is applied to a port.
• In the above example, #MODPORT is a variable that specifies the port to which the macro is applied.
If the macro is applied on port 3/2, then #MODPORT is replaced by 3/2 when the macro is applied
to a port.