Auto Smartports Configuration Guidelines

•You cannot delete or change the built-in macros. However, you can override a built-in macro by creating a user-defined macro with the same name. To restore the original built-in macro, delete the user-defined macro.

•If you enable both the macro auto device and the macro auto execute global configuration commands, the parameters specified in the command last executed are applied to the switch. Only one command is active on the switch.

•To avoid system conflicts when macros are applied, remove all port configurations except for 802.1x authentication. Be sure to enter the commands that remove port security and Bridge Protocol Data Unit (BPDU) guard features before you enable Auto Smartports macros on a port.

•Do not configure port security when you enable device-specific Auto Smartports on the switch. The switch applies the appropriate port-based commands.

•If the macro conflicts with the original configuration, either the macro does not apply some of the original configuration commands, or the antimacro does not remove them. (The antimacro is the portion of the applied macro that removes the macro at a link-down event.)

For example, if 802.1x authentication is enabled, you cannot remove the switchport-mode access configuration. Remove the 802.1x authentication before removing the switchport mode configuration.

•A port cannot be a member of an EtherChannel when you apply Auto Smartports macros. If you use EtherChannels, disable Auto Smartports on the EtherChannel interface by using the no macro auto processing interface configuration command.

•If you use the VLAN name in a macro, it must be the same name that is in the VLAN database for all switches in the VLAN Trunking Protocol (VTP) domain.

•Use the show macro auto device privileged EXEC command to display the default macros with the default parameter values, current values, and the configurable parameter list for each macro. You can also use the show shell functions privileged EXEC command to see the built-in-macro default values.

•For stationary devices that do not support CDP, MAB, or 802.1x authentication, such as network printers, configure a MAC address group with a MAC OUI-based trigger and map it to a user-defined macro with the desired configuration.

•The switch supports Auto Smartports macros only on directly connected devices. If multiple devices are connected, (for example, through a hub) the applied macro is associated with the first detected device.

•If authentication is enabled on a port, the switch ignores a MAC address trigger if authentication fails.

•When using MAC-address-based detection, ensure that Auto Smartports is enabled only on ports facing access devices and not on ports that face the network or an intermediate gateway switch.

•The order of CLI commands within the macro and the corresponding antimacro can be different.

•When the device identity is configured and the device is authenticated on a switch port, these RADIUS attributes could be downloaded:

–VLAN ID and switch ACL name or number from the Cisco access control server (ACS)

–ASP trigger name in an attribute-value (AV) pair.

After the AV pair is downloaded, the switch applies the macro on the port.

The downloaded VLAN ID or ACL name could conflict with the settings in the user-defined or builtin macro applied by the switch.

•Auto Smartports does not support lightweight access points in the Remote Edge Access Point (REAP) or Hybrid Remote Edge Access Point (HREAP) mode.

Enabling Auto Smartports Macros

Follow this required procedure to enable macros globally on the switch.

Beginning in privileged EXEC mode:

Command

Purpose

Step 1

configure terminal

Example:

Switch# configure terminal

Enters global configuration mode.

Step 2

macro auto global processing

Example:

Switch(config)# macro auto global processing

Globally enables macros on the switch.

Step 3

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show running-config

Example:

Switch# show running-config

Verifies that Auto Smartports is enabled.

Step 5

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

To return to the default setting, use the nomacro auto global processing global configuration command.

To disable macros on a specific port, use the no macro auto processing interface configuration command.

You can use the show macro auto device, the show shellfunctions, and the show shelltriggers privileged EXEC commands to display the event triggers and the built-in macros.

This example shows how to enable macros on the switch and then how to disable macros on a specific interface:

Switch(config)# macro auto global processing

Switch(config)# interface interface_id

Switch(config-if)# no macro auto processing

Default Auto Smartports Configuration

•Auto Smartports is globally disabled and is enabled per interface.

•Macro persistence is globally disabled and is enabled per interface.

•Cisco IOS shell is enabled.

•The switch uses these built-in macros (the defaults) when Auto Smartports is enabled for the specific devices.

Table 2-1 Device-Specific Built-In Macros

Macro Name

Description

CISCO_AP_AUTO_SMARTPORT

This macro applies the wireless access point macro for Cisco access points. It enables standard QoS, auto-QoS, and 802.1q encapsulated trunking. It configures the native VLAN on the interface. It also enables macro persistence so that the macro remains active after a link-down event.

CISCO_DMP_AUTO_SMARTPORT

This macro applies the digital media player macro for Cisco digital media players. It enables QoS trust, auto-QoS, port security, and spanning-tree protection. It configures the access VLAN for the interface and provides network protection from unknown unicast packets.

Note If you enter the auto qos video media-player interface configuration command, the switch automatically uses the CDP to detect the presence or absence of a Cisco digital media player.

This macro applies the IP phone macro for Cisco IP phones. It enables QoS, port security, storm control, DHCP snooping, and spanning-tree protection. It also configures the access and voice VLANs for that interface.

–The switch determines the access point type (autonomous or lightweight) and then applies the appropriate macro.

–To reduce overrun errors at the ingress interface on an access point Ethernet receiver, the switch adds the QoS bandwidth setting to the access point macros when it receives a CDP message with the auto-QoS type, length, and value attributes (TLVs). QoS derives the bandwidth value from the auto-QoS TLVs.

If the CDP messages does not have the auto-QoS TLVs, the switch does not add the bandwidth setting to the macros.

Note If you do not upgrade the access point image to one that has the auto-QoS TLVs, the switch does not add the bandwidth setting to the access point macros. When you configure the bandwidth before the link to the receiver goes down, the setting is removed when the link comes up.

If you add a macro command that sets the QoS bandwidth and the switch applies the macro to an access point that does not support the auto-QoS TLVs, the command is not applied to the access point, We recommend that you create a user-defined macro without that command.

–When a Catalyst 3750-E and 3560-E switch is connected to a Cisco Aironet 1250 access point, the switch applies a power setting to allocate up to 20 W.

When a switch running Cisco IOS Release 12.2(58)SE applies the CISCO_DMP_AUTO_SMARTPORT macro to a CDP-capable digital media player, it generates an auto-QoS configuration for the digital media player.

In Cisco IOS Release 15.0(1)SE and later, the access point macros support the Control and Provisioning of Wireless Access Points (CAPWAP) protocol.

Configuring Auto Smartports Parameter Values

The switch automatically maps from event triggers to built-in device-specific macros. You can follow this optional procedure to replace macro default parameter values with values that are specific to your switch.

Enter new values in the form of a name-value pair separated by spaces: [<name1>=<value1> <name2>=<value2>...].

You can enter the VLAN ID or the VLAN name when specifying VLAN parameter values.

Default values are shown for each macro default parameter value.

•access-pointNATIVE_VLAN=1

•ip-cameraACCESS_VLAN=1

•lightweight-apACCESS_VLAN=1

•media-playerACCESS_VLAN=1

•phoneACCESS_VLAN=1 VOICE_VLAN=2

•routerNATIVE_VLAN=1

•switchNATIVE_VLAN=1

Note You must enter the correct parameter name (for example, VOICE_VLAN) because this text string must match the text string in the built-in macro definition.

Step 4

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 5

show macro auto device

Example:

Switch# show macro auto device

Verifies your entries.

Step 6

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

This example shows how to see the IP phone macro parameter values and how to change the default voice VLAN to 20. When you change the default values, they are not immediately applied on the interfaces with existing applied macros. The configured values are applied at the next link-up event. Note that the exact text string was used for VOICE_VLAN. The entry is case sensitive.

Switch# show macro auto device phone

Device:phone

Default Macro:CISCO_PHONE_AUTO_SMARTPORT

Current Macro:CISCO_PHONE_AUTO_SMARTPORT

Configurable Parameters:ACCESS_VLAN VOICE_VLAN

Defaults Parameters:ACCESS_VLAN=1 VOICE_VLAN=2

Current Parameters:ACCESS_VLAN=1 VOICE_VLAN=2

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)# macro auto device phone VOICE_VLAN=20

Switch(config)# end

Switch# show macro auto device phone

Device:phone

Default Macro:CISCO_PHONE_AUTO_SMARTPORT

Current Macro:CISCO_PHONE_AUTO_SMARTPORT

Configurable Parameters:ACCESS_VLAN VOICE_VLAN

Defaults Parameters:ACCESS_VLAN=1 VOICE_VLAN=2

Current Parameters:voice_vlan=20

