12-5
Software Configuration Guide—Release 12.2(25)SG
OL-7659-03
Chapter12 Configuring SmartPort Macros
Configuring Smart-Port Macros
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.
The following sections illustrate how to apply and display the attachments on each of the supported
macros:
cisco-desktop, page 12-5
cisco-phone, page 12-6
cisco-switch, page 12-7
cisco-router, page 12-7
cisco-desktop
This example shows how to use the system-defined macro cisco-desktop to assign a value of 35 to the
access VLAN of the Fast Ethernet interface 2/9.
Note This macro requires the $AVID keyword, which is the access VLAN of the port.
Switch(config)# interface fastethernet2/9
Switch(config-if)# macro apply cisco-desktop $AVID 35
Switch(config-if)# end
Switch# show parser macro name cisco-desktop
Macro name : cisco-desktop
Macro type : customizable
# Basic interface - Enable data VLAN only
# Recommended value for access vlan (AVID) should not be 1
switchport access vlan $AVID [access_vlan_id]
switchport mode access
# Enable port security limiting port to a single
# MAC address -- that of desktop
Step3 Switch(config)# interface
interface-id Enters interface configuration mode and specifies the interface on which
to apply the macro.
Step4 Switch(config-if)# macro {apply |
trace}
macro-name
[
keyword
] [
value
]
[
keyword
] [
value
] [
keyword
] [
value
]
Applies each command defined in the macro to the interface.
As of Cisco IOS Release 12.2(20)EWA, the system defined macros are
cisco-desktop, cisco-phone, cisco-switch, and cisco-router.
Step5 Switch(config-if)# macro description
text
(Optional) Enters a description about the macro that is applied to the
interface.
Step6 Switch(config-if)# end Returns to privileged EXEC mode.
Step7 Switch# show parser macro Verifies that the macro was created.
Step8 Switch# show running-config
interface
interface-id
Verifies that the macro is applied to an interface.
Step9 Switch# copy running-config
startup-config
(Optional) Saves your entries in the configuration file.
Command Purpose