MANUAL PAGE     3/190 80-CRA 119 1170/1-V1 Uen B    

Using the CLI

© Copyright Ericsson AB 2009. All rights reserved.

Disclaimer

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 L M Ericsson.
NetOp  is a trademark of Telefonaktiebolaget L M Ericsson.

Contents

1Using the CLI
1.1Start an Administrative Session
1.2Display Help for a Command
1.3Navigate the CLI
1.4Recall Previous Command Entries
1.5Edit Command Entries
1.6Modifying Output of show Commands


1   Using the CLI

This document describes the tasks and commands you use to navigate the command-line interface (CLI) to the SmartEdge router. It also describes how to display help for a command, recall previous command entries, and edit command entries.

The CLI only requires you to enter enough of any command or keyword to uniquely identify it.

The primary administrator interface to the SmartEdge router is the CLI. See Start an Administrative Session for detailed information.

Note:  
In the following descriptions, the term controller card applies to any version of the Cross-Connect Route Processor (XCRP) Controller card (XCRP, XCRP3, XCRP4), including the controller carrier card unless otherwise noted.

The term controller carrier card refers to the controller functions on the carrier card within the SmartEdge 100 chassis; these functions are compatible with the XCRP3 Controller card. The term I/O carrier card refers to the traffic card functions on the carrier card; these functions are compatible with the similar functions that are implemented on the traffic card that are supported on all other SmartEdge routers.

The term chassis refers to any SmartEdge chassis; the term SmartEdge 800 chassis refers to any version of the SmartEdge 800 chassis. The term SmartEdge 1200 chassis refers to any version of the SmartEdge 1200 chassis.


Note:  
In this section, the command syntax in the task table displays only the root command; for the complete command syntax, search for the command in the Command List to find the command reference documentation with the full description for the command.

1.1   Start an Administrative Session

The primary administrator interface to the SmartEdge router is the CLI. You access the CLI from the console port or through a remote session (for example, Telnet or Secure Shell [SSH]) to monitor, administer, and troubleshoot the SmartEdge router. To access the SmartEdge router software and its CLI, use either of the following methods:

1.1.1   Telnet and SSH Sessions

If the management port has been configured, you can establish a Telnet or SSH session to the system. There are many tools that provide Telnet and SSH access to remote systems. These tools are beyond the scope of this document. In general, you must provide the system name (the hostname configured for the system) or IP address (the IP address configured for the system management port), as well as an administrator name and password.

Within the system, the maximum number of concurrent sessions permitted is either 32 or the sum of all sessions permitted for each context, whichever is smaller. If the maximum number of concurrent sessions permitted on the system is greater than the maximum number of permitted SSH sessions, the remaining sessions must be Telnet sessions. See the following configuration commands for more information: aaa authentication administrator and ssh server full-drop.

1.1.2   Console Sessions

The SmartEdge router provides default settings for local console sessions. You can customize these settings for the duration of the current session. To change the settings, see Performing Basic System Tasks. After you are logged on to the system, you have access to the CLI, based on the context to which you are logged on and the privilege level of your account.

1.1.3   Administrator Names and Passwords

To log on to the system, you must enter a valid administrator name and password at the appropriate prompts to gain access. The administrator name is of the form admin-name@ ctx-name. The ctx-name specifies the name of the context the system uses for authentication. You can include a context for a logon, but the context name is optional—if a context name is not supplied, the local context is assumed.

Note:  
The separator character between the admin-name and the ctx-name arguments is configurable and can be any of %, -, @, _, \\, #, and /. The default value is @, which is used throughout this document.

When you connect to the system either directly to the console or remotely to the management port, the password you enter is not echoed.

If you forget a password, you must delete the administrator account and create a new one; there is no way to modify the password for an administrator account.

If you forget all passwords on the system, you must perform the password discovery procedure described in Recovering Passwords.

1.2   Display Help for a Command

You can access the online Help for the CLI in the following ways:

Table 1 lists these commands; enter either command in any mode.

Table 1    Access Online Help

Task

Root Command

Obtain help for the current command.

counters (VPLS)

Obtain help for using the ? command.

help

Note:  
To enter the ? character as part of a command, when it is not a request for online Help, enter the Esc character followed by the ? character.

1.3   Navigate the CLI

To navigate the CLI, perform the tasks described in Table 2.

Table 2    Navigate the CLI

Task

Root Command

Return the privilege level for the current exec session to the initial privilege level configured for the current administrator account.

When you create the account, the initial privilege level is specified.

Enter this command in exec mode.

disable

Change the current privilege level for an exec session while in exec mode.

You can specify a level up to the level specified for your account.

Enter this command in exec mode.

enable

Return to exec mode while in any configuration mode. Enter this command in any configuration mode.

end

Terminate the current CLI session while in exec mode. Enter this command in exec mode.

show configuration

Move up one level in the configuration mode hierarchy while in a configuration mode; return to exec mode while in global configuration mode. Enter this command in any configuration mode.

exit

Enter global configuration mode. Enter this command in exec mode.

configure

Displays the current configuration of the SmartEdge router or the contents of a previously saved configuration file on the local file system. Enter this command in any configuration mode.

show configuration

Display the command history for the current session. Enter this command in any configuration mode

show history

Display outstanding transactions for other administrators or internal processes. Enter this command in any configuration mode.

show transaction

Enter a configuration mode from another configuration mode. (1)

 

(1)  Commands to enter various configuration mode. See the Command List or the specific document for the mode you plan to access.

1.4   Recall Previous Command Entries

Table 3 lists two Emacs-style command keyboard sequences that allow you to step through previously entered commands.

