Cisco Systems 4500 Switch User Manual


  Open as PDF
of 1504
 
17-9
Software Configuration Guide—Release 15.0(2)SG
OL-23818-01
Chapter 17 Configuring Auto SmartPort Macros
Configuring Auto SmartPorts
Configuring Mapping Between User-Defined Triggers and Built-in Macros
You need to map the user-defined trigger to either a built-in macro or user-defined macro.
To map a user-defined trigger to a built-in macros, perform this task:
This example shows how to map a user-defined event trigger called RADIUS_MAB_EVENT to the
built-in macro CISCO_PHONE_AUTO_SMARTPORT with access VLAN set to 10, and how to verify
the entries.
This procedure shows how to map a user-defined trigger to a built-in macro:
Step 1 Connect the device to a MAB-enabled switch port.
Step 2 On the RADIUS server, set the attribute-value pair to auto-smart-port=RADIUS_MAB_EVENT.
Step 3 On the switch, create the event trigger RADIUS_MAB_EVENT.
The switch recognizes the attribute-value pair=RADIUS_MAB_EVENT response from the RADIUS
server and applies the macro CISCO_PHONE_AUTO_SMARTPORT, as in the following example:
Switch(config)# macro auto execute RADIUS_MAB_EVENT builtin CISCO_PHONE_AUTO_SMARTPORT
ACCESS_VLAN=10
Switch(config)# exit
Switch# show shell triggers
User defined triggers
---------------------
Trigger Id: RADIUS_MAB_EVENT
Trigger description: MAC_AuthBypass Event
Trigger environment:
Trigger mapping function: CISCO_PHONE_AUTO_SMARTPORT
<output truncated>
Configuring Auto SmartPorts User-Defined Macros
The Cisco IOS shell provides basic scripting capabilities for configuring the user-defined
Auto SmartPorts macros. These macros can contain multiple lines and can include any CLI command.
You can also define variable substitution, conditionals, functions, and triggers within the macro.
Command Purpose
Step 1
Switch# configure terminal
Enters global configuration mode.
Step 2
Switch(config)# macro auto execute
event trigger
builtin built-in macro
name [parameter=value]
[parameter=value]
Specifies a user-defined event trigger and a macro name. This action
replaces built-in macro default values, and configures mapping from an
event trigger to a built-in Auto Smartports macro.
Note When performing a mapping, you must provide parameter
values. For example, you must specify $ACCESS_VLAN=(1)
and $VOICE_VLAN=(2) for the macro
CISCO_PHONE_AUTO_SMARTPORT.
Step 3
Switch(config)# end
Returns to privileged EXEC mode.
Step 4
Switch# show shell triggers
Displays the event triggers on the switch.
Step 5
Switch# copy running-config
startup-config
(Optional) Saves your entries in the configuration file.