Configuration Sub modes and Contexts

Configuration Sub modes and Contexts
 


The Cisco IOS Command-Line Interface is divided into many different command modes. Each command mode has its own set of commands available for the configuration, maintenance, and monitoring of router and network operations. The commands available to you at any given time depend on which mode you are currently in. Entering a question mark (?) at the system prompt (router prompt) allows you to obtain a list of commands available for each command mode.

The use of specific commands allows you to navigate from one command mode to another. The basic hierarchy of these command modes is as follows:
user EXEC mode->privileged EXEC mode->global configuration mode->
specific configuration modes->configuration submodes->configuration subsubmodes.

When you start a session on the router, you begin in user EXEC mode. For security purposes, only a limited subset of EXEC commands are available in user EXEC mode. This level of access is reserved for tasks which do not change the configuration of the router, like checking the router status.

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. Most of the EXEC commands are one-time commands, such as show commands, which show the current configuration status, and clear commands, which clear counters or interfaces. The EXEC commands are not saved across reboots of the router.

From privileged EXEC mode, you can enter global configuration mode. In global configuration mode, you can enter commands which configure general system characteristics. Global configuration mode is also used to enter specific configuration modes. Configuration modes allow you to make changes to the running configuration. If you later save the configuration, these commands are stored across router reboots.

From global configuration mode you can enter a variety of protocol-specific or feature-specific configuration modes. The CLI hierarchy requires that you enter these specific configuration modes only through global configuration mode. As an example, this chapter describes interface configuration mode, a commonly used configuration mode.

From configuration modes, you can enter configuration submodes. Configuration submodes are used for the configuration of specific features within the scope of the configuration mode. As an example, this chapter describes the subinterface configuration submode.

ROM monitor mode is a separate mode used when the router cannot boot properly. If your 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 may enter ROM monitor mode. You may also enter ROM monitor mode by using the Break key to interrupt system startup.

The above information is described in more detail in the following sections:

•User EXEC Mode

•Privileged EXEC Mode

•Global Configuration Mode

•Interface Configuration Mode

•Subinterface Configuration Mode

•ROM Monitor Mode

These sections are followed by a table (Table 1) which summarizes these command modes.

User EXEC Mode

After you log in to the router or access server, you are automatically in user EXEC command mode. The EXEC commands available at the user level are a subset of those available at the privileged level. In general, the user EXEC commands allow you to connect to remote devices, change terminal settings on a temporary basis, perform basic tests, and list system information.

To list the user EXEC commands, use the following command:

 
Command
Purpose

?

Lists the user EXEC commands.


The user-level prompt consists of the host name followed by the angle bracket (>):

Router>

The default host name is Router unless it has been changed during initial configuration using the setup command. Refer to the product user guide for information on the setup facility. You can also change the host name using the hostname global configuration command described in the "Basic System Management Commands" chapter in the Cisco IOS Configuration Fundamentals Command Reference.

To list the commands available in user EXEC mode, enter a question mark (?) as shown in the following example:

Router> ? 
Exec commands:
 <1-99>           Session number to resume
 connect          Open a terminal connection
 disconnect       Disconnect an existing telnet session
 enable           Turn on privileged commands
 exit             Exit from the EXEC
 help             Description of the interactive help system
 lat              Open a lat connection
 lock             Lock the terminal
 login            Log in as a particular user
 logout           Exit from the EXEC
 menu             Start a menu-based user interface
 mbranch          Trace multicast route for branch of tree
 mrbranch         Trace reverse multicast route to branch of tree
 mtrace           Trace multicast route to group
 name-connection Name an existing telnet connection
 pad              Open a X.29 PAD connection
 ping             Send echo messages
 resume           Resume an active telnet connection
 show             Show running system information
 systat           Display information about terminal lines
 telnet           Open a telnet connection
 terminal         Set terminal line parameters
 tn3270           Open a tn3270 connection
 trace            Trace route to destination
 where            List active telnet connections
 x3               Set X.3 parameters on PAD
 xremote          Enter XRemote mode

The list of commands will vary depending on the software feature set and which router platform you are using.

 

Note You can enter commands in uppercase, lowercase, or mixed case. Only passwords are case sensitive. However, it is a Cisco IOS documentation convention to always present commands in lowercase.


 

Privileged EXEC Mode

Because many of the privileged commands set operating parameters, privileged access should be password protected to prevent unauthorized use. The privileged command set includes those commands contained in user EXEC mode, as well as the configure command through which you can access the remaining command modes. Privileged EXEC mode also includes high-level testing commands, such as debug. 

The privileged EXEC mode prompt consists of the devices's host name followed by the pound sign (#), as shown in the following example:

Router#

 

Note Examples in Cisco IOS documentation assume the use of the default name of "Router". Different devices (for example, access servers) may use a different default name. If the router or access server has been named with the hostname command, that name will appear as the prompt instead of the default name.


To access and list the privileged EXEC commands, use the following commands:

 

 
 
Command
Purpose

Step 1 

Router> enable [password]

Enters the privileged EXEC mode.

Step 2 

Router# ?

Lists privileged EXEC commands.

 

If the system administrator has set a password, you are prompted to enter it before being allowed access to privileged EXEC mode. The password is not displayed on the screen and is case sensitive. If an enable password has not been set, enable mode can be accessed only from the router console. The system administrator uses the enable password  global configuration command to set the password that restricts access to privileged mode. This command is described in the "Passwords and Privileges Commands" chapter in the Cisco IOS Security Command Reference.

To return to user EXEC mode, use the following command:

 

 
Command
Purpose

Router# disable

Returns you to user EXEC mode from privileged EXEC mode.

 

The following example shows how to access privileged EXEC mode:

Router> enable
Password:letmein
Router# 

Note that the password will not be displayed as you type, but is shown here for illustrational purposes. From the privileged level, you can access global configuration mode, as described in the following section.

 

Global Configuration Mode

The term "global" is used to indicate characteristics or features that affect the system as a whole. Global configuration mode is used to configure your system globally, or to enter specific configuration modes to configure specific elements such as interfaces or protocols. Use the configure terminal privileged EXEC command to enter global configuration mode.

To access global configuration mode, use the following command in privileged EXEC mode:

 

 
Command
Purpose

Router# configure terminal

From privileged EXEC mode, enters global configuration mode.

 

The following example shows the process of entering global configuration mode from privileged EXEC mode:

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

