Guest

Cisco Catalyst 3750 Series Switches

Auto Smartport with Custom Trigger Configuration Example

Document ID: 116515

Updated: Sep 25, 2013

Contributed by Andrew Gossett, Cisco TAC Engineer.

   Print

Introduction

This document provides a complete example configuration that defines custom triggers for Auto Smartports. This example uses custom triggers based on the built-in device classifier. This is a good alternative for classification of non-Cisco devices when Organizationally Unique Identifiers (OUIs) cannot be used. Another alternative to the use of the built-in device classifier is to trigger based on the RADIUS attribute-value pair auto-smart-port=(custom event trigger). RADIUS triggers are outside the scope of this document.

Note: More information is available in the Auto Smartports Configuration Guide, Release 15.0(2)SE.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

The information in this document is based on these software and hardware versions:

  • Cisco Catalyst 3750-X Series Switch
  • Cisco IOS® Version 15.2.1E

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Configure

Network Diagram

In this example, an Avaya IP Phone is connected on Gi1/0/1 on a 3750X switch. This example uses the built-in device classifier and the Link Layer Discovery Protocol (LLDP) information from the phone in order to auto-configure the port.

Ensure Profiles are Present

Ensure that the device classifier has the built-in profiles for the desired device. As of Version 15.2.1E, there are over 250 built-in profiles. See the Appendix at the end of this document for the full list. The profiles are only bundled with the .tar images. Based on your version of code, the profiles are stored in either:

  • flash:<running_ios>/dc_default_profiles.txt
  • flash:dc_profile_dir/dc_default_profiles.txt

You can force Cisco IOS to refresh the profile list if you disable and reenable the device classifier. In this example, you want to ensure that the profiles for Avaya are present.

c3750x#dir flash:dc_profile_dir/
Directory of flash:dc_profile_dir/

531 -rwx 143335 Mar 30 2011 02:14:22 +00:00 dc_default_profiles.txt

57671680 bytes total (28816384 bytes free)

c3750x(config)#no macro auto monitor
c3750x(config)#macro auto monitor

c3750x#show macro auto monitor type string Avaya
Valid Type Profile Name min Conf ID
=========== ========= ================== ======== ====
Valid Default Avaya-Device 10 3
Valid Default Avaya-IP-Phone 20 4

Enable LLDP

For this example, the device classifier uses information with the LLDP frame. For this to work, LLDP must be enabled.

c3750x(config)# lldp run

Create Custom Event Trigger

The syntax for a custom trigger is shell trigger <trigger_name> <trigger_description>. Use the name AVAYA_IP_PHONE and this description: This is for an avaya IP phone.

c3750x(config)# shell processing full
c3750x(config)# shell trigger AVAYA_IP_PHONE This is for an avaya IP phone

Associate Trigger with Desired Profile

This example matches off the Profile Name of Avaya-IP-Phone, so it ties the trigger to that profile.

c3750x(config)# macro auto trigger AVAYA_IP_PHONE
c3750x(config-macro-trigger)# profile Avaya-IP-Phone

Define the Macro

The macro is the real power of Auto Smartport. The device classifier detects when a certain type of device is connected, and based on that classification, you can apply a specific configuration. This example applies a VLAN, voice VLAN, and a description to the port. When the device is removed, you remove the previously-applied configuration. This example is easily extended to include Quality of Service (QoS) and other security configurations.

c3750x(config)# macro auto execute AVAYA_IP_PHONE  {
if [[ $LINKUP == YES ]]; then
conf t
interface $INTERFACE

macro description $TRIGGER
description ***** AVAYA PHONE *****
switchport access vlan 100
switchport mode access
switchport voice vlan 200
exit
fi
if [[ $LINKUP == NO ]]; then
conf t
interface $INTERFACE
no macro description $TRIGGER
no description ***** no more avaya phone *****
no switchport access vlan 100
no switchport mode access
no switchport voice vlan 200
exit
fi
end
}

