Configuring Smartports Macros

Information About Configuring Smartports Macros

Smartports macros provide a convenient way to save and share common configurations. You can use Smartports macros to enable features and settings based on the location of a switch in the network and for mass configuration deployments across the network.

Each Smartports macro is a set of CLI commands that you define. Smartports macros do not contain new CLI commands; they are simply a group of existing CLI commands.

When you apply a Smartports macro to an interface, the CLI commands within the macro are configured on the interface. When the macro is applied to an interface, the existing interface configurations are not lost. The new commands are added to the interface and are saved in the running configuration file.

How to Configure Smartports Macros

Default Smartports Settings

There are no Smartports macros enabled on the switch.

 

Table 35 Default Smartports Macros

Macro Name 1
Description
Global Configuration Macros

cisco-cg-global

Use this global configuration macro to configure the switch settings for the industrial Ethernet environment. This macro is automatically applied when you use Express Setup to initially configure the switch.

Note: You must first apply the cisco-cg-global macro for the interface configuration macros to work properly.

cisco-cg-password

Use this global configuration macro to configure the password settings for the switch.

no-cisco-cg-password

Use the no form of this global configuration macro to delete the macro from the switch.

cisco-sniffer

Use this global configuration macro to configure SPAN functionality to analyze traffic on another port of the switch.

no-cisco-sniffer

Use the no form of this global configuration macro to delete the macro from the interface.

Interface Configuration Macros

cisco-ethernetip

Use this interface configuration macro when connecting the switch to an EtherNet IP device.

Note: You must first apply the cisco-ie-global macro for the cisco-ethernetip macro to work properly.

no-cisco-ethernetip

Use the no form of this global configuration macro to delete the macro from the interface.

cisco-cg-hmi

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

no-cisco-cg-hmi

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-cg-ied

Use this interface configuration macro when connecting the switch to an IED.

no-cisco-cg-ied

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-ie-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 features, but with the addition of dedicated voice VLANs to ensure proper treatment of delay-sensitive voice traffic.

no-cisco-ie-phone

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-cg-router

Use this interface configuration macro when connecting the switch and a WAN router. This macro is optimized for utility deployments.

no-cisco-cg-router

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-cg-switch

Use this interface configuration macro when connecting a ring of switches. This macro is optimized for utility deployments.

no-cisco-cg-switch

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-cg-wireless

Use this interface configuration macro when connecting the switch and a wireless access point. This macro is optimized for utility deployments.

no-cisco-cg-wireless

Use the no form of this interface configuration macro to delete the macro from the switch.

cisco-desktop

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

no-cisco-desktop

Use the no form of this interface configuration macro to delete the macro from the interface.

cisco-ie-none

The None Smartport is used to clear all Smartport configurations from the port.

cisco-ethernetip

Use this interface configuration macro when connecting the switch to an EtherNet IP device.

Note: You must first apply the cisco-ie-global macro for the cisco-ethernetip macro to work properly.

cisco-ie-global

Use this global configuration macro to configure the switch settings for the industrial Ethernet environment. This macro is automatically applied when you use Express Setup to initially configure the switch.

Note: You must first apply the cisco-ie-global macro for the cisco-ethernetip macro to work properly.

cisco-ie-desktop

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

cisco-ie-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-ie-desktop macro and provides the same security and resiliency features, but with the addition of dedicated voice VLANs to ensure proper treatment of delay-sensitive voice traffic. This macro is optimized for industrial automation traffic.

cisco-ie-router

Use this interface configuration macro when connecting the switch and a WAN router. This macro is optimized for industrial automation traffic.

cisco-ie-switch

Use this interface configuration macro when connecting an access switch and a distribution switch or between access switches connected using small form-factor pluggable (SFP) modules. This macro is optimized for industrial automation traffic.

cisco-ie-wireless

Use this interface configuration macro when connecting the switch and a wireless access point. This macro is optimized for industrial automation traffic.

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

Smartports Configuration Guidelines

blank.gifWhen a macro is applied globally to a switch or to a switch interface, all of the existing configurations on the interface are retained. This is helpful when applying an incremental configuration.

blank.gifIf 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 trace macro-name global configuration command or the macro trace macro-name interface configuration command to apply and debug a macro to find any syntax or configuration errors.

blank.gifSome 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.

blank.gifApplying 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.

blank.gifWhen 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 applied commands and macro names by using the show running-config user EXEC command.

Applying Smartports Macros

 

 
Command
Purpose

1.blank.gif

show parser macro

Displays the Cisco-default Smartports macros embedded in the switch software.

2.blank.gif

show parser macro name macro-name

Displays the specific macro that you want to apply.

3.blank.gif

configure terminal

Enters global configuration mode.

4.blank.gif

macro global { apply | trace } macro-name [ parameter { value }] [ parameter { value }] [ parameter { value }]

Applies each individual command defined in the macro to the switch by entering macro global apply macro-name. Specifies macro global trace macro-name to apply and to debug a macro to find any syntax or configuration errors.

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

You can use the macro global apply macro-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) Specifies 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.

5.blank.gif

interface interface-id

(Optional) Enters interface configuration mode and specifies the interface on which to apply the macro.

6.blank.gif

default interface interface-id

(Optional) Clears all configuration from the specified interface.

7.blank.gif

macro { apply | trace } macro-name [ parameter { value }] [ parameter { value }] [ parameter { value }]

Applies each individual command defined in the macro to the port by entering macro global apply macro-name. Specifies macro global trace macro-name to apply and to debug a macro to find any syntax or configuration errors.

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

You can use the macro global apply macro-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) Specifies 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.

8.blank.gif

end

Returns to privileged EXEC mode.

9.blank.gif

show running-config interface interface-id

Verifies that the macro is applied to an interface.

10.blank.gif

copy running-config startup-config

(Optional) Saves your entries in the configuration file.

Monitoring and Maintaining Smartports Macros

 

Table 36 Commands for Displaying Smartports Macros

Command
Purpose

show parser macro

Displays all Smartports macros.

show parser macro name macro-name

Displays a specific Smartports macro.

show parser macro brief

Displays the Smartports macro names.

show parser macro description [ interface interface-id ]

Displays the Smartports macro description for all interfaces or for a specified interface.

Configuration Examples for Smartports Macros

Applying the Smartports Macro: Examples

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

Switch# show parser macro name cisco-ie-desktop
--------------------------------------------------------------
Macro name : cisco-ie-desktop
Macro type : default interface
# macro keywords ACCESS_VLAN
#macro name cisco-ie-desktop
switchport mode access
switchport access vlan ACCESS_VLAN
switchport port-security
switchport port-security maximum 1
switchport port-security aging time 2
switchport port-security violation restrict
switchport port-security aging type inactivity
spanning-tree portfast
spanning-tree bpduguard enable
no macro description
macro description cisco-ie-desktop
--------------------------------------------------------------
Switch#
Switch# configure terminal
Switch(config)# interface GigabitEthernet1/20
Switch(config-if)# macro apply cisco-ie-desktop $AVID 25
 

Additional References

The following sections provide references related to switch administration:

Related Documents

Related Topic
Document Title

Cisco IOS basic commands

Cisco IOS Configuration Fundamentals Command Reference

Standards

Standards
Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

MIBs

MIBs
MIBs Link

To locate and download MIBs using Cisco IOS XR software, use the Cisco MIB Locator found at the following URL and choose a platform under the Cisco Access Products menu: http://cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml

RFCs

RFCs
Title

No new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.

Technical Assistance

Description
Link

The Cisco Technical Support website contains thousands of pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/techsupport