Cisco Service and Application Module for IP User Guide
Using the Command Line Interfaces
Downloads: This chapterpdf (PDF - 158.0KB) The complete bookPDF (PDF - 3.24MB) | Feedback

Using the Command-Line Interfaces

Table Of Contents

Using the Command-Line Interfaces

Using the Supervisor and SAMI Cisco IOS PPC CLI

Getting Help

Understanding Cisco IOS Command Modes

Command-Line Completion

Undoing a Command or Feature

Saving Configuration Changes

Using the Cisco SAMI LCP and COSLI PPC CLIs

Using the SAMI LCP and COSLI PPC CLI Commands

Getting CLI Help

Using the ROM-Monitor CLI


Using the Command-Line Interfaces


This appendix describes how to use the various command-line interfaces (CLI) from which you configure and monitor the SAMI.

To implement and maintain a Cisco SAMI in your Cisco 7600 Series Router, and configure the Cisco IOS mobile wireless application running on the SAMI PPCs, you use the command-line interfaces of the following components:

Supervisor

SAMI LCP

SAMI Cisco IOS PPC

SAMI COSLI PPC


Note The CLI of the supervisor and SAMI PPCs is the standard Cisco IOS software CLI. The CLI of the SAMI LCP and the SAMI COSLI PPC is a line-oriented user interface that uses similar syntax and other conventions to the Cisco IOS CLI, but the SAMI LCP and COSLI PPC operating system is not a version of Cisco IOS software. Therefore, do not assume that a Cisco IOS command works or has the same function when executed from the SAMI LCP console.


For information about establishing a session with each of these CLIs, see the "Establishing Console Sessions" section.

For overview information on using various CLIs, see the following sections:

Using the Supervisor and SAMI Cisco IOS PPC CLI

Using the Cisco SAMI LCP and COSLI PPC CLIs

Using the ROM-Monitor CLI

Using the Supervisor and SAMI Cisco IOS PPC CLI

This section is intended as a quick reference, not as a step-by-step explanation of using the Cisco IOS software command line interface on the supervisor console, and the Cisco IOS PPC console.

For a list of the Cisco IOS supervisor and SAMI Cisco IOS PPC commands, see "Supervisor Console Commands" and "SAMI Cisco IOS PPC Commands."

This section includes the following topics about using the Supervisor and SAMI Cisco IOS PPC consoles:

Getting Help

Understanding Cisco IOS Command Modes

Command-Line Completion

Undoing a Command or Feature

Saving Configuration Changes

If you have never used the Cisco IOS software, or need a refresher, take a few minutes to read this section before you proceed to the command reference section. Understanding these concepts saves you time as you begin to use the CLI.

Getting Help

Use the question mark (?) and arrow keys to help you enter commands:

For a list of available commands, enter a question mark:

Sup> ?
 
   

To complete a command (see the "Command-Line Completion" section), enter a few known characters followed by a question mark (with no space):

Sup> s?
 
   

For a list of command variables, enter the command followed by a space and a question mark:

Sup> show ?
 
   

To re-display a command you previously entered, press the up arrow key. You can continue to press the up arrow key for more commands.


Note If a hostname is already configured, the hostname appears at the prompt instead of router or sup.


Understanding Cisco IOS Command Modes

Two primary modes of operation exist within the Cisco IOS software (running on the supervisor and SAMI PPC): user EXEC mode and privileged EXEC mode. When you first connect to the router, you are placed in the user EXEC mode.

The show commands in user EXEC mode are limited to a few basic levels. You cannot edit or view configurations at this stage; you can only view the router status and other miscellaneous information.

Editing the router's configuration requires you to be in privileged EXEC mode. To enter this mode, use the enable command (Table A-1).

You can always tell whether you are in user EXEC mode or privileged EXEC mode by looking at the router prompt. User EXEC mode has a > at the end; privileged EXEC mode prompt has a # at the end.

In privileged EXEC mode, the user interface is further divided into different submodes. Each command mode permits you to configure different components on your router. The commands available at any given time depend on which mode you are currently in. Entering a question mark (?) at the prompt displays a list of commands available for each command mode.


Tip If you are familiar with UNIX, you can equate privileged EXEC mode to "root" access. You could also equate it to the administer level in Windows 2000/NT. In this mode, you have permission to access information inside the router, including configuration commands. However, you cannot type configuration commands directly. Before you can change the router's configuration, you must enter the global configuration mode of privileged EXEC mode by entering the command configure terminal (Table A-1).


Table A-1 Common Command Modes

Command Mode
Access Method
Router Prompt Displayed
Exit Method

User EXEC

Log in.

Router>

Use the logout command.

