Example 2-1 Context-Sensitive Help from User EXEC Mode

   

Router Components

Cisco routers have various components that are controlled by the Cisco IOS. These components include such things as memory, interfaces, and ports. Each component has a purpose that provides added functionality to a router. A review of these components will be useful in understanding each of their roles within a router.

Memory

A router contains different types of memory, where it can store images, configuration files, and microcode . The types of memory and their purposes are as follows :

  • RAM Often referred to as dynamic random-access memory (DRAM). RAM is the working area of memory storage used by the CPU to execute Cisco IOS software and to hold the running configuration file, routing tables, and ARP cache. The running configuration file (running-config) contains the current configuration of the software. Information in RAM is cleared when the router is power-cycled or reloaded.

  • ROM Sometimes referred to as erasable programmable read-only memory (EPROM). ROM is hard-wired read-only memory in the router. ROM contains power-on self-test (POST) diagnostics and the bootstrap or boot-loader software. This code allows the router to boot from ROM when it cannot find a valid Cisco IOS software image. This is known as ROM Monitor mode. This is a diagnostic mode that provides a user interface when the router cannot find a valid image.

  • Flash Available as EPROMs, single in-line memory modules (SIMMs), or PCMCIA cards. Flash is the default location where a router finds and boots its IOS image. On some platforms, additional configuration files or boot images can be stored in Flash. The contents of Flash are retained when the router is power-cycled or reloaded.

  • NVRAM Nonvolatile random-access memory. NVRAM stores the startup configuration file (startup-config), which is used during system startup to configure the software. In addition, NVRAM contains the software configuration register, a configurable setting in Cisco IOS software that determines which image to use when booting the router. The contents of NVRAM are retained when the router is power-cycled or reloaded.

Table 2-1 provides a summary of these memory types, their function, and useful Cisco IOS software commands when managing these different types of memory.

Table 2-1. Memory Types
Memory Type Contents Useful Cisco IOS Software Commands
RAM

Running configuration file

Routing tables

ARP cache

Working memory

show running-config

show ip route

show arp

show memory

ROM

POST

Bootstrap

ROM Monitor mode

Locate and load IOS

Flash IOS

Additional configuration files

Additional IOS images

show flash
NVRAM

Startup configuration file

Configuration register

show startup-config

show version

An understanding of the different types of memory and their function within the router helps not only clarify where the IOS image and configuration files are stored, but also proves useful by allowing the user to manipulate these configuration files during the configuration process and understand what area of memory is being changed.

Interfaces and Ports

Routers contain different types of interfaces and ports. Interfaces assist the router in routing packets and bridging frames between network segments, and they provide a connection point to different types of transmission media. Ports, on the other hand, provide management access to the router.

Some common interface types are as follows:

  • Serial

  • Ethernet

  • Token Ring

  • Asynchronous

  • FDDI

The preceding types of interfaces are some of the most common; however, interface types are in no way static. Interface types are added as new technologies evolve and methods are needed to interconnect and integrate network devices. An example of this is the voice interface available in the Cisco 2600 series that connects to a private branch exchange (PBX) or standard analog phone.

Ports on the router enable a user to connect to the router for management and configuration purposes. You can connect either a terminal (DTE) or a modem (DCE) to these ports. Some of the common ports are:

  • Console

  • Auxiliary (AUX)

The console and auxiliary ports are physical ports on the router that provide management access to the router. In addition to these, there are also vty lines, which are software-defined lines that allow Telnet access to the router. The default vty configuration is vty lines 0 through 4, allowing five simultaneous Telnet sessions to the router. Passwords can be configured on each vty line to secure access to the router.

Command-Line Interface

CLI is the acronym used by Cisco to denote the command-line interface of the IOS. CLI is the primary interface used to configure, manage, and troubleshoot Cisco devices. This user interface enables you to directly execute IOS commands, and it can be accessed through a console, modem, or Telnet connection. Access by any of these methods is generally referred to as an EXEC session.

EXEC Levels or Modes

