Smartport Macro Configuration Guidelines; Creating And Applying Smartport Macros - Cisco 4500M Software Manual

Software guide
Table of Contents

Advertisement

Configuring Smart-Port Macros

SmartPort Macro Configuration Guidelines

Follow these guidelines when configuring macros on your switch:

Creating and Applying SmartPort Macros

To create and apply a SmartPort macro, perform the following task:
Command
Step 1
Switch # configure terminal
Step 2
Switch(config)# macro name
macro-name
Step 3
Switch(config)# interface
Step 4
Switch(config-if)# macro
}
macro-name
trace
Step 5
Switch(config-if)# macro description
text
Step 6
Switch(config-if)# end
Software Configuration Guide—Release 12.2(25)EW
13-4
Do not use exit or end commands when creating a macro. This action could cause commands that
follow exit or end to execute in a different command mode.
When creating a macro, all CLI commands should be interface configuration mode commands.
Some CLI commands are specific to certain interface types. The macro will fail the syntax check or
the configuration check, and the switch will return an error message if it is applied to an interface
that does not accept the configuration.
When a macro is applied to an interface, all existing configuration on the interface is retained. This
is helpful when applying an incremental configuration to an interface.
If you modify a macro definition by adding or deleting commands, the changes are not reflected on
the interface where the original macro was applied. You need to reapply the updated macro on the
interface to apply the new or changed commands.
You can use the macro trace macro-name interface configuration command to show what macros
are running on an interface or to debug the macro to determine any syntax or configuration errors.
If a command fails when you apply a macro, either due to a syntax error or to a configuration error,
the macro continues to apply the remaining commands to the interface.
Applying a macro to an interface range is the same as applying a macro to a single interface. When
you use an interface range, the macro is applied sequentially to each individual interface within the
range. If a macro command fails on one interface, it is still applied to the remaining interfaces.
interface-id Enters interface configuration mode and specifies the interface on which
{
|
apply
Purpose
Enters global configuration mode.
Creates a macro definition, and enters a macro name. A macro definition
can contain up to 3000 characters.
Enters the macro commands with one command per line. Use the @
character to end the macro. Use the # character at the beginning of a line
to enter comment text within the macro.
Do not use the exit or end commands in a macro. This action could
cause any commands following exit or end to execute in a different
command mode. For best results, all commands in a macro should be
interface configuration mode commands.
to apply the macro.
Applies each command defined in the macro to the interface.
(Optional) Enters a description about the macro that is applied to the
interface.
Returns to privileged EXEC mode.
Chapter 13
Configuring SmartPort Macros
OL-6696-01

Advertisement

Table of Contents
loading

This manual is also suitable for:

4500 series

Table of Contents