55-49
Catalyst 6500 Series Switch Software Configuration Guide—Release 8.7
OL-8978-04
Chapter 55 Configuring a VoIP Network
Using SmartPorts
•
In the above example, $DATAVLAN and $AUXVLAN are variables and are substituted with
appropriate values when the macro is applied to a port.
•
After the macro is defined, it is stored in NVRAM.
Modifying Existing User-Defined Macros
To modify an existing user-defined macro, use the
set macro name
name
command. When modifying
a macro, the new definition replaces the old definition but the new definition is not automatically applied
to all the ports on which it was previously applied. You need to explicitly apply the modified macro. An
example is as follows:
Console> (enable)
set macro name fileserver
Enter macro commands one per line. End with the character '@'.
cmd1
cmd2
@
Console> (enable)
The macro named “fileserver” can be overwritten by creating a macro with the same name and new
definitions. An example is as follows:
Console> (enable)
set macro name fileserver
Enter macro commands one per line. End with the character '@'.
cmd2
cmd3
@
Warning: The macro fileserver has been modified; Do you want to modify (y/n)
y
Console> (enable)
Defining Variables
To define a variable, use the
set macro variable
name_of_variable
variable_of_value
[
mod/port
]
command. You can define the variable on a per-port basis or a global basis. When a macro is applied to a
port, the variables are replaced with the values that you have defined. The maximum length of a variable
name is 16 characters. A macro definition can use multiple variables in a single line. Per-port variables
are defined on a per-port basis. Individual ports can be configured with different values by defining
variables with different values for different ports. If a variable definition does not have port information,
then it is treated as a global variable. The global variable definition is used if the per-port variable is not
defined. An example is as follows:
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
Variable AUXVLAN successfully created
Console> (enable)
If a port is not specified in the variable definition, the variable is considered a global variable. An
example is as follows:
Console> (enable)
set macro variable $CDPVER v2
Variable CDPVER successfully created
Console> (enable)
Console> (enable)
set macro variable $DATAVLAN 77
Console> (enable)