Cisco Catalyst 3750 Command Reference Manual page 208

Hide thumbs Also See for Catalyst 3750:
Table of Contents

Advertisement

macro apply
Follow these guidelines when you apply a Cisco-default Smartports macro on an interface:
When you apply a macro to an interface, the macro name is automatically added to the interface. You
can display the applied commands and macro names by using the show running-configuration
interface interface-id user EXEC command.
A macro applied to an interface range behaves the same way as a macro applied to a single interface.
When you use an interface range, the macro is applied sequentially to each interface within the range. If
a macro command fails on one interface, it is still applied to the remaining interfaces.
You can delete a macro-applied configuration on an interface by entering the default interface
interface-id interface configuration command.
Examples
After you have created a macro by using the macro name global configuration command, you can apply
it to an interface. This example shows how to apply a user-created macro called duplex to an interface:
Switch(config-if)# macro apply duplex
To debug a macro, use the macro trace interface configuration command to find any syntax or
configuration errors in the macro as it is applied to an interface. This example shows how troubleshoot
the user-created macro called duplex on an interface:
Switch(config-if)# macro trace duplex
Applying command...'duplex auto'
%Error Unknown error.
Applying command...'speed nonegotiate'
This example shows how to display the Cisco-default cisco-desktop macro and how to apply the macro
and set the access VLAN ID to 25 on an interface:
Switch# show parser macro cisco-desktop
--------------------------------------------------------------
Macro name : cisco-desktop
Macro type : default
# Basic interface - Enable data VLAN only
# Recommended value for access vlan (AVID) should not be 1
switchport access vlan $AVID
switchport mode access
# Enable port security limiting port to a single
# MAC address -- that of desktop
switchport port-security
switchport port-security maximum 1
# Ensure port-security age is greater than one minute
# and use inactivity timer
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
Catalyst 3750 Switch Command Reference
2-180
Display all macros on the switch by using the show parser macro user EXEC command. Display
the contents of a specific macro by using the show parser macro name macro-name user EXEC
command.
Keywords that begin with $ mean that a unique parameter value is required. Append the
Cisco-default macro with the required values by using the parameter value keywords.
The Cisco-default macros use the $ character to help identify required keywords. There is no
restriction on using the $ character to define keywords when you create a macro.
Chapter 2
Catalyst 3750 Switch Cisco IOS Commands
78-16181-03

Advertisement

Table of Contents
loading

Table of Contents