This article provides instructions on how to configure auto smartport properties on your switch through the Command Line Interface (CLI).
To configure smartports on a web-based utility, click here.
A smartport, when enabled, allows a switch to identify the types of devices connected to it. You can enable by setting up Cisco Discovery Protocol (CDP) and/or Layer Link Discovery Protocol (LLDP).
CDP is a proprietary Data Link Layer protocol that is used to share information about other directly connected Cisco equipment. CDP enables a device to advertise the type of device, operating system version, IP address, configuration, and capabilities to neighboring devices and then stores it in the Management Information Base.
The information shared among the neighbors helps reduce the time needed to add a new device to the Local area Network (LAN) and also provides details necessary to troubleshoot many configuration problems.
LLDP performs the same functions as CDP. The difference is that LLDP facilitates vendor interoperability and CDP is Cisco proprietary.
Step 1. Log in to the switch console. The default username and password is cisco. If you have configured a new username or password, enter those credentials instead.
Note: To learn how to access an SMB switch CLI through SSH or Telnet, click here.
Note: The commands may vary depending on the exact model of your switch. In this example, the SG350X switch is accessed through Telnet.
Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG350X#configureStep 3. To configure the Auto Smartports administrative global state in the switch, enter the following:
SG350X(config)#macro auto [enabled | disabled | controlled]Note: You cannot enable Auto Smartport globally if the OUI Voice Virtual Local Area network (VLAN) is enabled.
- Auto Smartport Operational state is disabled when the OUI Voice VLAN is enabled.
- Auto Smartport Operational state is enabled when the Auto Voice VLAN is enabled.
Note: Regardless of the status of Auto Smartport, you can always manually apply a Smartport macro to its associated Smartport type. A Smartport macro is either a built-in macro or a user-defined macro.
Step 4. To enable CDP capability information to identify the type of an attached device, enter the following:
SG350X(config)#macro auto processing cdpNote: In this example, CDP is enabled.
Step 5. To enable using LLDP capability information to identify the type of an attached device, enter the following:
SG350X(config)#macro auto processing lldpNote: In this example, LLDP is enabled. This will allow LLDP to detect and identify the type of device attached on the switch.
Step 6. To enable automatic detection of devices of given type, enter the following:
SG350X(config)#macro auto processing type [smartport-type] [enable | disable]Note: By default, auto detection of ip_phone, ip_phone_desktop, switch, and wireless access point (ap) is enabled.
Note: In this example, auto detection of IP Phone is enabled.
Step 7. (Optional) To replace the default Auto Smartport values of built-in Smartport macros, enter the following:
SG350X(config)#macro auto built-in parameters [smartport-type] [parameter-name value]Note: By default, each Smartport type is associated with a pair of built-in macros: a macro that applies the configuration, and the anti-macro (no macro) to remove the configuration. The Smartport types are the same as the name of the corresponding built-in Smartport macros, with the anti-macro prefixed with no _. The value of the parameter $voice_vlan cannot be changed by this command.
Note: In this example, the switch is configured with parameter $native_vlan 1.
Step 8. To go back to the Privileged EXEC mode of the switch, enter the following:
SG350X(config)#exitStep 9. (Optional) To display the macro auto processing information about which discovery protocols are enabled and which device types can be detected automatically, enter the following:
SG350X#show macro auto processingYou should now have successfully configured the global Smartport properties on your switch.
A smartport macro is a user-defined set of Cisco IOS Command Line Interface (CLI) commands. It allows you to set up common configurations quickly, easily, and consistently. It enables features, settings and communication for network devices.
A Smartport macro can be applied to an interface by the macro name, or by the Smartport type associated with the macro. Applying a Smartport macro by macro name can only be done through the CLI.
Note: When a 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.
Note: The network access and Quality of Service (QoS) requirements vary if the interface is connected to an IP phone, printer, router, or Access Point (AP).
For more information about Cisco-Provided Smartport Macros, click here.
There are two ways to apply a Smartport macro by Smartport type to an interface:
When Smartport types are applied to interfaces, the Smartport types and configuration in the associated Smartport macros are saved in the Running Configuration File. If you save the Running Configuration File into the Startup Configuration File, the device applies the Smartport types and the Smartport macros to the interfaces after reboot as follows:
To configure Smartport settings on a specific interface on your switch, follow these steps:
Step 1. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG350X#configureStep 2. In the Global Configuration mode, enter the Interface Configuration context by entering the following:
SG350X(config)#interface ge1/0/19Note: In this example, interface ge1/0/19 is being configured. A Cisco 8861 IP Phone is connected to this port. To statically configure a range of ports with the same protocol, you would enter ge1/0/[starting port number - ending port number]
Step 3. To enable the Auto Smartport feature on the interface, enter the following:
SG350X(config-if)#macro auto smartportNote: In this example, Auto Smartport is enabled on the interface.
Step 4. (Optional) To set the interface as a Smartport persistent interface, enter the following:
SG350X(config-if)#macro auto persistentNote: A Smartport persistent interface retains its dynamic configuration in the following cases: link down/up, the attaching device ages out, and reboot. For persistence and the Smartport configuration to be effective across reboot, the Running Configuration file must be saved to the Startup Configuration file.
Note: In this example, Auto Persistent is enabled on the interface.
Step 5. To manually or statically assign a Smartport type to an interface, enter the following:
SG350X(config-if)#macro auto smartport type [smartport-type]Note: In this example, interface ge1/0/19 is statically assigned with an IP Phone.
Step 6. Enter the end command to go back to the Privileged EXEC mode:
SG350X(config-if)#endStep 7. To display information about all Smartports or a specific one, enter the following:
SG350X#show macro auto ports [interface-id | detailed]Note: In this example, the Auto Smartport information of interface ge1/0/19 is displayed.
Step 8. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file by entering the following:
SG350X#copy running-config startup-configStep 9. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]... prompt appears.
You have now successfully configured the Smartport settings on a specific port or ports on your switch.