Table 1 - Glossary of Important Terms and Acronyms Used in This Tutorial
Table 1 - Glossary of Important Terms and Acronyms Used in This Tutorial
CLI Architecture
A Cisco IOS router command line interface can be accessed through either a console
connection, modem connection, or a telnet session. Regardless of which connection
method is used, access to the IOS command line interface is generally referred to as an
EXEC session.
As a security feature, Cisco IOS separates EXEC sessions into two different access
levels - user EXEC level and privileged EXEC level. User EXEC level allows a person
to access only a limited amount of basic monitoring commands. Privileged EXEC level
allows a person to access all router commands (e.g. configuration and management) and
can be password protected to allow only authorized users the ability to configure or
maintain the router.
For example, when an EXEC session is started, the router will display a "Router>"
prompt. The right arrow (>) in the prompt indicates that the router is at the user EXEC
level. The user EXEC level does not contain any commands that might control (e.g.
reload or configure) the operation of the router. To list the commands available at the
user EXEC level, type a question mark (?) at the Router> prompt. (This feature is
referred to as context sensitive help.)
Critical commands (e.g. configuration and management) require that the user be at the
privileged EXEC level. To change to the privileged EXEC level, type "enable" at the
Router> prompt. If an enable password is configured, the router will then prompt for
that password. When the correct enable password is entered, the router prompt will
change to "Router#" indicating that the user is now at the privileged EXEC level. To
switch back to user EXEC level, type "disable" at the Router# prompt. Typing a
question mark (?) at the privileged EXEC level will now reveal many more command
options than those available at the user EXEC level. The text below illustrates the
process of changing EXEC levels.
Router> enable
Password: [enable password]
Router# disable
Router>
Note: For security reasons, the router will not echo the password that is entered. Also,
be advised that if configuring a router via telnet, the password is sent in clear text.
Telnet does not offer a method to secure packets.
Once an EXEC session is established, commands within Cisco IOS are hierarchically
structured. In order to successfully configure the router, it is important to understand
this hierarchy. To illustrate this hierarchy, Figure 1 provides a simple high-level
schematic diagram of some IOS commands.
Command options and applications vary depending on position within this hierarchy.
Referring to the diagram in figure 1, configuration command options will not be
available until the user has navigated to the configuration branch of the IOS CLI
structure. Once in the configuration branch, a user may enter system level configuration
commands that apply to the entire router at the global configuration level. Interface
specific configuration commands are available once the user has switched to the
particular interface configuration level. More detailed information and examples on how
to navigate through the IOS CLI hierarchy are offered in the Router Configuration
section.
To assist users in navigation through IOS CLI, the command prompt will change to
reflect the position of a user within the command hierarchy. This allows users to easily
identify where within the command structure they are at any given moment. Table 2 is a
summary of command prompts and the corresponding location within the command
structure.
Cisco IOS CLI offers context sensitive help. This is a useful tool for a new user because
at any time during an EXEC session, a user can type a question mark (?) to get help.
Two types of context sensitive help are available - word help and command syntax help.
Word help can be used to obtain a list of commands that begin with a particular
character sequence. To use word help, type in the characters in question followed
immediately by the question mark (?). Do not include a space before the question mark.
The router will then display a list of commands that start with the characters that were
entered. The following is an example of word help:
Router# co?
configure connect copy
Command syntax help can be used to obtain a list of command, keyword, or argument
options that are available based on the syntax the user has already entered. To use
command syntax help, enter a question mark (?) in the place of a keyword or argument.
Include a space before the question mark. The router will then display a list of available
command options with <cr> standing for carriage return. The following is an example
of command syntax help:
Router# configure ?
memory Configure from NV memory
network Configure from a TFTP network host
overwrite-network Overwrite NV memory from TFTP network host=20
terminal Configure from the terminal
<cr>
If a command is entered improperly (e.g. typo or invalid command option), the router
will inform the user and indicate where the error has occurred. A caret symbol (^) will
appear underneath the incorrect command, keyword, or argument. The following
example displays what happens if the keyword "ethernet" is spelled incorrectly.
Router(config)#interface ethernat
^
% Invalid input detected at '^' marker.
Command Abbreviation
Commands and keywords can be abbreviated to the minimum number of characters that
identifies a unique selection. For example, you can abbreviate the "configure" command
to "conf" because "configure" is the only command that begins with "conf". You could
not abbreviate the command to "con" because more than one command could fit this
criteria. The router will issue the following error message if you do not supply enough
characters.
cisco(config)#i
% Ambiguous command: "i"
Hot Keys
For many editing functions, the IOS CLI editor provides hot keys. The following table
lists some editing shortcuts that are available.
Router Configuration
Entering Configurations
Perhaps the best way to illustrate IOS CLI navigation is by walking through a simple
router configuration. The comments in the example do not attempt to explain the
meaning of each individual command, but rather intend to display where configuration
commands are entered within the IOS command structure. Pay particular attention to
how the command prompt changes as the user navigates through the IOS CLI hierarchy.
Also notice that global parameters are configured at the global configuration level
(indicated by the "Router(config)#" prompt) whereas interface specific commands are
entered after switching to the particular interface (indicated by the "Router(config-if)#"
prompt). Global parameters and interface parameters are discussed further in the
Displaying Configurations section under Router Management.
Routers ship from the factory with all interfaces deactivated. Deactivated interfaces are
referred to as being in a shutdown state. Before an interface can be used, it must be
taken out of the shutdown state. To take an interface out of shutdown, type "no
shutdown" at the appropriate interface configuration level. The example above includes
these commands for both the ethernet and serial interfaces.
Saving Configurations
A Cisco IOS router stores configurations in two locations - RAM and NVRAM. The
running configuration is stored in RAM and is used by the router during operation. Any
configuration changes to the router are made to the running-configuration and take
effect immediately after the command is entered. The startup-configuration is saved in
NVRAM and is loaded into the router's running-configuration when the router boots up.
If a router loses power or is reloaded, changes to the running configuration will be lost
unless they are saved to the startup-configuration. To save the running-configuration to
the startup configuration, type the following from privileged EXEC mode (i.e. at the
"Router#" prompt.)
Note: Prior to 11.x software, the command to save the running-configuration to the
startup-configuration was different. Use the following command if your IOS version is
prior to 11.x:
Router#write memory
troubleshooting document.
Displaying Configurations
Router#show running-config
Router#show startup-config
The following is the show running-config output from the example used in the Router
Configuration section.
Current configuration:
!
version 11.2
!
hostname cisco
!
enable password cisco
!
interface Ethernet0
ip address 10.1.1.1 255.0.0.0
!
interface Serial0
ip address 20.2.2.2 255.0.0.0
!
router rip
network 10.0.0.0
network 20.0.0.0
!
ip route 0.0.0.0 0.0.0.0 20.2.2.3
!
line vty 0 4
password telnet
login
!
end
When displaying a configuration, the exclamation marks (!) function as line separators
to make reading easier. Referring to the above example, notice how commands entered
at the interface configuration level appear indented underneath the respective interface
(e.g. interface Ethernet0). Likewise, commands entered underneath the routing engine
configuration level appear indented underneath the routing engine (e.g. router rip).
Global level commands are not indented. This type of display allows a user to easily
identify which configuration parameters are set at the global configuration level and
which are set at the various configuration sub-levels.
Note: If an interface was in a shutdown state, the word 'shutdown' would appear
indented under the particular interface in shutdown state. Also, commands that are
enabled by default are not displayed in the configuration listing.
The show version command provides a lot of information in addition to the version of
software that is running on the router. The following information can be collected with
the show version command:
To view information about a particular interface, use the show interface command. The
show interface command provides the following list of important information: