PDF(1.0 MB) View with Adobe Reader on a variety of devices
ePub(1.0 MB) View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
Mobi (Kindle)(1.1 MB) View on Kindle device or Kindle app on multiple devices
Updated:August 14, 2018
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
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.
Configure Smartport Properties
Configure Global Smartport Properties
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:
Step 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.
enabled - Auto Smartport administrative global and operational states are enabled.
disabled - Auto Smartport administrative global and operational states are disabled.
controlled - Auto Smartport administrative global and operational states are enabled when Auto Voice VLAN is in operation. If the Auto Smartport Administrative state is controlled, the Auto Smartport Operational state is managed by the Voice VLAN manager and is set as follows:
- 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 cdp
Note: 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 lldp
Note: 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]
smartport-type - Smartport type auto detection of host, ip_phone, ip_phone_desktop, switch, router or wireless access point (ap).
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]
smartport-type - Smartport type auto detection of printer, desktop, guest, server, host, ip_camera, ip_phone, ip_phone_desktop, switch, router or wireless access point (ap).
parameter-name value - Specifies the parameter name and its value. These are the parameters of the built-in or user-defined macro defined in the macro auto user smartport macro command.
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:
Step 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 processing
You should now have successfully configured the global Smartport properties on your switch.
Configure Smartport Properties on an Interface
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:
Static Smartport - You manually assign a Smartport type to an interface. The result is the corresponding Smartport macro is applied to the interface. If a connected device does not allow discovery by CDP and/or LLDP, they must be statically assigned to the desired interface.
Auto Smartport - Auto Smartport waits for a device to be attached to the interface before applying a configuration. When a device is detected from an interface, the Smartport macro (if assigned) that corresponds to the Smartport type of the attaching device is automatically applied. This is enabled by default.
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:
If the Startup Configuration File does not specify a Smartport type for an interface, its Smartport type is set to Default.
If the Startup Configuration File specifies a static Smartport type, the Smartport type of the interface is set to this static type.
If the Startup Configuration File specifies a Smartport type that was dynamically assigned by Auto Smartport:
If the Auto Smartport Global Operational state, the interface Auto Smartport state, and the Persistent Status are all Enable, the Smartport type is set to this dynamic type.
Else, the corresponding anti-macro is applied and the interfaces status is set to Default.
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:
Step 2. In the Global Configuration mode, enter the Interface Configuration context by entering the following:
interface-id - Specifies an interface ID to be configured.
Note: 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 smartport
Note: 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 persistent
Note: 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]
parameter-name value - Specifies the Smartport type such as printer, desktop, guest, server, host, ip_camera, ip_phone, ip_phone_desktop, switch, router or wireless access point (ap).
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:
Step 7. To display information about all Smartports or a specific one, enter the following:
SG350X#show macro auto ports [interface-id | detailed]
interface-id - Interface Identifier such as Ethernet interface or port channel.
detailed - Displays information for non-present ports in addition to present ports.
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-config
Step 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.