Configuring MAC Address Groups

For devices such as printers that do not support neighbor discovery protocols such as CDP or LLDP, use the MAC-address-based trigger configurations. This optional procedure requires these steps:

Specify an operationally unique identifier (OUI) list or range. The OUI is the first three bytes of the MAC address and identifies the manufacturer of the product. Specifying the OUI allows devices that do not support neighbor discovery protocols to be recognized.

•list—Enter an OUI list in hexadecimal format separated by spaces.

•range—Enter the starting OUI hexadecimal value (start-value).

•size—Enter the length of the range (number) from 1 to 5 to create a list of sequential addresses.

Configuring Macro Persistence

When you enable Auto Smartports on the switch, by default the macro configuration is applied at a link-up event and removed at a link-down event. When you enable macro persistence, the configuration is applied at link-up and is not removed at link-down. The applied configuration remains. Macro persistence remains configured after a reboot if you have saved the running configuration file.

Follow this optional procedure so that enable macros remain active on the switch after a link-down event.

Beginning in privileged EXEC mode:

Command

Purpose

Step 1

configure terminal

Example:

Switch# configure terminal

Enters global configuration mode.

Step 2

interfaceinterface-id

Example:

Switch(config)# interface gigabitethernet 2/0/1

Specifies an interface and enters interface configuration mode.

Step 3

macro auto sticky

Example:

Switch(config-if)# macro auto port sticky

Enables macros to remain active on the interface after a link-down event.

Step 4

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 5

show running-config interface interface-id

Example:

Switch# show running-config interface gigabit ethernet 2/0/1

Verifies your entries.

Step 6

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

This example shows how to enable macro persistence on an interface:

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)# interface gigabitethernet 2/0/1

Switch(config-if)# macro auto port sticky

Switch(config-if)# exit

Switch(config)# end

Switch# show running-config interface gigabitethernet 2/0/1

Building configuration...

Current configuration : 243 bytes

!

<output truncated>

!

interface GigabitEthernet2/0/1

srr-queue bandwidth share 1 30 35 5

queue-set 2

priority-queue out

mls qos trust device cisco-phone

mls qos trust cos

macro auto port sticky

service-policy input AUTOQOS-ENHANCED-CISCOPHONE-POLICY

end

<output truncated>

Switch#

Configuring Built-In Macro Options

Use this procedure to map event triggers to built-in macros and to replace the built-in macro default parameters with values that are specific to your switch. If you need to replace default parameters values in a macro, use the macro auto device global configuration command. All commands in this procedure are optional.

This example shows how to use two built-in macros to connect Cisco switches and Cisco IP phones to the switch. This example modifies the default voice VLAN, access VLAN, and native VLAN for the trunk interface:

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#!!! the next command modifies the access and voice vlans

Switch(config)#!!! for the built in Cisco IP phone auto smartport macro

Creating User-Defined Event Triggers

When using MAB or 802.1x authentication as an event trigger, create a trigger that corresponds to the Cisco attribute-value pair (auto-smart-port=eventtrigger) sent by the RADIUS server. This procedure is optional.

Beginning in privileged EXEC mode:

Command

Purpose

Step 1

configure terminal

Example:

Switch# configure terminal

Enters global configuration mode.

Step 2

shell trigger identifier description

Example:

Switch(config)# shell trigger RADIUS_MAB_EVENT MAC_AuthBypass Event

Specifies the event trigger identifier and description. The identifier should have no spaces or hyphens between words.

Step 3

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show shell triggers

Example:

Switch# show shell triggers

Displays the event triggers on the switch.

Step 5

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

This example shows how to map a user-defined event trigger called RADIUS_MAB_EVENT to the built-in macro CISCO_AP AUTO_SMARTPORT, to replace the default VLAN with VLAN 10, and how to verify the entries.

a. Connect the device to a MAB-enabled switch port.

b. On the RADIUS server, set the attribute-value pair to auto-smart-port=RADIUS_MAB_EVENT.

c. On the switch, create the event trigger RADIUS_MAB_EVENT.

d. The switch recognizes the attribute-value pair=RADIUS_MAB_EVENT response from the RADIUS server and applies the macro CISCO_AP_AUTO_SMARTPORT.

Specifies when the switch applies a macro based on the detection method, device type, or trigger.