Note that the system prompt changes to indicate that you are now in global configuration mode. The prompt for global configuration mode consists of the host-name of the device followed by (config) and the pound sign (#). To list the commands available in privileged EXEC mode, issue the ? command at the prompt.

Commands entered in global configuration mode update the running configuration file as soon as they are entered. In other words, changes to the configuration take effect each time you press the Enter or Return key at the end of a valid command. However, these changes are not saved into the startup configuration file until you issue the copy running-config startup-config EXEC mode command. This behavior is explained in more detail later in this document.

As shown in the example above, the system dialogue prompts you to end your configuration session (exit configuration mode) by pressing the Control (Ctrl) and "z" keys simultaneously; when you press these keys, ^Z is printed to the screen. You can actually end your configuration session by entering the Ctrl-Z key combination, using the end command, using the Ctrl-C key combination. The end command is the recommended way to indicate to the system that you are done with the current configuration session.

 

Warning If you use Ctrl-Z at the end of a command line in which a valid command has been typed, that command will be added to the running configuration file. In other words, using Ctrl-Z is equivalent to hitting the Enter (Carriage Return) key before exiting. For this reason, it is safer to end your configuration session using the end command. Alternatively, you can use the Ctrl-C key combination to end your configuration session without sending a Carriage Return signal.


You can also use the exit command to return from global configuration mode to EXEC mode, but this only works in global configuration mode. Pressing Ctrl-Z or entering the end command will always take you back to EXEC mode regardless of which configuration mode or configuration submode you are in.

To exit global configuration command mode and return to privileged EXEC mode, use one of the following commands:

 

 
Command
Purpose

Router(config)# end

or

Router(config)# ^Z

Ends the current configuration session and returns to privileged EXEC mode.

Router(config)# exit

Exits the current command mode and returns to the preceding mode. For example, exits from global configuration mode to privileged EXEC mode.

 

From global configuration mode, you can enter a number of protocol-specific, platform-specific, and feature-specific configuration modes. This appendix provides references to the appropriate documentation module for information about specific configuration modes.

Interface configuration mode, described in the following section, is an example of a configuration mode you can enter from global configuration mode.

Interface Configuration Mode

One example of a specific configuration mode you enter from global configuration mode is interface configuration mode.

Many features are enabled on a per-interface basis. Interface configuration commands modify the operation of an interface such as an Ethernet, FDDI, or serial port. Interface configuration commands always follow an interface global configuration command, which defines the interface type.

For details on interface configuration commands that affect general interface parameters, such as bandwidth, clock rate, and so on. For protocol-specific commands.

To access and list the interface configuration commands, use the following commands:

 

 
 
Command
Purpose

Step 1 

Router(config)# interface type number

From global configuration mode, enters interface configuration mode.

Step 2 

Router(config-if)# ?

Lists the interface configuration commands.

 

In the following example, serial interface 0 is about to be configured. The new prompt Router(config-if)# indicates interface configuration mode.

Router(config)# interface serial 0 
Router(config-if)#

To exit interface configuration mode and return to global configuration mode, enter the exit command.

Configuration submodes are configuration modes reached from other configuration modes (besides global configuration mode). Configuration submodes are for the configuration of specific elements in the configuration mode. One example of a configuration submode is subinterface configuration submode, described in the following section.

<>

Subinterface Configuration Submode

From interface configuration mode, you can enter subinterface configuration submode. In this submode you can configure multiple virtual interfaces (called subinterfaces) on a single physical interface. Subinterfaces appear to be distinct physical interfaces to the various protocols. For example, Frame Relay networks provide multiple point-to-point links called permanent virtual circuits (PVCs). PVCs can be grouped under separate subinterfaces that in turn are configured on a single physical interface. From a bridging spanning-tree viewpoint, each subinterface is a separate bridge port, and a frame arriving on one subinterface can be sent out on a another subinterface.

Subinterfaces also allow multiple encapsulations for a protocol on a single interface. For example, a router or access server can receive an ARPA-framed IPX packet and forward the packet back out the same physical interface as a SNAP-framed IPX packet.

To access and list the subinterface configuration commands, use the following commands:

 

 
 
Command
Purpose

Step 1 

See the example that follows. For information on interface commands that allow subinterface implementation, see the protocol specific chapter later in this publication.

From interface configuration mode, configures a virtual interface.

Step 2 

?

Lists the subinterface configuration commands.

 

In the following example, a subinterface is configured for serial line 2, which is configured for Frame Relay encapsulation. The subinterface is called 2.1 to indicate that it is subinterface 1 of serial interface 2. The new prompt Router(config-subif)# indicates that you are in subinterface configuration mode. The subinterface can be configured to support one or more Frame Relay PVCs.

Router(config)# interface serial 2
Router(config-if)# encapsulation frame-relay
Router(config-if)# interface serial 2.1
Router(config-subif)#

To exit subinterface configuration mode and return to global configuration mode, enter the exit command. To exit configuration mode and return to privileged EXEC mode, press Ctrl-Z.

 

ROM Monitor Mode

If your router or access server does not find a valid system image to load, the system will enter read-only memory (ROM) monitor mode. ROM monitor (ROMMON) mode can also be accessed by interrupting the boot sequence during startup. From ROM monitor mode, you can boot the device or perform diagnostic tests.

On most routers or access servers you can enter ROM monitor mode by entering the reload EXEC command and then pressing the Break key during the first 60 seconds of startup (the default ASCII configuration for Break is Ctrl-C).

To access and list the ROM monitor configuration commands, use the following commands:

 

 
 
Command
Purpose

Step 1 

reload

Begins reloading of system software image.

Step 2 

Press the Break key (default is Ctrl-C) during the first 60 seconds while the system is booting.

Interrupts the boot sequence and enters ROM monitor mode from privileged EXEC mode.

Step 3 

?

Lists the ROM monitor commands.

 

The ROM monitor mode is indicated by the angle bracket (>) prompt. On some Cisco routers the default ROM monitor prompt is rommon >. A list of ROM monitor commands are displayed when you enter the ? command or help command. The following example shows how this list of commands may appear:

User break detected at location 0x8162ac6\Å’
rommon 1 > ?
alias               set and display aliases command
boot                boot up an external process
break               set/show/clear the breakpoint
confreg             configuration register utility
cont                continue executing a downloaded image
context             display the context of a loaded image
cpu_card_type       display CPU card type
dev                 list the device table
dir                 list files in file system
dis                 disassemble instruction stream
frame               print out a selected stack frame
help                monitor builtin command help
history             monitor command history
meminfo             main memory information
repeat              repeat a monitor command
reset               system reset
set                 show all monitor variables
stack               produce a stack trace
sync                write monitor environment to NVRAM
sysret              print out info from last system return
unalias             unset an alias
unset               unset a monitor variable
rommon 2> 

The list of available commands will depend on the software image and platform you are using. Some versions of ROMMON will display a list of commands in an pre-aliased format such as the following:

> ?
$ state      Toggle cache state (? for help)
B [filename] [TFTP Server IP address | TFTP Server Name]
             Load and execute system image from ROM or from TFTP server
C [address]  Continue execution [optional address]
D /S M L V   Deposit value V of size S into location L with modifier M
E /S M L     Examine location L with size S with modifier M
G [address]  Begin execution
H            Help for commands
I            Initialize
K            Stack trace
L [filename] [TFTP Server IP address | TFTP Server Name]
             Load system image from ROM or from TFTP server, but do not
             begin execution
O            Show configuration register option settings
P            Set the break point
S            Single step next instruction
T function   Test device (? for help)
Deposit and Examine sizes may be B (byte), L (long) or S (short).
Modifiers may be R (register) or S (byte swap).
Register names are: D0-D7, A0-A6, SS, US, SR, and PC
 

To exit ROM Monitor mode, use the continue command or C command alias. If you have changed the configuration, use the copy running-config startup-config command to save your configuration changes, then issue the reload command.

 For Support