22-10
Catalyst 4500 Series Switch, Cisco IOS Software Configuration Guide - Cisco IOS XE 3.9.xE and IOS 15.2(5)Ex
Chapter 22 Configuring Cisco IOS Auto Smartport Macros
Configuring Auto Smartport Macros
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 Smartport User-Defined Macros
The Cisco IOS shell provides basic scripting capabilities for configuring the user-defined
Auto Smartport 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.
Inside a user-defined macro, besides parameters specified through macro auto execute trigger
parameter-name=value .., you also can use the following variables published by EEM (Table 22-3):
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.
Command Purpose
Table 22-3 Variables Published by EEM
Parameter Name Meaning
$INTERFACE Name of the interface where the trigger event is detected.
$LINKUP Indicates whether the interface is up or down (true/false).
$TRIGGER Name of the trigger event that is raised (for example,
CISCO_PHONE_EVENT).
$AUTH_ENABLED Indicates whether 802.1X authentication is configured on the interface
(true/false).