Two different EXEC sessions exist, user EXEC level and privileged EXEC level. Each level provides a different amount of access to the commands within the IOS. User EXEC provides access to a limited number of commands that allow basic troubleshooting and monitoring of the router. Privileged EXEC level allows access to all router commands, such as configuration and management settings. Password protection to the privileged EXEC level is highly recommended to prevent unauthorized configuration changes from being made to the router. Upon initiating an EXEC session on the router, a user is placed in user EXEC mode. This is denoted in the router with the > promptfor example:

 Router> 

To change to the privileged EXEC level, type in the command enable, as shown:

 Router>  enable  Password: [  enable password  ] 

If an enable password has been set, the router prompts you for it. When you enter the correct enable password, the prompt changes from Router> to Router#. This indicates that you have successfully entered into privileged EXEC mode, as shown:

 Router> Password: [  enable password  ] Router# 

TIP

Enable passwords show up as clear text in the running configuration file. If this is undesirable for your environment, Cisco IOS software offers another optionencrypt the enable password using the enable secret command. Using the enable secret command ensures that the password is not displayed as clear text in the running configuration file.


IOS CLI Hierarchy

Cisco IOS software is structured in a hierarchical manner. It is important to understand this structure to successfully navigate within Cisco IOS software. As mentioned previously, there are two EXEC modes: user EXEC and privileged EXEC. Privileged EXEC mode is composed of various configuration modes:

  • Global configuration mode

  • Interface configuration mode

  • Router configuration mode

  • Line configuration mode

Figure 2-1 provides a visual breakdown of the configuration modes.

Figure 2-1. Cisco IOS Software CLI Hierarchy

graphics/02fig01.gif

Within each mode, certain commands are available for execution. Using the context-sensitive help, you can see a list of which commands are available. While navigating the CLI, the router prompt changes to reflect your current position within the CLI hierarchy. Table 2-2 summarizes the main command prompts within the CLI hierarchy.

Table 2-2. CLI Command Prompts by Mode
Command Prompt Mode IOS Command to Enter Command Mode Description
Router> User EXEC mode Default mode upon login Limited inspection of router information
Router # Privileged EXEC mode From Router>, type enable Detailed inspection, testing, debug, and configuration commands
Router(config)# Configuration mode From Router#, type config terminal High-level configuration or global configuration changes
Router (config-if)# Interface level (submenu of configuration mode) From Router(config)#, type interface [ interface name ]for example, Ethernet0 Interface-specific commands
Router (config-router)# Routing engine level (submenu of configuration mode) From Router(config)#, type router [ routing protocol ]for example, rip, igrp, and so forth Routing engine commands
Router (config-line)# Line level (submenu of configuration mode) From Router(config)#, type line [ port ]for example, aux0, console0, vty 0 4 Line-configuration commands
Context-Sensitive Help

In both user and privileged EXEC modes, you can see a listing of available commands by typing a question mark ( ? ) at the Router> or Router# prompts. This is referred to as context-sensitive help. Example 2-1 shows context-sensitive help from user EXEC mode.

 Router>  ?  Exec commands:   <1-99>           Session number to resume   access-enable    Create a temporary Access-List entry   clear            Reset functions   connect          Open a terminal connection   disable          Turn off privileged commands   disconnect       Disconnect an existing network connection   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   mrinfo           Request neighbor and version information from a multicast                    router   mstat            Show statistics after multiple multicast traceroutes   mtrace           Trace reverse multicast path from destination to source   name-connection  Name an existing network connection   pad              Open a X.29 PAD connection   ping             Send echo messages   ppp              Start IETF Point-to-Point Protocol (PPP)  --More-- 

Example 2-1 displays the commands available for execution from user EXEC mode. When the number of commands available exceed that which can be displayed on the screen, the IOS displays the --More-- prompt. Pressing the Spacebar presents the next page of commands, often followed by another --More-- until all remaining commands are displayed and you're returned to the Router> prompt, as demonstrated in Example 2-2.