•device—Use one or more of these devices as an event trigger:

–(Optional) access-point—Autonomous access point

–(Optional) ip-camera—Cisco IP video surveillance camera

–(Optional) lightweight-ap—Lightweight access point

–(Optional) mac-address—Device MAC address

–(Optional) media-player—Digital media player

–(Optional) phone—Cisco IP phone

–(Optional) router—Cisco router

–(Optional) switch—Cisco switch

•trigger—Use a specific event trigger.

–(Optional) last-resort—Last-resort trigger.

By default, the switch uses the device type as the event trigger. If the switch cannot determine the device type, it uses MAC address groups, MAB messages, 802.1x authentication messages, and LLDP messages in random order.

Step 4

exit

Example:

Switch(config-if)# exit

Returns to global configuration mode.

Step 5

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 6

show macro auto

Example:

Switch# show macro auto

Verifies your entries.

Step 7

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

To configure the switch to apply the CISCO_AP_AUTO_SMARTPORT or CISCO_PHONE_AUTO_SMARTPORT macro only when it detects a lightweight access point or a Cisco IP phone:

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)# interface gigabitethernet 5/0/1

Switch(config-if)# macro auto control device lightweight-ap phone

Switch(config-if)# exit

Switch(config)# end

Configuring User-Defined Triggers for User-Defined Macros

Beginning with Cisco IOS Release 15.0(1)SE, you can configure user-defined trigger groups for profiles and devices. The name of the trigger group is used to associate a user-defined macro.

Beginning in privileged EXEC mode, follow these steps to configure a user-defined event trigger for a user-defined macro.

Command

Purpose

Step 1

configure terminal

Example:

Switch# configure terminal

Enters global configuration mode.

Step 2

macro auto triggertrigger_name [device | exit | no | profile]

Example:

Switch(config)# macro auto trigger DMP

Switch(config-macro-trigger)# profile mediaplayer-DMP

Enters macro trigger configuration mode. In that mode, you can specify a user-defined event trigger that maps to a user-defined macro.

•device—Specifies a device name to map to the named trigger.

•exit—Exits device group configuration mode.

•no—Removes any configured device.

•profile—Specifies a profile name to map to the named trigger.

Step 3

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show running-config

Example:

Switch# show running-config

Verifies that Auto Smartports is enabled.

Step 5

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

Example: User-Defined Event Trigger

This example shows how to configure a user-defined event trigger called DMP_EVENT:

Switch(config)# macro auto trigger DMP_EVENT mediaplayer

Configuring User-Defined Macros

The Cisco IOS shell has basic scripting capabilities for configuring user-defined macros. These macros can contain multiple lines and can include any CLI command. You can also define variable-substitution, conditionals, functions, and triggers within the macro. This procedure is optional.

Note When configuring macros, you must enter a description. If the link is down (command $LINKUP -eq NO), you must enter the no macro description command. These commands are mandatory for Auto Smartports to work.

Beginning in privileged EXEC mode, follow these steps to map a user-defined event trigger to a user-defined macro.

Command

Purpose

Step 1

configure terminal

Example:

Switch# configure terminal

Enters global configuration mode.

Step 2

macro auto executeevent trigger [parameter=value] {function contents}

Example:

Switch(config)# macro auto execute DMP_EVENT {

if [[ $LINKUP -eq YES ]]; then

conf t

interface $INTERFACE

macro description $TRIGGER

switchport access vlan 1

switchport mode access

switchport port-security

switchport port-security maximum 1

switchport port-security violation restrict

switchport port-security aging time 2

switchport port-security aging type inactivity

spanning-tree portfast

spanning-tree bpduguard enable

exit

fi

if [[ $LINKUP -eq NO ]]; then

conf t

interface $INTERFACE

no macro description

no switchport access vlan 1

if [[ $AUTH_ENABLED -eq NO ]]; then

no switchport mode access

fi

no switchport port-security

no switchport port-security maximum 1

no switchport port-security violation restrict

no switchport port-security aging time 2

no switchport port-security aging type inactivity

no spanning-tree portfast

no spanning-tree bpduguard enable

exit

fi

}

Specifies a user-defined macro that maps to an event trigger.

{function contents} Specify a user-defined macro to associate with the trigger. Enter the macro contents within braces. Begin the Cisco IOS shell commands with the left brace and end the command grouping with the right brace.

(Optional) parameter=value—Replace default values that begin with $, and enter new values in the form of name value pair separated by spaces: [<name1>=<value1> <name2>=<value2>...].

Step 3

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 4

show running-config

Example:

Switch# show running-config

Verifies that Auto Smartports is enabled.

Step 5

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

Example: User-Defined Event Trigger and Macro

This example shows how to map a user-defined event trigger called media player to a user-defined macro.

1. Connect the media player to an 802.1x- or MAB-enabled switch port.

2. On the RADIUS server, set the attribute-value pair to auto-smart-port =DMP_EVENT.

3. On the switch, create the event trigger DMP_EVENT, and enter the user-defined macro commands in the CLI example.

4. The switch recognizes the attribute-value pair=DMP_EVENT response from the RADIUS server and applies the macro associated with this event trigger.

Switch(config)# shell trigger DMP_EVENT mediaplayer

Switch(config)# macro auto execute DMP_EVENT {

if [[ $LINKUP -eq YES ]]; then

conf t

interface $INTERFACE

macro description $TRIGGER

switchport access vlan 1

switchport mode access

switchport port-security

switchport port-security maximum 1

switchport port-security violation restrict

switchport port-security aging time 2

switchport port-security aging type inactivity

spanning-tree portfast

spanning-tree bpduguard enable

exit

fi

if [[ $LINKUP -eq NO ]]; then

conf t

interface $INTERFACE

no macro description

no switchport access vlan 1

if [[ $AUTH_ENABLED -eq NO ]]; then

no switchport mode access

fi

no switchport port-security

no switchport port-security maximum 1

no switchport port-security violation restrict

no switchport port-security aging time 2

no switchport port-security aging type inactivity

no spanning-tree portfast

no spanning-tree bpduguard enable

exit

fi

}

Switch(config)# end

Example: Last-Resort Event Trigger and Macro

The last-resort event trigger is applied when a device is classified by Device Classifier using CDP, LLDP or DHCP, but has no built-in macro.

To map the CISCO_LAST_RESORT_AUTO_SMARTPORT macro to the last-resort trigger:

Switch(config)# macro auto global control trigger last-resort

CISCO_LAST_RESORT_AUTO_SMARTPORT macro:

function CISCO_LAST_RESORT_SMARTPORT () {

if [[ $LINKUP -eq YES ]]; then

conf t

interface $INTERFACE

macro description $TRIGGER

switchport access vlan $ACCESS_VLAN

switchport mode access

load-interval 60

no shutdown

exit

end

fi

if [[ $LINKUP -eq NO ]]; then

conf t

interface $INTERFACE

no macro description

no switchport access vlan $ACCESS_VLAN

no switchport mode access

no load-interval 60

exit

end

fi

}

Example of user-defined mapping of a MAC address trigger to map a last-resort macro:

Example: Custom Event Trigger and CISCO_CUSTOM_AUTO_SMARTPORT Macro

Default CISCO_CUSTOM_AUTO_SMARTPORT macro:

if [[ $LINKUP -eq YES ]]; then

conf t

interface $INTERFACE

exit

end

fi

if [[ $LINKUP -eq NO ]]; then

conf t

interface $INTERFACE

exit

end

fi

To create a user-defined macro with the same name as the custom macro, override the CISCO_CUSTOM_AUTO_SMARTPORT macro, and set the parameters for your switch, including the mapping from an event trigger to the macro.

Config# macro auto execute CISCO_CUSTOM_EVENT {

if [[ $LINKUP -eq YES ]]; then

conf t

interface $INTERFACE

description asp3-link-UP i.e. Custom Macro OFF

no macro description

switchport

switchport mode access

switchport access vlan $ACCESS_VLAN

spanning-tree portfast

exit

end

fi

if [[ $LINKUP -eq NO ]]; then

conf t

interface $INTERFACE

macro description $TRIGGER

switchport access vlan $ACCESS_VLAN

description asp3-link-DOWN i.e. Custom Macro ON

exit

end

fi

}

Table 2-3 Supported Cisco IOS Shell Keywords

Command

Description

{

Begin the command grouping.

}

End the command grouping.

[[

Use as a conditional construct.

]]

