Chapter 21
Configuring Cisco IOS Auto Smartport Macros
To map an event trigger to a user-defined macro, perform this task:
Command
Step 1
Switch# configure terminal
Step 2
Switch(config)# macro auto
execute event trigger
[parameter=value] {function
contents}
Step 3
Switch(config)# end
Step 4
Switch# show running-config
Step 5
Switch# copy running-config
startup-config
This example shows how to map a user-defined event trigger called Cisco Digital Media Player (DMP)
to a user-defined macro.
Connect the DMP to an 802.1X- or MAB-enabled switch port.
Step 1
On the RADIUS server, set the attribute-value pair to auto-smart-port
Step 2
=MY_MEDIAPLAYER_EVENT.
On the switch, create the event trigger CISCO_DMP_EVENT, and map it to the user-defined macro
Step 3
commands shown below.
The switch recognizes the attribute-value pair=CISCO_DMP_EVENT response from the RADIUS
server and applies the macro associated with this event trigger.
The following example shows the macro portion of the automacro:
Switch(config)# shell trigger CISCO_DMP_EVENT Cisco DMP player
Switch(config)# macro auto execute CISCO_DMP_EVENT {
if [[ $LINKUP -eq YES ]]; then
conf t
interface $INTERFACE
macro description $TRIGGER
switchport access vlan 1
OL_28731-01
Purpose
Enters global configuration mode.
Specifies a user-defined macro that maps to an event trigger.
Specify an event trigger value:
CISCO_PHONE_EVENT
•
CISCO_SWITCH_EVENT
•
CISCO_ROUTER_EVENT
•
CISCO_WIRELESS_AP_EVENT
•
CISCO_WIRELESS_LIGHTWEIGHT_AP_EVENT
•
WORD Applies a user-defined event trigger.
•
CISCO_DMP_EVENT
•
CISCO_IPVSC_EVENT
•
function contents—Specifies a user-defined macro to associate with the
trigger. Enter the macro contents within braces. Begin the Cisco IOS shell
commands with the left brace and end the command grouping with the right
brace.
(Optional) parameter=value—Replaces default values that begin with $,
enter new values in the form of name value pair separated by a space:
[name1=value1 name2=value2...].
Returns to privileged EXEC mode.
Verifies your entries.
(Optional) Saves your entries in the configuration file.
Software Configuration Guide—Release IOS XE 3.6.0E and IOS 15.2(2)E
Configuring Auto Smartport Macros
21-11