The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to use the SCE platform Command-Line Interface (CLI), its hierarchical structure, authorization levels and its help features. The Command-Line Interface is one of the SCE platform management interfaces.
The CLI is accessed through a Telnet session or directly via the console port on the front panel of the SCE platform. When you enter a Telnet session, you enter as the simplest level of user, in the User Exec mode.
The SCE platform supports up to eleven concurrent CLI sessions; five sessions initiated by Telnet connection, five sessions via SSH connection, and one session on the console port.
•Authorization and Command Mode Levels (Hierarchy)
•Navigational and Shortcut Features
When using the CLI there are two important concepts that you must understand to navigate:
•Authorization Level — Indicates the level of commands you can execute. A user with a simple authorization level can only view some information in the system, while a higher level administrator can actually make changes to configuration.
This manual documents commands up to and including the admin authorization level.
•Command Hierarchy Level — Provides you with a context for initiating commands. Commands are broken down into categories and you can only execute each command within the context of its category. For example, to configure parameters related to the Line Card, you need to be within the Linecard Interface Configuration Mode. (See CLI Command Mode Hierarchy.)
The following sections describe the available Authorization and Command Hierarchy Levels and how to maneuver within them.
The on-screen prompt indicates both your authorization level and your command hierarchy level, as well as the assigned hostname.
Note Throughout the manual, SCE is used as the sample host name.
The SCE platform has four authorization levels, which represent the user access permissions. When you initially connect to the SCE platform, you automatically have the most basic authorization level, that is User, which allows minimum functionality.
To monitor the system, you must have Viewer authorization, while to perform administrative functions on the SCE platform, you must have Admin or Root authorization. A higher level of authorization is accessed by logging in with appropriate password, as described in the procedures below.
In each authorization level, all the commands of the lower authorization layers are available in addition to commands that are authorized only to the current level.
The following CLI commands are related to authorization levels:
•enable
•disable
Each authorization level has a value (number) corresponding to it. When using the CLI commands, use the values, not the name of the level, as shown in Table 1-1.
The set of all CLI commands is grouped in hierarchical order, according to the type of the commands. The first two levels in the hierarchy are the User Exec and Privileged Exec modes. These are non-configuration modes in which the set of available commands enables the monitoring of the SCE platform, file system operations, and other operations that cannot alter the configuration of the SCE platform.
The next levels in the hierarchy are the Global and Interface configuration modes, which hold a set of commands that control the global configuration of the SCE platform and its interfaces. Any of the parameters set by the commands in these modes should be saved in the startup configuration, such that in the case of a reboot, the SCE platform restores the saved configuration.
Table 1-2 shows the available CLI modes.
When you login to the system, you have the User authorization level and enter User Exec mode. Changing the authorization level to Viewer does not change the mode. Changing the authorization level to Admin automatically moves you to Privileged Exec mode. To move to any of the configuration modes, you must enter command specific to that mode.
The list of available commands in each mode can be viewed using the question mark `?' at the end of the prompt.
Figure 1-1 illustrates the hierarchical structure of the CLI modes, and the CLI commands used to enter and exit a mode.
Figure 1-1 CLI Command Modes
The following commands are used to enter the various specific configuration modes from the global configuration mode:
•E1: interface Linecard 0
•E2: interface GigabitEthernet 1/1
•E3:
–SCE8000 GBE: interface GigabitEthernet 3/0/0-3/0/7, 3/1/0-3/1/7
–SCE8000 10GBE: interface TenGigabitEthernet 3/0/0, 3/1/0, 3/2/0, or 3/3/0
•E4:
–SCE8000 GBE: interface range GigabitEthernet 3/<bay-range (0 | 1 | 0-1)>/<port-range (any range between 0 and 7)>
–SCE8000 10GBE: interface range TenGigabitEthernet 3/<bay-range (any range between 0 and 3)>/0
•E5: line vty 0
Note Although the system supports up to five concurrent Telnet connections, you cannot configure them separately. This means that any number you enter in the line vty command (0, 1, 2, 3 or 4) will act as a 0 and configure all five connections together.
Note In order for the auto-completion feature to work, when you move from one interface configuration mode to another, you must first exit the current interface configuration mode (as illustrated in the above figure).
Example:
This example illustrates moving into and out of configuration modes as follows:
•Enter global configuration mode
•Configure the SCE platform time zone
•Enter GigabitEthernet Interface configuration mode
•Configure the speed of the management interface
•Exit the GigabitEthernet Interface (management) configuration mode to the global configuration mode
•Enter the Linecard Interface configuration
•Define the link mode
•Exit Linecard Interface configuration mode to user exec mode
SCE#configure SCE(config)#clock timezone PST -10 SCE(config)#interface GigabitEthernet 1/1 SCE(config if)#speed 100 SCE(config if)#exit SCE(config)#interface Linecard 0 SCE(config if)#link mode forwarding SCE(config if)#end sce>
The on-screen prompt indicates your authorization level, your command hierarchy level, and the assigned host name. The structure of the prompt is:
<hostname (mode-indication) level-indication>
Authorization levels are indicated as shown in Table 1-3.
|
|
---|---|
|
User and Viewer levels |
|
Admin level |
|
Root level |
Command hierarchy levels are indicated as shown in Table 1-4.
Example:
The prompt SCE1(config if)#
indicates:
•The name of the SCE platform is SCE1
•The current CLI mode is Interface configuration mode
•The user has Admin authorization level
The authorization levels and command modes function together in one hierarchy. The User and Viewer authorization levels have only a single command mode. When you enter either the Admin or Root authorization level (which function in parallel), you enter the Privileged Exec command mode. From this command mode you can access the other command modes.
•User Exec authorization level
•Viewer authorization level
•Privileged Exec command mode (you are now in either Admin or Root authorization level)
•Global Configuration command mode
From this command mode, the following Interface Command Modes can be accessed:
–GigabitEthernet Interface Configuration (management interface)
–Linecard Interface Configuration
–TenGigabitEthernet Interface Configuration (SCE8000 10GBE traffic interfaces)
–GigabitEthernet Interface Configuration (SCE8000 GBE traffic interfaces)
–Interface Range Configuration (range of traffic interfaces)
–Line Configuration
Table 1-5 summarizes how to navigate the CLI command hierarchy.
When you are in either the global configuration mode or any of the interface configuration modes, it is possible to execute an EXEC mode command (such as a show command) or a privileged EXEC (such as show running-config) without exiting to the relevant command mode. Use the do command for this purpose.
How to execute an exec mode command from a configuration command mode
Step 1 At the SCE(config)# (or SCE(config if)# or SCE(config-line)#) prompt, type do <command> and press Enter.
The specified command executes without exiting to the appropriate exec command mode.
The following example shows how to display the running configuration while in interface configuration mode.
SCE(config if#) do show running-config
CLI provides context sensitive help. Two types of context sensitive help are supported:
To obtain a list of commands that begin with a particular character string, enter the abbreviated command entry immediately followed by a question mark (?). This form of help is called partial help, because it lists only the keywords or arguments that begin with the abbreviation you entered.
Example:
The following example illustrates how typing c? displays all available arguments that start with the letter c.
SCE(config)#snmp-server c? Communitycontact SCE(config)#snmp-server c
To obtain a list of keywords or parameters associated with a command, type a question mark (?) in place of a keyword or parameter on the command line.
Note that if <Enter> is acceptable input, the symbol <cr> represents the Enter key.
Example:
The following example illustrates how to get a list of all arguments or keywords expected after the command snmp-server.
SCE(config)#snmp-server? community Define community string contact Set system contact enable Enable the SNMP agent host Set traps destination interface Set interface parameters SCE(config)# snmp-server
When asking for help on particular parameter, the system informs you of the type of data that is an accepted legal value. The types of parameters supported are:
Example:
The following example illustrates the use of ? to get help on commands syntax. In this example, you can enter either the word running-config, or any name of a file, after the word copy.
SCE#copy? running-config Copy running configuration file startup-config Backup the startup-config to a specified destination STRING Source file SCE#copy
Table 1-6 summarizes the CLI help features.
CLI maintains a history buffer of the most recent commands you used in the current CLI session for quick retrieval. Using the keyboard, you can navigate through your last commands, one by one, or all commands that start with a given prefix. By default, the system saves the last 30 commands you typed. You can change the number of commands remembered using the history size command.
To use the history functions, use the keys shown in Table 1-7.
The SCE platform has several keyboard shortcuts that make it easier to navigate and use the system. Table 1-8 shows the keyboard shortcuts available.
You can get a display the keyboard shortcuts at any time by typing help bindings.
The CLI interface features tab completion. When you type in the first letters of a command and type <Tab>, the system automatically fills in the rest of the command or keyword. This feature works only when there is one command that could be possible using the starting letters.
Example:
The letters snm followed by <Tab> will be completed to the command snmp-server.
SCE(config)#snm <Tab> SCE(config)#snmp-server
If you type <Enter> instead of <Tab>, and there is no ambiguity, the system actually carries out the command that is the result of the auto-completion.
Example: 1
The following example displays how the system completes a partial (unique) command for the enable command. The system carries out the command using the default authorization level (10) when you press Enter.
SCE>en <Enter> Password: sce#
Example: 2
The following example illustrates how to use the completion feature with a non-default value for the argument. In this example, the enable command is completed using the specified value (15) for the authorization level.
SCE>en 15 <Enter> Password: sce#
CLI enables saving FTP user name and password to be used in FTP operations—download and upload, per session.
These settings are effective during the current CLI session.
The following example illustrates how to set FTP password and user name and the use in these settings for getting a file named config.tmp from a remote station using FTP protocol.
sce#ip FTP password pw123 sce#ip FTP username user1 sce#copy ftp://@10.10.10.10/h:/config.tmp myconf.txt connecting 10.10.10.10 (user name user1 password pw123) to retrieve config.tmp sce#
•Redirecting Command Output to a File
Some commands, such as many show commands, may have many lines of output. There are several ways of managing the command output:
•Scrolling options — When the command output is too large to be displayed all at once, you can control whether the display scrolls line by line or refreshes the entire screen.
•Filtering options — You can filter the output so that output lines are displayed only if they include or exclude a specified expression.
•Redirecting to a file — You can send the output to a specified file.
Note that by default, the show commands act the same as the more commands; that is, the output is displayed interactively a single screen at a time. Use the no more command to disable this feature so that show commands display the complete output all at one time.
The output of some show and dir commands is quite lengthy and cannot all be displayed on the screen at one time. Commands with many lines of output are displayed in chunks of 24 lines. You can choose to scroll the display line by line or refresh the entire screen. At the prompt after any line, you can type one of the following keys for the desired action:
•<Enter>- Show one more line
•<Space>- Show 24 more lines (a new chunk)
•<g>- Stop prompting for more
•<?>- Display a help string showing possible options
•Any other key- Quit showing the file
You can filter the output of certain commands, such as show, more, and dir, so that output lines are displayed only if they include or exclude a specified expression. The filtering options are as follows:
•include — Shows all lines that include the specified text.
•exclude — Does not show any lines that include the specified text.
•begin — Finds the first line that includes the specified text, and shows all lines starting from that line. All previous lines are excluded.
The syntax of filtered commands is as follows:
•<command>| include <expression>
•<command>| exclude <expression>
•<command>| begin <expression>
Following is an example of how to filter the show version command to display only the last part of the output, beginning with the version information.
sce# show version | begin revision
You can redirect the output of commands, such as show, more, and dir, to a file. When writing the output of these commands to a file, you can specify either of the following options:
•redirect — The new output of the command will overwrite the existing contents of the file.
•append — The new output of the command will be appended to the existing contents of the file.
The syntax of redirection commands is as follows:
•<command>| redirect <file-name>
•<command>| append <file-name>
Following is an example of how to do the following:
•Filter the more command to display from a csv subscriber file only the gold package subscribers.
•Redirect that output to a file named current_gold_subscribers. The output should not overwrite existing entries in the file, but should be appended to the end of the file.
sce# more subscribers_10.10.2008 include gold | append current_gold_subscribers
The CLI scripts feature allows you to record several CLI commands together as a script and play it back. This is useful for saving repeatable sequence of commands, such as software upgrade. For example, if you are configuring a group of SCE platforms and you want to run the same configuration commands on each platform, you could create a script on one platform and run it on all the other SCE platforms. The available script commands are:
•script capture
•script stop
•script print
•script run
Step 1 At the sce# prompt, type script capture filename.scr where filename.scr is the name of the script, with a scr file extension.
Step 2 Perform the actions you want to be included in the script.
Step 3 Type script stop.
The system saves the script.
The following is an example of recording a script for upgrading software.
sce#script capture upgrade.scr sce#configure SCE(config)#boot system new.pkg Verifying package file... Package file verified OK. SCE(config)#exit sce#copy running-config startup-config
Writing general configuration file to temporary location... Extracting files from `//apps/data/scos/images/new.pkg'... Verifying package file... Package file verified OK. Device `//apps/data/scos/' has 81154048 bytes free, 21447973 bytes are needed for extraction, all is well. Extracting files to temp locations... Renaming temp files... Extracted OK. Backing-up general configuration file... Copy temporary file to final location... sce#script stop sce#