
11-3
Catalyst 3550 Multilayer Switch Software Configuration Guide
78-11194-09
Chapter 11 Configuring SmartPort Macros
Configuring Smart-Port Macros
Creating and Applying SmartPort Macros
Beginning in privileged EXEC mode, follow these steps to to create and apply a SmartPort macro:
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
@
Command
Purpose
Step 1
configure terminal
Enter global configuration mode.
Step 2
macro name macro-name
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.
Step 3
interface interface-id
Enter interface configuration mode, and specify the interface on which
to apply the macro.
Step 4
macro {apply | trace} macro-name
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.
Step 5
macro description text
(Optional) Enter a description about the macro that is applied to the
interface.
Step 6
end
Return to privileged EXEC mode.
Step 7
show parser macro
Verify that the macro was created.
Step 8
show running-config interface
interface-id
Verify that the macro is applied to an interface.
Step 9
copy running-config startup-config
(Optional) Save your entries in the configuration file.