Globally-Enable Macro Processing

For the events to successfully trigger, macro processing must be globally-enabled.

Note: All ports have processing enabled by default.

Before you enable macro processing globally, be sure to disable processing on ports that should be excluded via the no macro auto processing command.

c3750x(config)# macro auto global processing

Complete Configuration

Here is the complete configuration for this example:

c3750x#show run | sec lldp|shell|macro
shell processing full
shell trigger AVAYA_IP_PHONE This is for an avaya IP phone
lldp run
macro auto execute AVAYA_IP_PHONE {
if [[ $LINKUP == YES ]]
then conf t
interface $INTERFACE
macro description $TRIGGER
description ***** AVAYA PHONE *****
switchport access vlan 100
switchport mode access
switchport voice vlan 200
exit
fi
if [[ $LINKUP == NO ]]
then conf t
interface $INTERFACE
no macro description $TRIGGER
no description ***** no more avaya phone *****
no switchport access vlan 100
no switchport mode access
no switchport voice vlan 200
exit
fi
end
macro auto trigger AVAYA_IP_PHONE
profile Avaya-IP-Phone
macro auto global processing

Verify

For any shell verifications, you must first enable Cisco IOS.sh for the current terminal session.

c3750x#terminal shell
c3750x#terminal shell trace

In order to verify that the trigger and macro functions exist and are successfully mapped together, enter this command:

c3750x#show shell triggers AVAYA_IP_PHONE
User defined triggers
---------------------
Trigger Id: AVAYA_IP_PHONE
Trigger namespace: DEFAULT
Trigger description: This is for an avaya IP phone
Trigger mapping function:
function AVAYA_IP_PHONE_func()
{
if [[ $LINKUP == YES ]]
then conf t
interface $INTERFACE
macro description $TRIGGER
description ***** AVAYA PHONE *****
switchport access vlan 100
switchport mode access
switchport voice vlan 200
exit
fi
if [[ $LINKUP == NO ]]
then conf t
interface $INTERFACE
no macro description $TRIGGER
no description ***** no more avaya phone *****
no switchport access vlan 100
no switchport mode access
no switchport voice vlan 200
exit
fi
end
}

When the port with the Avaya IP phone comes online, this sequence of events displays:

%LINK-3-UPDOWN: Interface GigabitEthernet1/0/1, changed state to up
%AUTOSMARTPORT-5-INSERT: Device Avaya-IP-Phone detected on interface
GigabitEthernet1/0/1,
executed AVAYA_IP_PHONE

In order to verify that the device is correctly classified as Avaya-IP-Phone, enter this command:

c3750x#show macro auto monitor device interface g1/0/1
Summary:

MAC_Address Port_Id Profile Name Device Name
============== ========== =============================== =======================
(device mac ) Gi1/0/1 Avaya-IP-Phone AVAYA, INC

In order to verify that the macro configuration is successfully applied, enter this command:

c3750x# show run interface g1/0/1
!
interface GigabitEthernet1/0/1
description ***** AVAYA PHONE *****
switchport access vlan 100
switchport mode access
switchport voice vlan 200
macro description AVAYA_IP_PHONE
spanning-tree portfast
end

Troubleshoot

There is currently no specific troubleshooting information available for this configuration.

Appendix

Here are the built-in device classifier profiles as of Version 15.2.1E:

c3750x#show macro auto monitor type
Valid Type Profile Name min Conf ID
=========== ========= ================== ======== ====
Valid Default Apple-Device 10 0
Valid Default Apple-iDevice 10 1
Valid Default Aruba-Device 10 2
Valid Default Avaya-Device 10 3
Valid Default Avaya-IP-Phone 20 4
Valid Default Brother-Device 10 5
Valid Default Brother-HL-3040CN-series 30 6
Valid Default Brother-HL-5370DW-series 30 7
Valid Default Brother-MFC-8890DW 30 8
Valid Default Brother-MFC-9010CN 30 9
Valid Default Canon-Device 10 10
Valid Default Canon-MF4690 30 11
Valid Default Cisco-Device 10 12
Valid Default Cisco-Router 10 13
Valid Default Cisco-Switch 20 14
Valid Default Cisco-TelePresence 30 15
Valid Default Cisco-IP-Camera 20 16
Valid Default Router 10 17
Valid Default Cisco-IP-Phone 20 18
Valid Default IP-Phone 20 19
Valid Default Cisco-IP-Phone-7902 70 20
Valid Default Cisco-IP-Phone-7905 70 21
Valid Default Cisco-IP-Phone-7906 70 22
Valid Default Cisco-IP-Phone-7910 70 23
Valid Default Cisco-IP-Phone-7911 70 24
Valid Default Cisco-IP-Phone-7912 70 25
Valid Default Cisco-IP-Phone-7940 70 26
Valid Default Cisco-IP-Phone-7941 70 27
Valid Default Cisco-IP-Phone-7942 70 28
Valid Default Cisco-IP-Phone-7945 70 29
Valid Default Cisco-IP-Phone-7945G 70 30
Valid Default Cisco-IP-Phone-7960 70 31
Valid Default Cisco-IP-Phone-7961 70 32
Valid Default Cisco-IP-Phone-7962 70 33
Valid Default Cisco-IP-Phone-7965 70 34
Valid Default Cisco-IP-Phone-7970 70 35
Valid Default Cisco-IP-Phone-7971 70 36
Valid Default Cisco-IP-Phone-7975 70 37
Valid Default Cisco-IP-Phone-7985 70 38
Valid Default Cisco-IP-Phone-9971 70 39
Valid Default Cisco-IP-Phone-9951 70 40
Valid Default Cisco-IP-Phone-8961 70 41
Valid Default Cisco-IP-Phone-8941 70 42
Valid Default Cisco-IP-Phone-8945 70 43
Valid Default Cisco-WLC 20 44
Valid Default Cisco-WLC-2100-Series 40 45
Valid Default Cisco-WLC-4400-Series 40 46
Valid Default Cisco-WLC-5500-Series 40 47
Valid Default Cisco-DMP 20 48
Valid Default Cisco-DMP-4400 70 49
Valid Default Cisco-DMP-4310 70 50
Valid Default Cisco-DMP-4305 70 51
Valid Default DLink-Device 10 52
Valid Default Enterasys-Device 10 53
Valid Default HP-Device 10 54
Valid Default HP-JetDirect-Printer 30 55
Valid Default HP-LaserJet-1022n 30 56
Valid Default HP-LaserJet-5100-Series 30 57
Valid Default HP-LaserJet-5200 30 58
Valid Default HP-LaserJet-8150-Series 30 59
Valid Default HP-LaserJet-9000-Series 30 60
Valid Default HP-LaserJet-M3027-MFP 30 61
Valid Default HP-LaserJet-M3035-MFP 30 62
Valid Default HP-LaserJet-M4345-MFP 30 63
Valid Default HP-LaserJet-P1505n 30 64
Valid Default HP-LaserJet-P2035n 30 65
Valid Default HP-LaserJet-P3005 30 66
Valid Default HP-LaserJet-P3010-Series 30 67
Valid Default HP-LaserJet-P4014 30 68
Valid Default HP-LaserJet-P4015 30 69
Valid Default HP-LaserJet-2420 30 70
Valid Default HP-LaserJet-2430 30 71
Valid Default HP-LaserJet-4250 30 72
Valid Default HP-LaserJet-4345-mfp 30 73
Valid Default HP-LaserJet-4350 30 74
Valid Default HP-Color-LaserJet-2500 30 75
Valid Default HP-Color-LaserJet-5550 30 76
Valid Default HP-Color-LaserJet-9500 30 77
Valid Default HP-Color-LaserJet-2600n 30 78
Valid Default HP-Color-LaserJet-3000 30 79
Valid Default HP-Color-LaserJet-3600 30 80
Valid Default HP-Color-LaserJet-3800 30 81
Valid Default HP-Color-LaserJet-4500 30 82
Valid Default HP-Color-LaserJet-4700 30 83
Valid Default HP-Color-LaserJet-CM4730-MFP 30 84
Valid Default HP-Color-LaserJet-CM6030-MFP 30 85
Valid Default HP-Color-LaserJet-CP3505 30 86
Valid Default HP-Color-LaserJet-CP3525 30 87
Valid Default HP-Color-LaserJet-CP4020-Series 30 88
Valid Default HP-Color-LaserJet-CP5520-Series 30 89
Valid Default Lexmark-Device 10 90
Valid Default Lexmark-Printer-E260dn 30 91
Valid Default Lexmark-T522 30 92
Valid Default Lexmark-T630 30 93
Valid Default Lexmark-T642 30 94
Valid Default Lexmark-T654 30 95
Valid Default Microsoft-Device 10 96
Valid Default Netgear-Device 10 97
Valid Default NintendoWII 10 98
Valid Default Nortel-Device 10 99
Valid Default Nortel-IP-Phone-2000-Series 20 100
Valid Default SonyPS3 10 101
Valid Default XBOX360 20 102
Valid Default Xerox-Device 10 103
Valid Default Xerox-Printer-Phaser3250 30 104
Valid Default Xerox-DocuColor-8080-Digital-Press 30 105
Valid Default Xerox-FaxCentre-2218 30 106
Valid Default Xerox-Igen4-Press 30 107
Valid Default Xerox-Phaser-3200mfp 30 108
Valid Default Xerox-Phaser-3300mfp 30 109
Valid Default Xerox-Phaser-3500dn 30 110
Valid Default Xerox-Phaser-3600 30 111
Valid Default Xerox-Phaser-3635mfp 30 112
Valid Default Xerox-Phaser-4600 30 113
Valid Default Xerox-Phaser-4620 30 114
Valid Default Xerox-Phaser-5550dt 30 115
Valid Default Xerox-Phaser-6010n 30 116
Valid Default Xerox-Phaser-6110 30 117
Valid Default Xerox-Phaser-6110mfp 30 118
Valid Default Xerox-Phaser-6115mfp 30 119
Valid Default Xerox-Phaser-6128mfp-n 30 120
Valid Default Xerox-Phaser-6130n 30 121
Valid Default Xerox-Phaser-6140dn 30 122
Valid Default Xerox-Phaser-6180mfp-d 30 123
Valid Default Xerox-Phaser-6280dn 30 124
Valid Default Xerox-Phaser-6280n 30 125
Valid Default Xerox-Phaser-6360dx 30 126
Valid Default Xerox-Phaser-6360n 30 127
Valid Default Xerox-Phaser-6500dn 30 128
Valid Default Xerox-Phaser-6500n 30 129
Valid Default Xerox-Phaser-6700dx 30 130
Valid Default Xerox-Phaser-7400dx 30 131
Valid Default Xerox-Phaser-7400dxf 30 132
Valid Default Xerox-Phaser-7500dt 30 133
Valid Default Xerox-Phaser-7500dx 30 134
Valid Default Xerox-Phaser-7760dx 30 135
Valid Default Xerox-Phaser-7760dx-Pcl-5c 30 136
Valid Default Xerox-Phaser-7760gx 30 137
Valid Default Xerox-Phaser-8500n 30 138
Valid Default Xerox-Phaser-8550dp 30 139
Valid Default Xerox-Phaser-8550dt 30 140
Valid Default Xerox-Phaser-8560 30 141
Valid Default Xerox-Phaser-8560dn 30 142
Valid Default Xerox-Phaser-8560dx 30 143
Valid Default Xerox-Phaser-8860 30 144
Valid Default Xerox-Phaser-8860mfp 30 145
Valid Default Xerox-WorkCentre-3045ni 30 146
Valid Default Xerox-WorkCentre-3210 30 147
Valid Default Xerox-WorkCentre-3220 30 148
Valid Default Xerox-WorkCentre-3550 30 149
Valid Default Xerox-WorkCentre-4118-Series 30 150
Valid Default Xerox-WorkCentre-4250 30 151
Valid Default Xerox-WorkCentre-4260 30 152
Valid Default Xerox-WorkCentre-5020-dn 30 153
Valid Default Xerox-WorkCentre-5030 30 154
Valid Default Xerox-WorkCentre-5135 30 155
Valid Default Xerox-WorkCentre-5225 30 156
Valid Default Xerox-WorkCentre-5225a 30 157
Valid Default Xerox-WorkCentre-5632 30 158
Valid Default Xerox-WorkCentre-5655 30 159
Valid Default Xerox-WorkCentre-5675 30 160
Valid Default Xerox-WorkCentre-5687 30 161
Valid Default Xerox-WorkCentre-5735 30 162
Valid Default Xerox-WorkCentre-5755 30 163
Valid Default Xerox-WorkCentre-5765 30 164
Valid Default Xerox-WorkCentre-5790 30 165
Valid Default Xerox-WorkCentre-6015n 30 166
Valid Default Xerox-WorkCentre-6400s 30 167
Valid Default Xerox-WorkCentre-6400x 30 168
Valid Default Xerox-WorkCentre-6400xf 30 169
Valid Default Xerox-WorkCentre-6505dn 30 170
Valid Default Xerox-WorkCentre-6505n 30 171
Valid Default Xerox-WorkCentre-7120 30 172
Valid Default Xerox-WorkCentre-7132-Multifunction-Syst 30 173
Valid Default Xerox-WorkCentre-7242 30 174
Valid Default Xerox-WorkCentre-7345 30 175
Valid Default Xerox-WorkCentre-7346 30 176
Valid Default Xerox-WorkCentre-7428 30 177
Valid Default Xerox-WorkCentre-7435 30 178
Valid Default Xerox-WorkCentre-7535 30 179
Valid Default Xerox-WorkCentre-7556 30 180
Valid Default Xerox-WorkCentre-7675 30 181
Valid Default Xerox-WorkCentre-7755 30 182
Valid Default Xerox-WorkCentre-7775 30 183
Valid Default Xerox-WorkCentre-M118 30 184
Valid Default Xerox-WorkCentre-M20 30 185
Valid Default Xerox-WorkCentre-M20i 30 186
Valid Default Xerox-WorkCentre-Pro-133 30 187
Valid Default Xerox-WorkCentre-Pro-C3545 30 188
Valid Default Xerox-4127 30 189
Valid Default Xerox-700-Digital-Color-Press 30 190
Valid Default Xerox-Color-1000-Press 30 191
Valid Default Xerox-Color-560 30 192
Valid Default Xerox-ColorQube-8570dn 30 193
Valid Default Xerox-ColorQube-8570dt 30 194
Valid Default Xerox-ColorQube-8570dx 30 195
Valid Default Xerox-ColorQube-8700X 30 196
Valid Default Xerox-ColorQube-8870 30 197
Valid Default Xerox-ColorQube-9202 30 198
Valid Default Xerox-ColorQube-9203 30 199
Valid Default Xerox-ColorQube-9301 30 200
Valid Default Aruba-AP 20 201
Valid Default Cisco-Access-Point 10 202
Valid Default Cisco-IP-Conference-Station-7935 70 203
Valid Default Cisco-IP-Conference-Station-7936 70 204
Valid Default Cisco-IP-Conference-Station-7937 70 205
Valid Default DLink-DAP-1522 20 206
Valid Default Cisco-AP-Aironet-1130 30 207
Valid Default Cisco-AP-Aironet-1240 30 208
Valid Default Cisco-AP-Aironet-1250 30 209
Valid Default Cisco-AIR-LAP 25 210
Valid Default Cisco-AIR-LAP-1130 30 211
Valid Default Cisco-AIR-LAP-1240 50 212
Valid Default Cisco-AIR-LAP-1250 50 213
Valid Default Cisco-AIR-AP 25 214
Valid Default Cisco-AIR-AP-1130 30 215
Valid Default Cisco-AIR-AP-1240 50 216
Valid Default Cisco-AIR-AP-1250 50 217
Invalid Default Sun-Workstation 10 218
Valid Default Linksys-Device 20 219
Valid Default LinksysWAP54G-Device 30 220
Valid Default HTC-Device 10 221
Valid Default MotorolaMobile-Device 10 222
Valid Default VMWare-Device 10 223
Valid Default ISE-Appliance 10 224
Valid Default Konica-Device 10 225
Valid Default Konica-Minolta-Bizhub-C280 30 226
Valid Default Konica-Minolta-Bizhub-C650 30 227
Valid Default RICOH-Device 10 228
Valid Default RICOH-Aficio-MP-5000 30 229
Valid Default RICOH-Aficio-MP-5001 30 230
Valid Default RICOH-Aficio-MP-C2050 30 231
Valid Default RICOH-Aficio-MP-C2550 30 232
Valid Default RICOH-Aficio-MP-C4501 30 233
Valid Default RICOH-Aficio-SP-C410DN 30 234
Valid Default Samsung-Device 10 235
Valid Default Samsung-ML-2855-Series 30 236
Valid Default Samsung-CLP-310-Series 30 237
Valid Default Philips-Device 10 238
Valid Default Surveillance-Camera 10 239
Valid Default AXIS-Camera 20 240
Valid Default Pelco-Camera 20 241
Valid Default Video-Conference 20 242
Valid Default Radvision-VCF 20 243
Valid Default Polycom-VCF 20 244
Valid Default Draeger-Device 10 245
Valid Default Polycom-Device 10 246
Valid Default WYSE-Device 10 247
Valid Built-in Cisco-Device 10 0
Valid Built-in Cisco-Router 10 1
Valid Built-in Router 10 2
Valid Built-in Cisco-IP-Camera 10 3
Valid Built-in Cisco-IP-Camera-2xxx 30 4
Valid Built-in Cisco-IP-Camera-2421 50 5
Valid Built-in Cisco-IP-Camera-2500 50 6
Valid Built-in Cisco-IP-Camera-2520 50 7
Valid Built-in Cisco-IP-Camera-2530 50 8
Valid Built-in Cisco-IP-Camera-4xxx 50 9
Valid Built-in Cisco-Transparent-Bridge 8 10
Valid Built-in Transparent-Bridge 8 11
Valid Built-in Cisco-Source-Bridge 10 12
Valid Built-in Cisco-Switch 10 13
Valid Built-in Cisco-IP-Phone 20 14
Valid Built-in IP-Phone 20 15
Valid Built-in Cisco-DMP 10 16
Valid Built-in Cisco-DMP-4305G 70 17
Valid Built-in Cisco-DMP-4310G 70 18
Valid Built-in Cisco-DMP-4400G 70 19
Valid Built-in Cisco-WLC-2100-Series 40 20
Valid Built-in Cisco-Access-Point 10 21
Valid Built-in Cisco-AIR-LAP 30 22
Valid Built-in Cisco-AIR-AP 30 23
Valid Built-in Linksys-Device 20 24
Valid Built-in Surveillance-Camera 10 25
Valid Built-in AXIS-Camera 20 26
Valid Built-in Pelco-Camera 20 27
Valid Built-in Video-Conference 20 28
Valid Built-in Radvision-VCF 20 29
Valid Built-in Polycom-VCF 20 30
Valid Built-in CUPC-VCF 20 31
Updated: Sep 25, 2013
Document ID: 116515