05-29-2009 08:40 PM - edited 03-04-2019 04:56 AM
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
05-30-2009 09:25 AM
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
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
05-30-2009 07:56 PM
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.
06-01-2009 08:49 PM
Thanks you guys. You have solved my confusion. What about, if I mention VLan Number in Macro, rather than using any Dollar sign ?
06-01-2009 09:11 PM
What is the difference if apply Globally or on Interface ?
06-16-2009 07:03 PM
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
06-16-2009 07:53 PM
Hi Rupesh,
You can't apply this Globally because the commands are interface-level command.
Hope this helps.
06-16-2009 08:04 PM
thanks boss.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide