Macro Vlan help

Unanswered Question
May 29th, 2009

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Giuseppe Larosa Sat, 05/30/2009 - 09:25

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

Leo Laohoo Sat, 05/30/2009 - 19:56

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.

Rupesh Kashyap Mon, 06/01/2009 - 20:49

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

Rupesh Kashyap Tue, 06/16/2009 - 19:03

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

Leo Laohoo Tue, 06/16/2009 - 19:53

Hi Rupesh,

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

Hope this helps.

Actions

This Discussion