Using the CLI

Contents

1Using the CLI
1.1Starting an Administrative Session
1.2Displaying Help for a Command
1.3Navigating the CLI
1.4Recalling Previous Command Entries
1.5Editing Command Entries
1.6Modifying Output of show Commands
1.7Context-Specific show Commands
Copyright

© 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.

Disclaimer

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   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 recognizes abbreviated forms of commands, so it 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 the Cross-Connect Route Processor (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. 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.


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   Starting 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 using SSH:

To log on to the system using Telnet:

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   Displaying 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   Navigating 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.

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   Recalling 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   Editing 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 want 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 | join-lines | {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. Surround groups of words that must be matched as a unit with double quotes. 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.

join-lines

Optional. Temporarily arranges (concatenates) all lines of a record entry (circuit, route, subscriber, and so on.) from a multi-line output into a single-line output.


This keyword is convenient when using exclude and grep keywords. Not all commands will return concatenated output when the join-lines keyword is issued. For output examples, see Section 1.6.6.

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 file name.

1.6.2   Help for the grep Command in the CLI

You can get help for the grep (global regular expression print) command by entering grep ? or grep --help after a show command 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 displays using regular CLI help to understand the syntax of the grep command:

[local]Redback#show port counters | grep ?
  WORD     Pattern to match
  options  Grep options starting with a hyphen
[local]Redback#show port counters | grep 4/2 ?
  |     Output Modifiers
<cr>

To get more detailed help, enter the --help keyword after adding the grep command to a show command as in the following example:

[local]Redback#show hardware card 4/1 | grep --help
usage: grep [-[ABC] num] [-EFGHILVZabcdhilnoqrsvwxz] [-D action] [-d action] [-e pattern] [-f file]

Table 6 describes the grep command options:

Table 6    Grep Command Option Descriptions

Syntax Element

Description

[ABCnum

Regular expression to match, starting with a hyphen. It can contain capital letters and numbers.

-EFGHILVZabcdhilnoqrsvwxz

Regular expression, starting with a hyphen, which can contain upper and lower case letters.

-D action

Grep option, indicating the action to take with devices. Actions could be read (the default) or skip.

-d action

Grep option indicating the action to take with directories. Actions could be read (the default), skip, or recurse (reads all files under each directory, recursively).

-e pattern

Pattern (regular expression) to match.

-f file

Grep command option followed by input file name.

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 ge-10-port 1
card oc12e-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  

1.6.6   Example of the show Command Displaying Lines using the join-lines Keyword

The following examples display various ways the join-lines keyword can be used to output record entries.

The following output is that of the show circuit count command without the join-lines keyword.

[local]Redback#show circuit count
Circuit                               Packets/Bytes Sent Packets/Bytes Received
1/1                                                    0                      0
                                                       0                      0
4/1:1                                                  0                      0
                                                       0                      0
4/1                                                    0                      0
                                                       0                      0
5/1                                                    0                      0
                                                       0                      0
5/3                                                    0                      0
                                                       0                      0
5/4                                                    0                      0
                                                       0                      0
6/1                                                    0                      6
                                                       0                    360
12/2                                                   0                      0
                                                       0                      0
14/1                                                   0                      0
                                                       0                      0

When the exclude pattern keyword is piped with the join-lines keyword, the record(s) that do not contain the pattern 2 is output.

[local]Redback#show circuit count | join-lines | exclude 2 
Circuit                               Packets/Bytes Sent Packets/Bytes Received
1/1                                                    0                      0
                                                       0                      0
4/1:1                                                  0                      0
                                                       0                      0
4/1                                                    0                      0
                                                       0                      0
5/1                                                    0                      0
                                                       0                      0
5/3                                                    0                      0
                                                       0                      0
5/4                                                    0                      0
                                                       0                      0
6/1                                                    0                      6
                                                       0                    360
14/1                                                   0                      0
                                                       0                      0

When the grep pattern command is piped with the join-lines keyword, the record(s) containing the pattern 00:30:88:01:cc:00 is output.

[local]Redback#show circuit details | join-lines | grep 00:30:88:01:cc:00
Circuit: 6/1, internal id: 1/1/29, state: Up
----------------------------------------------------------
interface bound   : eth10@3
bind type         : interface
admin state       : 0                 hardware address  : 00:30:88:01:cc:00 
media type        : ethernet          encap type        : ethernet          
mode type         : 0x1               port type         : ethernet          
mtu size          : 1500              cfg mtu size      : 1500              
ipv6 mtu size     : 1500              ipv6 cfg mtu size : 1500              
cct speed         : 100000            cct rx speed      : 0                 
cct flags (attr)  : 0x0               cct flags2 (attr) : 0x0               
L3 proto flags    : 0x0               L3 proto valid    : NO                
L3 v4 proto       : DISABLED          L3 v6 proto       : DISABLED          
L3 v4 proto       : DOWN              L3 v6 proto       : DOWN              
slot mask         : 0x0               parent slot mask  : 0x0               
ppa cct clear     : FALSE             
if flags          : 0x0               aaa index         : 0x0               
profile id        : 0                 version           : 270               
nd profile        : 0                 h node id         : 0                 
lg_id             : 0                 spg_id            : 0                 
internal handle   : 2/10:1023:63/1/1/29

1.7   Context-Specific show Commands

Some show commands are context-specific. For these commands, enter the context ctx-name command before entering the show command.