Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Override Built-In Macro

I am trying to have Auto Smartport use a macro that we have created instead of the default Auto Smartport macro (override a built-in macro) but cannot seem to get it to work.  Here is what we did to create a user-defined macro:

conf t

macro auto execute CISCO_PHONE_EVENT {

   if [[ $LINKUP -eq YES ]]; then

        conf t

            interface  $INTERFACE

                macro description $TRIGGER

                switchport access vlan 10

                switchport mode access

                switchport block unicast

                if [[ $AUTH_ENABLED -eq NO ]]; then

                   switchport voice vlan 20

                fi

                spanning-tree portfast

            exit

        end

    fi

    if [[ $LINKUP -eq NO ]]; then

        conf t

            interface  $INTERFACE

                no macro description

                no switchport access vlan 10

                no switchport block unicast

                no spanning-tree portfast

                if [[ $AUTH_ENABLED -eq NO ]]; then

                    no switchport mode access

                    no switchport voice vlan 20

                fi

            exit

        end

    fi

}

macro auto global processing

Any ideas as to what I am missing?

345
Views
0
Helpful
0
Replies