EasyManua.ls Logo

Cisco WS-C6506 - Page 1432

Cisco WS-C6506
1488 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
55-50
Catalyst 6500 Series Switch Software Configuration Guide—Release 8.7
OL-8978-04
Chapter 55 Configuring a VoIP Network
Using SmartPorts
In the above examples, $CDPVER is a global variable and $DATAVLAN and $AUXVLAN are per-port
variables. $DATAVLAN is also defined as a global variable. If a macro is using the variable
$DATAVLAN and the macro is applied to a port other than ports 3/2 or 3/3, the macro would use the
value of 77 for that port. After a variable and its values are defined, they are stored in NVRAM.
Using Special Variables
A macro could have a variable that is not predefined; the variable would get its value when the macro is
applied. #MODPORT is one such variable. For example, assume that a macro has the variable
#MODPORT in its definition. When the macro is applied on a module/port, the variable #MODPORT
is replaced by the module/port (mod/port) on which the macro is applied. An example is as follows:
Console> (enable) set macro name videophone
Enter macro commands one per line. End with character @.
set port enable #MODPORT
set vlan $DATAVLAN #MODPORT
set port auxiliaryvlan #MODPORT $AUXVLAN
@
Console> (enable)
In the above example, #MODPORT is a special variable that gets its value when the macro videophone
is applied on a port.
Note #MODPORT is currently the only special variable supported.
Applying a User-Defined Macro
After the macro is created, it can be applied to a port. When a macro is applied to a port, the commands
in the macro definition are executed on the switch. If the commands in the macro definition use any
variables, the variables are replaced by their respective user-defined values and then the commands are
executed. Use the set port macro mod/port name_of_macro command to apply a macro to a port.
To create and execute a user-defined macro, perform these steps:
Step 1 Create the macro.
Console> (enable) set macro name videophone
Enter macro commands one per line. End with character @.
set port enable #MODPORT
set vlan $DATAVLAN #MODPORT
set port auxiliaryvlan #MODPORT $AUXVLAN
@
Macro videophone successfully created
Console> (enable)
Step 2 Define the macro variables.
Console> (enable) set macro variable $DATAVLAN 3 3/2
Variable DATAVLAN successfully created
Console> (enable) set macro variable $DATAVLAN 5 3/3
Console> (enable) set macro variable $AUXVLAN 4 3/2

Table of Contents

Related product manuals