cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
99
Views
1
Helpful
1
Replies

Macro auto execute does not work (Autosmartport macro)

Lucyy
Level 1
Level 1

Hello,

Pleased help me! I have configured macro auto execute on Switch C3560E as below but it does not work, The idea is that when a link change to up, the switch automatically assigns this link to VLAN 10, and then link down, switch removes this link from vlan 10 and assigns it to vlan1. 

This is my configuration:

shell trigger mac-list_vlan10 mac-list_vlan10

!

macro auto execute mac-list_vlan10 {
if [[ $LINKUP == YES ]]
then conf t
interface $INTERFACE
macro description $TRIGGER
switchport access vlan 10
fi
if [[ $LINKUP == NO ]]
then conf t
interface $INTERFACE
switchport access vlan 1
no macro description
fi
}

!

macro auto mac-address-group mac-list_vlan10
mac-address list F0E4.3B85.E5J8

macro auto global processing
!

After applying this configuration, I saw the log informing that the macro has been executed. However, the link was not assigned to VLAN 10; it remained in VLAN 1 by default

%AUTOSMARTPORT-5-INSERT: Device with mac-address f0e4.3b85.e5j8   detected on interface GigabitEthernet0/10, executed mac-list_vlan10

This is a result when I show:show macro auto interface

Interface      Auto Smart Port    Fallback            Macro Description(s)
--------------------------------------------------------------

Gi0/10     TRUE                        None              No Macro Applied

thank you so much!!

 

1 Reply 1

I think this can be done by EEM 

MHM

Review Cisco Networking products for a $25 gift card