Cisco Systems 3560 Benutzerhandbuch

Seite von 1288
 
12-10
Catalyst 3560 Switch Software Configuration Guide
OL-8553-06
Chapter 12      Configuring Auto Smartports 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.
a.
Connect the DMP to an 802.1x- or MAB-enabled switch port.
b.
On the RADIUS server, set the attribute-value pair to auto-smart-port =CISCO_DMP_EVENT.
c.
On the switch, create the event trigger CISCO_DMP_EVENT, and enter the user-defined macro 
commands shown below.
d.
The switch recognizes the attribute-value pair=CISCO_DMP_EVENT response from the RADIUS 
server and applies the macro associated with this event trigger.
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 
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
Table 12-2
Supported Cisco IOS Shell Keywords 
Command
Description
{
Begin the command grouping.
}
End the command grouping.
[[
Use as a conditional construct.
]]
Use as a conditional construct.
else
Use as a conditional construct.
-eq
Use as a conditional construct.