Smartports Macros for Switches in Cisco IOS

In this How To we will provide an overview of Smartports and how they can help with your Cisco switch administration.  Cisco now calls these Auto Smartports.  The Smartports macros can speed up deployment while ensuring accuracy and consistency on your switch ports. 

Simply put, Smartports macros are pre-created configuration scripts that work on most Cisco switches. These scripts allow an administrator to more easily configure common switch port configurations. By using these scripts, you can create more consistency with port configurations and perhaps even prevent future trouble.

Smartports macros are available from Web interface of the switch itself, and the Cisco IOS CLI. GUI applications can usually tell you the type of devices connected to the port, and they can recommend specific Smartports macros for the proper kind of device.

By default, Cisco switches include macros covering the following types of devices:

  • Cisco-global
  • Cisco-desktop
  • Cisco-phone
  • Cisco-switch
  • Cisco-router
  • Cisco-wireless

These macros automatically configure the port with important commands that pertain to that specific type of device. To determine which preconfigured macros are available on your switch, use the show parser macro command. This command also displays what each macro does.

Let’s look at the most frequently used macro – the Cisco-desktop macro. This macro has a parameter that you must specify when applying it; you need to define which VLAN you want this port to be a part of. Here’s an example:

Switch(config)# int fa0/10
Switch(config-if)# macro apply cisco-desktop $access_vlan 10

Of course, you could also apply the macro to a range of switch ports in one sweep.

Now let’s look at what this macro did to our switch port, fa0/10:

Switch#show running-config interface fa0/10
Building configuration…

Current configuration : 343 bytes
!
interface FastEthernet0/10
switchport mode access
switchport port-security
switchport port-security aging time 2
switchport port-security violation restrict
switchport port-security aging type inactivity
mls qos cos override
macro description cisco-desktop | cisco-desktop
spanning-tree portfast
spanning-tree bpduguard enable
end

The Cisco-desktop Smartport macro applied all of the above settings on the port. Each macro has its own specific settings to apply and parameters that you need to specify. Keep in mind that you can create your own Cisco IOS Smartports macros to apply your own settings to switch ports.

For more information, check out this Cisco video about Smartports 

Here is a link to the Cisco Auto Smartports Configuration Guide

Here is a link to the Cisco Smartports Macros Config Guide

Leave a Comment

Contact Us Here


Please verify.
Validation complete :)
Validation failed :(
 
Your contact request has been received. We usually respond within an hour, but please be patient. We will get back to you very soon.
Scroll to Top