Table 3    Recall Previously Entered Commands

Keyboard

Description

Ctrl + p or up arrow

Recalls previous command in the command history

Ctrl + n or down arrow

Recalls next command in the command history

1.5   Edit Command Entries

Table 4 lists additional Emacs-style command keyboard sequences.

Table 4    Additional Emacs-Style Keyboard Sequences

Keyboard

Description

Ctrl+f or right arrow

Moves cursor forward one character

Ctrl+b or left arrow

Moves cursor backward one character

Esc+f

Moves cursor forward one word

Esc+b

Moves cursor backward one word

Ctrl+a

Moves cursor to beginning of line

Ctrl+e

Moves cursor to end of line

Ctrl+k

Deletes to end of line

Ctrl+u

Deletes to beginning of line

Ctrl+d

Deletes character

Esc+d

Deletes word

Ctrl+c

Quits editing the current line

Ctrl+l

Refreshes (redraws) the current line

Ctrl+t

Transposes current character with previous

For more information on Emacs key bindings, see the GNU Emacs documentation available at http://www.gnu.org.

1.6   Modifying Output of show Commands

All show commands accept a common set of keywords and arguments called modifiers that you can use to refine the command output. For example, you can specify the line number at which the output is to begin, output only lines containing certain patterns, and apply filtering criteria that pass only those lines you wish to see.

This section describes the syntax of show command output modifiers and how to get help for the grep command in the CLI. It also provides examples of a show command displaying lines before and after a pattern, a show command displaying lines that include a pattern, and a show command displaying lines that match a grep pattern.

1.6.1   Syntax of show Command Output Modifiers

The syntax for the output modifiers is as follows:

[| {begin [before lines] [after lines] pattern | count | exclude pattern | include pattern | {grep [options options] pattern} | save filename}]

Table 5 describes how each modifier affects the show command output.

Table 5    Modifier Syntax Descriptions

Modifier

Description

|

Modifies the output with the keywords that follow; that is, pipes the output of the show command into keyword-specified functions that control which lines of the output display.

begin pattern

Displays output beginning at the first occurrence of text matching the specified pattern. The pattern must be a regular expression. For more information on regular expressions, see the GNU documentation available at http://www.gnu.org.

before lines

Optional. Number of lines before the first line containing the matching pattern to display.

after lines

Optional. Number of lines after the first line containing the matching pattern to display.

count

Counts the number of lines generated by the show command but does not display the lines.

exclude pattern

Excludes all lines that contain text that matches the specified pattern from the display.

include pattern

Displays only the lines that contain text that matches the specified pattern.

grep pattern

Displays only the lines that contain text that matches the specified pattern. The pattern must be a regular expression. For more information on regular expressions, see Help for the grep Command in the CLI.

options options

Optional. UNIX grep command options.

save filename

Output saved to the specified filename.

1.6.2   Help for the grep Command in the CLI

You can get help for the grep command by entering “grep --help” at the command line. For more information on the grep command options, see the GNU grep documentation available at http://www.gnu.org.

The following example shows how to get help for the grep command:

[local]Redback#show port counters | grep --help 
Usage: grep [OPTION]... PATTERN [FILE] ...
Search for PATTERN in each FILE or standard input.
Example: grep -i 'hello.*world' menu.h main.c

Regexp selection and interpretation:
  -E, --extended-regexp   PATTERN is an extended regular expression
  -F, --fixed-strings     PATTERN is a set of newline-separated strings
  -G, --basic-regexp      PATTERN is a basic regular expression
...

1.6.3   Example of the show Command Displaying Lines Before and After a Pattern

The following example displays all lines from the output for the show configuration command (in any mode) beginning with the line before the first line that contains the word (pattern), ospf, and including the 6 lines after the first occurrence of the pattern:

[local]Redback#show configuration | begin before 1 after 6 ospf 
router ospf 64001
  spf-timers 1 1
  area 0.0.0.0
   interface 10.100.11.10
  area 0.0.0.11
   interface 10.100.11.27
   interface 10.100.11.49

1.6.4   Example of the show Command Displaying Lines that Include a Pattern

The following example displays all lines in the current configuration file that contain the word (pattern), port:

[local]Redback#show configuration | include port 

card ether-12-port 1
card oc12-4-port 2
card gigaether-4-port 3
port ethernet 1/1
port ethernet 1/2
port ethernet 1/3
port ethernet 1/4
port pos 2/1
port pos 2/2
port pos 2/3
port pos 2/4

1.6.5   Example of the show Command Displaying Lines that Match a grep Pattern

The following example takes the output of show port counters command with the live keyword and pipes it into the grep command. Next, the grep command filters what it receives and outputs only the lines that contain atm, ethernet, or rate. (The -E option interprets the pattern as an extended regular expression where the pipe character ( | ) is a logical OR operator.) The output of the grep command is received by the exclude keyword, which removes all lines containing the pattern interval and outputs the remainder to the display:

[local]Redback#show port counters live | grep option -E
 'atm|ethernet|rate' | exclude interval 
1/1 atm  
send packet rate : 0.00 send bit rate : 0.00  
recv packet rate : 0.00 recv bit rate : 0.00  
1/2 atm  
send packet rate : 0.00 send bit rate : 0.00
recv packet rate : 0.00 recv bit rate : 0.00
1/3 atm
send packet rate : 0.00 send bit rate : 0.00
recv packet rate : 0.00 recv bit rate : 0.00
1/4 atm  
send packet rate : 0.00 send bit rate : 0.00
recv packet rate : 0.00 recv bit rate : 0.00