Example 2-2 Hitting the Spacebar Continues the Context-Sensitive Help Listing and Returns You to the User EXEC Mode Prompt
 Logout           Exit from the EXEC   mrinfo           Request neighbor and version information from a multicast                    router   mstat            Show statistics after multiple multicast traceroutes   mtrace           Trace reverse multicast path from destination to source   name-connection  Name an existing network connection   pad              Open a X.29 PAD connection   ping             Send echo messages   ppp              Start IETF Point-to-Point Protocol (PPP)   resume           Resume an active network connection   rlogin           Open an rlogin connection   show             Show running system information   slip             Start Serial-line IP (SLIP)   systat           Display information about terminal lines   telnet           Open a telnet connection   terminal         Set terminal line parameters   tn3270           Open a tn3270 connection   traceroute       Trace route to destination   tunnel           Open a tunnel connection   where            List active connections   x3               Set X.3 parameters on PAD   xremote          Enter XRemote mode Router> 

You can repeat the same process to get a list of available commands from privileged EXEC mode. The only difference is that more commands are available within privileged EXEC mode.

To find out what commands are available that begin with the letter c, you would type the letter c immediately followed by a ?. This is referred to as word help, and it is useful when you know what the command begins with, but not the exact syntax. Example 2-3 demonstrates this concept.

Example 2-3 Using Word Help to Find the Exact Syntax of a Command
 Router#c  ?  clear  clock  configure  connect  copy 

As more letters are added to the command you need help for, the context-sensitive help feature narrows down the available commands to choose from. Example 2-4 demonstrates what you would see if you narrowed your search by adding additional letters such as co? or con?.

Example 2-4 Adding Characters in a Command Immediately Followed by a ? Helps You Narrow Your Command Search
 Router#  c?  clear  clock  configure  connect  copy Router#  co?  configure  connect  copy Router#  con?  configure  connect 

Suppose that you need more information on the syntax of the configure command. Command help is available to list arguments that are available with a given command by typing the command, followed by a space and a ?. For example, if you want to find out what commands were available to use with the configure command, you would type configure ?, as demonstrated in Example 2-5.

Example 2-5 Entering Characters in a Command Followed by ? Helps You Find the Exact Syntax of a Command
 Router#  configure ?  memory             Configure from NV memory   network            Configure from a TFTP network host   overwrite-network  Overwrite NV memory from TFTP network host   terminal           Configure from the terminal   <cr> 

Finally, the command parser has the capability to distinguish erroneous commands that are entered incorrectly, as well as prompt you when more specific command arguments are needed. When an erroneous command is entered, the help feature returns the output shown in Example 2-6.

Example 2-6 Entering an Erroneous Command Generates a Message to Indicate the Syntax Error
 Router#  show rnning-config  ^ % Invalid input detected at '^' marker. 

The ^ marker indicates where the error in the syntax occurred. When a more specific command argument is needed to distinguish among multiple possibilities, the help feature returns %Ambiguous command:, as shown in Example 2-7.

Example 2-7 Entering a Command Requiring More Specific Parameters Generates an Ambiguous Command Message
 Router#  show access  % Ambiguous command:  "show access" 

This is easily corrected by typing more of the command so that multiple possibilities no longer exist, as shown in Example 2-8.

Example 2-8 Entering a Command with the Required Arguments to Eliminate the Ambiguous Command Error
 Router#  show access-lists  Standard IP access list 1     permit any 

Each of these context-sensitive help features is useful in helping you determine whether the command syntax is incorrect.

Hot Keys

The CLI also provides hot keys for easier navigation within the IOS and provide shortcuts for editing functions. Table 2-3 provides a list of shortcuts that are available.

Table 2-3. CLI Hot Keys for Cisco IOS Software Command Editing Functions
Key Sequence Description
Ctrl-A Moves the cursor to the beginning of the current line
Ctrl-R Redisplays a line
Ctrl-U Erases a line
Ctrl-W Erases a word
Ctrl-Z Ends configuration mode and returns to privileged EXEC mode
Tab Finishes a partial command
Backspace Removes one character to the left of the cursor
Ctrl-P or Up Arrow Allows you to scroll forward through former commands
Ctrl-N or Down Arrow Allows you to scroll backward through former commands
Ctrl-E Moves the cursor to the end of the current line
Ctrl-F or right arrow Moves forward one character
Ctrl-B or left arrow Moves back one character
Esc+B Moves back one word
Esc+F Moves forward one word

   
Top


CCNA Practical Studies
CCNA Practical Studies (Cisco Certification & Training)
ISBN: 1587200465
EAN: 2147483647
Year: 2005
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net