17-11
Software Configuration Guide—Release 15.0(2)SG
OL-23818-01
Chapter 17 Configuring Auto SmartPort Macros Configuring Auto SmartPorts
This example shows how to map a user-defined event trigger called Cisco Digital Media Player (DMP)
to a user-defined macro.
Step 1 Connect the DMP to an 802.1X- or MAB-enabled switch port.
Step 2 On the RADIUS server, set the attribute-value pair to auto-smart-port
=MY_MEDIAPLAYER_EVENT.
Step 3 On the switch, create the event trigger CISCO_DMP_EVENT, and map it to the user-defined macro
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
switchport mode access
switchport port-security
switchport port-security maximum 1
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
spanning-tree portfast
spanning-tree bpduguard enable
exit
fi
The following represents the anti-macro portion of the automacro:
if [[ $LINKUP -eq NO ]]; then
conf t
interface $INTERFACE
no macro description $TRIGGER
no switchport access vlan 1
if [[ $AUTH_ENABLED -eq NO ]]; then
no switchport mode access
fi
no switchport port-security
no switchport port-security maximum 1
no switchport port-security violation restrict
no switchport port-security aging time 2
no switchport port-security aging type inactivity
no spanning-tree portfast
no spanning-tree bpduguard enable
exit
fi
}
Switch(config)# end