Restricting Access to the CLI


1Restricting Access to the CLI
1.1Configure a CLI Command Alias or Privilege
1.2Command Alias
1.3Configure a CLI Command Privilege
1.4Create a CLI Command Macro


How to Create a Command Macro

© Ericsson AB 2009–2011. All rights reserved. No part of this document may be reproduced in any form without the written permission of the copyright owner.


The contents of this document are subject to revision without notice due to continued progress in methodology, design and manufacturing. Ericsson shall have no liability for any error or damage of any kind resulting from the use of this document.

Trademark List
SmartEdge is a registered trademark of Telefonaktiebolaget LM Ericsson.
NetOp  is a trademark of Telefonaktiebolaget LM Ericsson.

1   Restricting Access to the CLI

This document contains information on how to set manage access to the CLI of the SmartEdge router through command privilege levels, how to configure CLI command aliases, and CLI command macros.

This document applies to both the Ericsson SmartEdge® and SM family routers. However, the software that applies to the SM family of systems is a subset of the SmartEdge OS; some of the functionality described in this document may not apply to SM family routers.

For information specific to the SM family chassis, including line cards, refer to the SM family chassis documentation.

For specific information about the differences between the SmartEdge and SM family routers, refer to the Technical Product Description SM Family of Systems (part number 5/221 02-CRA 119 1170/1) in the Product Overview folder of this Customer Product Information library.

1.1   Configure a CLI Command Alias or Privilege

A command alias is a character string that you would like to use in place of a command string. Use aliases to create shortcuts for frequently used commands. Each command has a privilege level that determines, given the privilege assigned to the administrator, who can enter the command.

To modify the privilege for a CLI command or create an alias for it, perform the tasks described in Table 1; enter all commands in global configuration mode.

Table 1    Configure a CLI Command Alias or Privilege


Root Command

Define an alias for a command.


Assign a privilege level to a command to expand or restrict its use.


To disable alias processing for a particular command, begin the command line with the backslash (\) character.

Risk of disabled commands. It is possible to create an alias that disables existing commands. To reduce the risk, use care when you define aliases. Avoid defining an alias name that is a command keyword or a partial keyword for the CLI. Aliases apply to all users on a system.

1.2   Command Alias

The following example defines the string, pc, as a shortcut for the show port counters command, and then demonstrates the use of the new alias:

[local]Redback(config)#alias inherit pc show port counters


[local]Redback#pc 4/1
Port      Type            Pkts/Bytes Sent    Pkts/Bytes Received

4/1       atm             0                   0

For more information on the show port counters command, see the Command List.

1.3   Configure a CLI Command Privilege

The following example assigns the minimum privilege level to all commands that start with the snmp keyword to 12:

[local]Redback(config)#privilege config inherit level 12 snmp

1.4   Create a CLI Command Macro

A command macro is an extended alias that allows you to define a sequence of commands to run with the macro name, instead of entering each command separately.

To create a macro for one or more CLI commands, perform the tasks described in Table 2.

Table 2    Create a CLI Command Macro


Root Command


1. Define a macro and enter macro configuration mode.


Enter this command in global configuration mode.

2. Specify a command in the macro.


Enter this command in macro configuration mode. Use this command for each command to be included in the macro.

3. Complete the macro.


Enter this command in all modes.

2   How to Create a Command Macro

The following example defines the show-port-all macro:

[local]Redback(config)#macro inherit show-port-all

[local]Redback(config-macro)#seq 10 show port $1/$2

[local]Redback(config-macro)#seq 20 show circuit $1/$2


The following example displays port data for port 3 of the traffic card in slot 4 using the same macro:

[local]Redback>show-port-all 4 3