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

Macro Vlan help

Hi, I have configured MACRO on the switch. I have little bit confused. Should I give number in Vlan (vlan $V). I am seeing only Dollar Sign in the configuration. Please help.

macro name Port

switchport mode access

switchport access vlan $V

spanning-tree portfast

spanning-tree bpduguard enable

storm-control $T level $L

7 REPLIES
Hall of Fame Super Silver

Re: Macro Vlan help

Hello Rupesh,

it is like a subroutine in a programming language.

$V, $T $L represent the parameters that are to be passed when calling the macro

see

http://www.cisco.com/en/US/docs/switches/lan/catalyst3750/software/release/12.2_44_se/configuration/guide/swmacro.html

you need to use the following to call the macro

macro global {apply | trace} macro-name [parameter {value}] [parameter {value}] [parameter {value}]

using a special character to indicate variables is used in scripting languages like TCL and Perl.

Hope to help

Giuseppe

Hall of Fame Super Gold

Re: Macro Vlan help

When you run the macro Port, the command I would enter is this ...

macro apply Port $V 192 $T 3 $L 2

This means that $V or VLAN is assigned to VLAN 192 and so on.

In my Macro, my VLAN ID is always a variable. Who know what VLANs I'm going to use.

Hope this helps.

New Member

Re: Macro Vlan help

Thanks you guys. You have solved my confusion. What about, if I mention VLan Number in Macro, rather than using any Dollar sign ?

New Member

Re: Macro Vlan help

What is the difference if apply Globally or on Interface ?

New Member

Re: Macro Vlan help

Hi, below macro "port" is for Interface level. Can I apply this macro Globally, I tried but it is showing me error. It is working fine if applying on interface, please suggest-

macro name Port

switchport mode access

switchport access vlan $V

spanning-tree portfast

spanning-tree bpduguard enable

storm-control $T level $L

Hall of Fame Super Gold

Re: Macro Vlan help

Hi Rupesh,

You can't apply this Globally because the commands are interface-level command.

Hope this helps.

New Member

Re: Macro Vlan help

thanks boss.

169
Views
0
Helpful
7
Replies