Privileged EXEC

From user EXEC mode, enter the enable command.

Router#

To exit to user EXEC mode, use the disable, exit, or logout command.

Global configuration

From the privileged EXEC mode, enter the configure terminal command.

Router(config)#

To exit to privileged EXEC mode, use the exit or end command, or press Ctrl-Z.

Interface configuration

From the global configuration mode, enter the interface type number command, such as interface serial 0/0.

Router(config-if)#

To exit to global configuration mode, use the exit command.

To exit directly to privileged EXEC mode, press Ctrl-Z.



Timesaver Each command mode restricts you to a subset of commands. If you experience trouble entering a command, check the prompt, and enter the question mark (?) for a list of available commands. You might be in the incorrect command mode, or using the incorrect syntax.


In the following example, notice how the prompt changes after each command to indicate a new command mode:

Sup> enable
Password: <enable password>
Sup# configure terminal
Enter configuration commands one per line. End with CNTL/Z.
Sup(config)# interface gigabitEthernet 0/0 
Sup(config-if)# no shutdown
Sup(config-if)# exit
Sup(config)# exit
Sup# DEC 24 07:16:15:079 %SYS-5-CONFIG_I: Configured from console by console
 
   

The last message is normal and does not indicate an error. Press Return to get the Router# prompt.


Note You can press Ctrl-Z in any mode to immediately return to privileged EXEC mode (Router#), instead of entering exit, which returns you to the previous mode.


Command-Line Completion

Command-line completion makes the Cisco IOS software CLI more user-friendly. It saves you keystrokes and assists if you cannot remember a command syntax.

In the following example, notice how the command configure terminal is done:

Sup> enable
Password: <enable password>
Sup# config t
Sup(config)# 
 
   

The Cisco IOS software expands the command config t to configure terminal.

Another form of command-line completion is the use of the Tab key. If you start a command by entering the first few characters, you can press the Tab key. As long as there is only one match, the Cisco IOS software completes the command: for example, if you key in sh and press Tab, the Cisco IOS software completes the sh with show. If Cisco IOS software does not complete the command, you can enter a few more letters and try again.

Undoing a Command or Feature

To undo a command you entered or to disable a feature, enter the keyword no before most commands; for example, no ip routing.

Saving Configuration Changes

To save your configuration changes to a configuration file stored on the supervisor, so the changes are not lost if a system reload or power outage occurs, you must enter the copy running-config startup-config or write memory commands .

For example:

Sup# copy running-config startup-config
Building configuration...
or
Sup# write memory
Building configuration...
 
   

It might take a minute or two to save the configuration to the supervisor. After the configuration is saved, the following appears:

[OK]
Sup#
 
   

Now that you have learned some Cisco IOS software basics, you can begin to configure SAMI in your router using the Cisco IOS software CLI on the supervisor engine and the SAMI PPCs.

Remember that:

You can use the question mark (?) and arrow keys to help you enter commands.

Each command mode restricts you to a set of commands. If you have difficulty entering a command, check the prompt and then enter the question mark (?) for a list of available commands. You might be in the wrong command mode or using the wrong syntax.

To disable a feature, enter the keyword no before the command; for example, no ip routing.

You must save your configuration changes to NVRAM so the changes are not lost if there is a system reload or power outage.

To begin configuring the SAMI, proceed to the "Configuring the Cisco SAMI" chapter.

Using the Cisco SAMI LCP and COSLI PPC CLIs


Note For a list of the Cisco SAMI COSLI LCP commands, see "SAMI COSLI PPC Commands." For a list of Cisco SAMI PPC commands, see "SAMI LCP Commands."


When you log in to the SAMI LCP or a SAMI COSLI PPC, by default you are in EXEC mode. The EXEC mode prompt begins with the hostname, followed by the pound sign (#).

switch#
 
   

EXEC mode has a set of commands allowing you to perform maintenance procedures. To access configuration mode, use the configure command. This mode is identified by a (config) prompt. For example:

switch# configure
switch(config)#
 
   

Configuration mode has a set of commands allowing you to configure the SAMI LCP or COSLI PPC, and access subordinate configuration modes. When you access any of the subordinate configuration modes, the mode name is appended to the (config) prompt. For example, when you access interface configuration mode from configuration mode, the prompt changes to (config-if).

To exit a configuration mode and access the previous mode, use the exit command. To exit any configuration mode and return to EXEC mode, press Ctrl-Z or use the end command.

Using the SAMI LCP and COSLI PPC CLI Commands

Table A-2 lists CLI keyboard shortcuts to help you enter and edit command lines on the SAMI LCP or SAMI COSLI PPCs. For further information on using the CLI commands, see the following sections:

Editing the Command Line

Using EXEC Mode Commands in a Configuration Mode

Understanding CLI Syntax Checking and Error Messages

Using the Question Mark (?)

Using the Tab Key

Table A-2 CLI Command Keyboard Shortcuts 

Action
Keyboard Shortcut

Cancel the current operation, additional display of MORE output, or delete the current line.

Ctrl-C

Change

The word at the cursor to lowercase.

Esc-L

The word at the cursor to uppercase.

Esc-U

Delete

A character to the left of the cursor.

Ctrl-H, Delete, or Backspace

All characters from the cursor to the beginning of the line.

Ctrl-U

All characters from the cursor to the end of the line.

Ctrl-K

All characters from the cursor to the end of the word.

Esc-D

The word to left of the cursor.

Ctrl-W or Esc-Backspace

Display the buffers

Next line.

Ctrl-N or Down-Arrow

Previous line.

Ctrl-P or Up-Arrow

Display MORE output

Exit from MORE output.

q, Q, or Ctrl-C

Next additional screen. The default is one screen. To display more than one screen, enter a number before pressing the Spacebar.

Spacebar

Next line. The default is one line. To display more than one line, enter the number before pressing the Enter key.

Enter

Enter an Enter or Return key character.

Ctrl-M

Expand the command or abbreviation.

Ctrl-I or Tab

Move the cursor

One character to the left (back).

Ctrl-B or Left Arrow

One character to the right (forward).

Ctrl-F or Right Arrow

One word to the left (back), to the beginning of current or previous word.

Esc-B

One word to the right (forward), to the end of the current or next word.

Esc-F

To the beginning of the line.

Ctrl-A

To the end of the line.

Ctrl-E

Redraw screen at the prompt.

Ctrl-L or Ctrl-R

Return to the EXEC mode from any configuration mode.

Ctrl-Z

Return to the previous mode or exit from the CLI from EXEC mode.

exit command

Transpose a character at the cursor with a character to left of the cursor.

Ctrl-T


Editing the Command Line

The SAMI LCP or SAMI COSLI CLI allows you to view all previously entered commands with the up arrow. After you examine a previously-entered command, you can move forward in the list using the down arrow.

When you view a command you wish to reuse, you can edit it or press the Enter key to execute it.

Using EXEC Mode Commands in a Configuration Mode

When you are in a configuration mode, you may need to use a show command or any other command that is only available in EXEC mode. To enter an EXEC command in any configuration mode, use the do command. The syntax for this command is:

do exec_command_string

The exec_command_string argument is the EXEC mode command you want to execute.

For example, to display the running configuration in configuration mode, enter:

switch(config)# do show running-config

Understanding CLI Syntax Checking and Error Messages

If you enter an invalid or incomplete command, the CLI responds with a pointer (^) and an error message. The following example shows the CLI response when you enter an invalid command:

switch# test
            ^
% invalid command detected at `^' marker.
 
   

The following example shows the CLI response when you enter an incomplete command:

switch(config)# interface 
                             ^
% incomplete command detected at `^' marker.

Getting CLI Help

The CLI provides several types of context-sensitive help, as described in the following sections:

Using the Question Mark (?)

Using the Tab Key

Using the Question Mark (?)

The question mark (?) character allows you to get the following type of help about a command at the command line:

Question Mark Usage
Command Help Type

? at command prompt

All commands for that mode

command ?

Any keywords, options, or object names for a command

command keyword ?

Any keywords, options, or object names for a command

command-abbrev ?

All commands that begin with specific letters


Using the Tab Key

When you press the Tab key or Ctrl-I at the end of a unique command or option abbreviation, the CLI completes the command or options for you. For example:

switch# sh<Tab> 
switch# show
 
   

Pressing the Tab key or Ctrl-I keys also completes an option up to the point where it is unique. If multiple commands have the same abbreviation that you entered, the CLI lists all of these commands.

Using the ROM-Monitor CLI

The ROM-monitor is a ROM-based program that executes upon platform power-up, reset, or when a fatal exception occurs. The router enters ROM-monitor mode if it does not find a valid software image, if the NVRAM configuration is corrupted, or if the configuration register is set to enter ROM-monitor mode. From the ROM-monitor mode, you can load a software image manually from flash memory, from a network server file, or from bootflash.

You can also enter ROM-monitor mode by restarting and pressing the Break key during the first 60 seconds of startup.


Note The Break key is always enabled for 60 seconds after rebooting, regardless of whether the Break key is configured to be off by configuration register settings.


After you are in ROM-monitor mode, the prompt changes to rommon 1>. Enter a question mark (?) to see the available ROM-monitor commands.