Using Command-Line Interface

Revised: November, 2014

 

This chapter provides information for understanding the Cisco ASR 901 series router using the command-line interface (CLI). This chapter includes the following sections:

For an overview of the Cisco ASR 901 series router, refer to the Cisco ASR 901 Series Aggregation Services Router Software Configuration Guide.

Getting Help

To obtain a list of commands that are available for each command mode, enter a question mark (?) at the system prompt. You also can obtain a list of any command’s associated keywords and arguments with the context-sensitive help feature.

Table 1-1 lists commands you can enter to get help that is specific to a command mode, a command, a keyword, or an argument.

 

Table 1-1 Getting Help

Command
Purpose

abbreviated-command-entry ?

Obtain a list of commands that begin with a particular character string. (Do not leave a space between the command and question mark.)

abbreviated-command-entry < Tab >

Complete a partial command name.

?

List all commands available for a particular command mode.

command ?

List a command’s associated keywords. Leave a space between the command and question mark.

command keyword ?

List a keyword’s associated arguments. Leave a space between the keyword and question mark.

How to Find Command Options

This section provides an example of how to display syntax for a command. The syntax can consist of optional or required keywords. To display keywords for a command, enter a question mark (?) at the configuration prompt or after entering part of a command followed by a space. The Cisco ASR 901 series router software displays a list of available keywords along with a brief description of the keywords. For example, if you are in global configuration mode and want to see all the keywords for the cem command, you enter cem ?.

Table 1-2 shows examples of how you can use the question mark (?) to assist you in entering commands and also guides you through entering the following command:

  • interface gigabitethernet 0/1

 

Table 1-2 How to Find Command Options

Command
Comment
Router> enable
Password: <password>
Router#

Enter the enable command and password to access privileged EXEC commands.

You are in privileged EXEC mode when the prompt changes to Router#.

Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#

Enter global configuration mode.

You are in global configuration mode when the prompt changes to Router(config)#.

Router(config)# interface gigabitethernet ?
<1-9> GigabitEthernet interface number
Router(config)# interface gigabitethernet 0/1
Router(config-if)#

Enter interface configuration mode by specifying the Gigabit Ethernet interface that you want to configure using the interface gigabitethernet global configuration command.

Enter a ? to display what you must enter next on the command line. In this example, you must enter an interface number from 1 to 9 in the format module-number / port-number.

You are in interface configuration mode when the prompt changes to Router(config-if)#.

Router(config-if)# ?
Interface configuration commands:
access-expression Build a bridge boolean access expression
arp Set arp type (arpa, probe, snap) or timeout
backup Modify backup parameters
bandwidth Set bandwidth informational parameter
bgp-policy Apply policy propogated by bgp community string
bridge-group Transparent bridging interface parameters
carrier-delay Specify delay for interface transitions
cdp CDP interface subcommands
channel-group Etherchannel/port bundling configuration
clns CLNS interface subcommands
cmns OSI CMNS
custom-queue-list Assign a custom queue list to an interface
decnet Interface DECnet config commands
default Set a command to its defaults
delay Specify interface throughput delay
description Interface specific description
dlsw DLSw interface subcommands
dspu Down Stream PU
exit Exit from interface configuration mode
fair-queue Enable Fair Queuing on an Interface
flowcontrol Configure flow operation.
fras DLC Switch Interface Command
help Description of the interactive help system
hold-queue Set hold queue depth
ip Interface Internet Protocol config commands
ipx Novell/IPX interface subcommands
isis IS-IS commands
iso-igrp ISO-IGRP interface subcommands
 
.
.
.
 
Router(config-if)#

Enter a ? to display a list of all the interface configuration commands available for the Gigabit Ethernet interface.

Understanding Command Modes

The Cisco ASR 901 series router Cisco IOS user interface is divided into many different modes. The commands that are available to you depend on which mode you are currently in. You can obtain a list of commands that are available for each command mode by entering a question mark (?) at the system prompt.

When you start a session on the Cisco ASR 901 series router, you begin in user mode, often called EXEC mode. Only a limited subset of the commands are available in EXEC mode. In order to have access to all commands, you must enter privileged EXEC mode. Normally, you must enter a password to enter privileged EXEC mode. From privileged EXEC mode, you can enter any EXEC command or enter global configuration mode. Most EXEC commands are one-time commands, such as show commands, which show the current status of a given item, and clear commands, which clear counters or interfaces. The EXEC commands are not saved across reboots of the Cisco ASR 901 series router.

The configuration modes allow you to make changes to the running configuration. If you later save the configuration, these commands are stored across Cisco ASR 901 series router reboots. In order to get to the various configuration modes, you must start at global configuration mode where you can enter interface configuration mode, subinterface configuration mode, and a variety of protocol-specific modes.

ROM-monitor mode is a separate mode that is used when the Cisco ASR 901 series router cannot boot properly. If your Cisco ASR 901 series router or access server does not find a valid system image when it is booting, or if its configuration file is corrupted at startup, the system might enter ROM-monitor mode.

Table 1-3 provides a summary of the main command modes.

 

Table 1-3 Summary of Main Command Modes

Command Mode
Access Method
Prompt
Exit Method

User EXEC

Log in.

Router>

Use the logout command.

Privileged EXEC

From user EXEC mode, enter the enable EXEC command.

Router#

To exit to user EXEC mode, enter the disable command.

To enter global configuration mode, enter the configure terminal privileged EXEC command.

Global configuration

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

Router(config)#

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

To enter interface configuration mode, enter an interface configuration command.

Interface configuration

From global configuration mode, enter by specifying an interface with an interface command.

Router(config-if)#

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

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

To enter subinterface configuration mode, specify a subinterface with the interface command.

For more information on command modes, refer to the “Using the Command Line Interface” chapter of the Configuration Fundamentals Configuration Guide.

Using the No and Default Forms of Commands

Almost every configuration command has a no form. In general, enter the no form to disable a function. Use the command without the keyword no to reenable a disabled function or to enable a function that is disabled by default. For example, IP routing is enabled by default. To disable IP routing, specify the no ip routing command and specify ip routing to reenable it. This publication provides the complete syntax for the configuration commands and describes what the no form of a command does.

Configuration commands can have a default form. The default form of a command returns the command setting to its default. Most commands are disabled by default, so the default form is the same as the no form. However, some commands are enabled by default and have arguments that are set to certain default values. In these cases, the default form of the command enables the command and sets arguments to their default values. This publication describes what the default form of a command does if the command is not the same as the no form.

Saving Configuration Changes

To save your configuration changes to your startup configuration so that they will not be lost if there is a system reload or power outage, enter the following command:

Router# copy system:running-config nvram:startup-config
Building configuration...
 

It might take a minute or two to save the configuration. After the configuration has been saved, the following output appears:

[OK]
Router#