Chapter 11
Configuring SmartPort Macros
Creating and Applying SmartPort Macros
Beginning in privileged EXEC mode, follow these steps to to create and apply a SmartPort macro:
Command
Step 1
configure terminal
Step 2
macro name macro-name
Step 3
interface interface-id
Step 4
macro {apply | trace} macro-name
Step 5
macro description text
Step 6
end
Step 7
show parser macro
Step 8
show running-config interface
interface-id
Step 9
copy running-config startup-config
The no form of the macro name global configuration command only deletes the macro definition. It
does not affect the configuration of those interfaces on which the macro is already applied. You can
delete a macro-applied configuration on an interface by entering the default interface interface-id
interface configuration command. Alternatively, you can create an anti-macro for an existing macro that
contains the no form of all the corresponding commands in the original macro. Then apply the
anti-macro to the interface.
This example shows how to define the desktop-config macro for an access switch interface, apply the
macro to Fast Ethernet interface 0/9, add a description to the interface, and verify the configuration.
Switch(config)# macro name desktop-config
# Put the switch in access mode
switchport mode access
# Allow port to move to forwarding state quickly
spanning-tree portfast
# BPDUs should not be sent into the network
spanning-tree bpduguard enable
# Restrict the port to one address -- that of desktop
switchport port-security maximum 1
# Put all data traffic in vlan 1
switchport access vlan 1
@
78-11194-09
Purpose
Enter global configuration mode.
Create a macro definition, and enter a macro name. A macro definition
can contain up to 3000 characters.
Enter the macro commands with one command per line. Use the @
character to end the macro. Use the # character at the beginning of a line
to enter comment text within the macro.
We recommend that you do not use the exit or end commands in a
macro. This could cause any commands following exit or end to execute
in a different command mode. For best results, all commands in a macro
should be interface configuration mode commands.
Enter interface configuration mode, and specify the interface on which
to apply the macro.
Apply each individual command defined in the macro to the interface by
entering macro apply macro-name. Specify macro trace macro-name
to apply and print each command before it is applied to the interface.
(Optional) Enter a description about the macro that is applied to the
interface.
Return to privileged EXEC mode.
Verify that the macro was created.
Verify that the macro is applied to an interface.
(Optional) Save your entries in the configuration file.
Catalyst 3550 Multilayer Switch Software Configuration Guide
Configuring Smart-Port Macros
11-3