Use as a conditional construct.

else

Use as a conditional construct.

-eq

Use as a conditional construct.

fi

Use as a conditional construct.

if

Use as a conditional construct.

then

Use as a conditional construct.

-z

Use as a conditional construct.

$

Variables that begin with the $ character are replaced with a parameter value.

#

Use the # character to enter comment text.

Table 2-4 Unsupported Cisco IOS Shell Reserved Keywords

Command

Description

|

Pipeline.

case

Conditional construct.

esac

Conditional construct.

for

Looping construct.

function

Shell function.

in

Conditional construct.

select

Conditional construct.

time

Pipeline.

until

Looping construct.

while

Looping construct.

Applying Macros on a Switch

You can use the CLI or the Cisco IOS shell scripting capability to set the macro parameters and to apply the macro.

Use this interface configuration macro for increased network security and reliability when connecting a desktop device, such as a PC, to a switch port.

cisco-phone

Use this interface configuration macro when connecting a desktop device such as a PC with a Cisco IP Phone to a switch port. This macro is an extension of the cisco-desktop macro and provides the same security and resiliency feature and also dedicated voice VLANs to ensure proper treatment of delay-sensitive voice traffic.

cisco-switch

Use this interface configuration macro when connecting an access switch and a distribution switch or between access switches connected through small form-factor pluggable (SFP) modules.

cisco-router

Use this interface configuration macro when connecting the switch and a WAN router.

cisco-wireless

Use this interface configuration macro when connecting the switch and a wireless access point.

1Cisco-default Smartports macros vary, depending on the software version running on your switch.

Static Smartports Configuration Guidelines

•When a macro is applied globally to a switch or to a switch interface, the existing configuration on the interface is retained. This is helpful when applying an incremental configuration.

•If a command fails because of a syntax or a configuration error, the macro continues to apply the remaining commands. You can use the macro global tracemacro-name global configuration command or the macro tracemacro-name interface configuration command to apply and then debug the macro to find any syntax or configuration errors.

•Some CLI commands are specific to certain interface types. If you apply a macro to an interface that does not accept the configuration, the macro fails the syntax or the configuration check, and the switch returns an error message.

•Applying a macro to an interface range is the same as applying a macro 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.

•When you apply a macro to a switch or a switch interface, the macro name is automatically added to the switch or interface. You can display the macro names and applied commands using the show running-config user EXEC command.

•To only apply each individual macro command, use the macro global applymacro-name command.

•To apply and then debug a macro to find any syntax or configuration errors, use the macro global tracemacro-name command.

Append the macro with the required values by using the parametervalue keywords. Keywords that begin with $ require a unique parameter value.

You can use the macro global applymacro-name? command to display a list of any required values for the macro. If you apply a macro without entering the keyword values, the commands are invalid and are not applied.

(Optional) Specify unique parameter values that are specific to the switch. You can enter up to three keyword-value pairs. Parameter keyword matching is case sensitive. The corresponding value replaces all matching occurrences of the keyword.

•To only apply each individual macro command, use the macro applymacro-name command.

•To apply and then debug a macro to find any syntax or configuration errors, use the macro tracemacro-name command.

Append the macro with the required values by using the parametervalue keywords. Keywords that begin with $ require a unique parameter value.

You can use the macro global applymacro-name? command to display a list of any required values for the macro. If you apply a macro without entering the keyword values, the commands are invalid and are not applied.

(Optional) Specify unique parameter values that are specific to the switch. You can enter up to three keyword-value pairs. Parameter keyword matching is case sensitive. The corresponding value replaces all matching occurrences of the keyword.

Step 8

end

Example:

Switch(config)# end

Returns to privileged EXEC mode.

Step 9

show running-config interface interface-id

Example:

Switch# show running-config interface gigabit ethernet 1/0/4

Verifies that Auto Smartports is enabled.

Step 10

copy running-config startup-config

Example:

Switch# copy running-config startup-config

(Optional) Saves your entries in the configuration file.

You can only delete a global macro-applied configuration on a switch by entering the no version of each command in the macro. You can delete a macro-applied configuration on a port by entering the default interfaceinterface-id interface configuration command.

This example shows how to display the cisco-desktop macro, to apply the macro, and to set the access VLAN ID to 25 on an interface: