Image of Jeremy L. Gaddis, CCNA, CCNP (and Cortney, in case you were wondering)

Cisco IOS Context-Sensitive Help

by Jeremy L. Gaddis on September 6, 2011 · 0 comments

Post image for Cisco IOS Context-Sensitive Help

To get started working with the CLI, we learned some basic IOS commands. These commands are fairly simplistic and, because you’ll use them so much, easy to remember.

There are lots of commands that you’ll learn that you don’t use very often. For this reason, sometimes we forget the exact parameters that we need to pass to a command or perhaps forget which order they go in (such as with EIGRP). Fortunately, IOS has a help system built-in to help us out and keep us from having to dig out our copy of the CCNA Portable Command Guide.

Help Me, Router
Help, Help Me, Router

The context-sensitive help built into the Cisco IOS software gives us a list of the commands available to us as well as the arguments that we can pass to those commands. It’s called context-sensitive because the list of commands is presented within the context of the current IOS mode.

You’ve already learned a few basic IOS commands but, as you might guess, there are a whole lot more. How could we possibly find out what all of them are? It’s simple, just ask IOS!

We can obtain help at any time in the CLI by pressing the ? key. It’s easier to demonstrate than explain — and you’ll understand it a lot quicker — so let’s take a look, shall we?

In user executive mode, simply press ? at the prompt. You should see output similar to the following:

Router> ?
Exec commands:
  access-enable    Create a temporary Access-List entry
  access-profile   Apply user-profile to interface
  clear            Reset functions
  connect          Open a terminal connection
  crypto           Encryption related commands.
  disable          Turn off privileged commands
  disconnect       Disconnect an existing network connection
  enable           Turn on privileged commands
  ethernet         Ethernet parameters
  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
  modemui          Start a modem-like user interface
  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
 --More--

NOTE: As I mentioned in a previous article, Introduction to Cisco Devices and Cisco IOS, the commands available depend on the feature set and version of IOS. For this reason, the commands you see listed on your own router may vary slightly from what you see in the output displayed here.

On the left, we see a list of commands that we can issue to the router along with a description of each command’s purpose on the right. Looking through the list, you should recognize at least a few of them:

  disable          Turn off privileged commands
  enable           Turn on privileged commands

Remember those? They allow us to switch back and forth between user exec mode and privileged exec mode, like we discussed in The Cisco CLI: IOS Modes.

Notice that “--More--” prompt at the bottom of the screen? Whenever the output from a command won’t fit on a single screen, Cisco IOS will paginatethe output and display this prompt. When this happens, you can do one of three things:

  • press <SPACE> to display the next screen of output,
  • press <ENTER> to display the next line of output, or
  • press any other key to cancel and return to the prompt

Go ahead and press the space bar to see the next screenful of output:

  pad              Open a X.29 PAD connection
  ping             Send echo messages
  ppp              Start IETF Point-to-Point Protocol (PPP)
  release          Release a resource
  renew            Renew a resource
  resume           Resume an active network connection
  rlogin           Open an rlogin connection
  set              Set system parameter (not config)
  show             Show running system information
  slip             Start Serial-line IP (SLIP)
  ssh              Open a secure shell client connection
  systat           Display information about terminal lines
  tclquit          Quit Tool Command Language shell
  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
  udptn            Open an udptn connection
  where            List active connections
  x28              Become an X.28 PAD
  x3               Set X.3 parameters on PAD

Router>

The rest of the output fit on the screen this time so the router finishes up and returns us to the prompt.

We’ve learned a few show commands already:

  • show running-configuration
  • show version
  • show ip interface brief
  • show interface

I know what you’re thinking, though. You’re wondering what other show commands are available, aren’t you? Well, today is your lucky day because we can get a list of all of them! To do that, simply type show at the prompt, followed by the space bar, and then press the ? key. Your output should look something like this:

Router> show ?
  aaa               Show AAA values
  acircuit          Access circuit info
  adjacency         Adjacent nodes
  alps              Alps information
  appfw             Application Firewall information
  arp               ARP table
  auto              Show Automation Template
  backup            Backup status
  bfd               BFD protocol info
  bgp               BGP information
  bootvar           Boot and related environment variable
  calendar          Display the hardware calendar
  call              Show call
  caller            Display information about dialup connections
  capability        Capability Information
  cca               CCA information
  cdapi             CDAPI information
  cdp               CDP information
  class-map         Show QoS Class Map
  clock             Display the system clock
  cns               CNS agents
  compress          Show compression statistics
 --More--

Go ahead and press the spacebar a few times to scroll through the rest of the list. Feel free to try out a few of them if you’d like, just issue the appropriate show <argument> command, such as:

Router> show clock
*20:53:57.591 EST Fri Sep 2 2011

Context-Sensitive Help

Near the beginning of this article, I wrote:

It’s called context-sensitive because the list of commands is given to us within the context of the current IOS mode.

To understand what this means, let’s switch into privileged exec (“enable”) mode and look at what show commands are available:

Router> enable
Router# show ?
 aaa                       Show AAA values
 access-expression         List access expression
 access-lists              List access lists
 accounting                Accounting data for active sessions
 acircuit                  Access circuit info
 adjacency                 Adjacent nodes
 aliases                   Display alias commands
 alps                      Alps information
 appfw                     Application Firewall information
 appletalk                 AppleTalk information
 arap                      Show Appletalk Remote Access statistics
 archive                   Archive functions
 arp                       ARP table
 async                     Information on terminal lines used as router
                           interfaces
 auto                      Show Automation Template
 backhaul-session-manager  Backhaul Session Manager information
 backup                    Backup status
 beep                      Show BEEP information
 bfd                       BFD protocol info
 bgp                       BGP information
 bootvar                   Boot and related environment variable
--More--

If you compare these commands with the ones from user exec mode, you’ll notice some differences. For example, let’s compare the first five commands from user exec mode with the first five from privileged exec mode.

User exec mode:

  aaa               Show AAA values
  acircuit          Access circuit info
  adjacency         Adjacent nodes
  alps              Alps information
  appfw             Application Firewall information

Privileged exec mode:

 aaa                       Show AAA values
 access-expression         List access expression
 access-lists              List access lists
 accounting                Accounting data for active sessions
 acircuit                  Access circuit info

Out of the first five commands available in privileged exec mode, three of them weren’t listed in user exec mode! This is what is meant by context-sensitive help. Because those commands are not available to us in user exec mode, IOS does not show them in the list. It is only when we are in privileged exec mode that they show up.

Go ahead and explore a bit more if you’d like. Browse through the list of available show commands and run a few of them. I’ll wait, I promise.

I’m sorry Dave, I’m afraid I can’t do that

When we issue a command to a router or switch, it works from left to right to figure out what we want it to do. If it understands our command, it will execute it and, if appropriate, display output.

If you’ve used Linux or UNIX much, you might have heard of the “UNIX philosophy” — a set of rules that well-behaved programs should adhere to. One of these is the “rule of silence”:

When a program has nothing surprising to say, it should say nothing.

Cisco IOS (usually) abides by this rule. When IOS successfully executes a command that you issue, it will “say nothing” (unless it is supposed to, such as the show commands). IOS, as a general rule, only provides negative feedback.

You’ve seen this rule in action already without even knowing it. Remember when we were switching back and forth between user exec mode and privileged mode?

Router> enable
Router# disable
Router>

IOS doesn’t waste our time by telling us that it was successful in carrying out our command, it just does it and returns us to the prompt.

When we do something wrong, though, it will not only tell us but will also describe what is wrong with the command that we’ve entered, such as when we tried to look at the running config from user exec mode:

Router> show running-configuration
              ^
% Invalid input detected at '^' marker.

Router>

Notice how the caret points at the “u” in “running”. If you view the list of show commands available from user exec mode, you’ll see that running-configuration is absent from the list:

Router> show ?
...
queue             Show queue contents
queueing          Show queueing configuration
radius            Shows radius information
rbscp             RBSCP information
redundancy        Redundancy Facility (RF) information
rmi               Resource User Infrastructure information
rmon              rmon statistics
rpms-proc         RPMS Process Information
sasl              show SASL information
sessions          Information about Telnet connections
...

Nope, no “running-configuration” there! Remember that the caret was pointing at the “u”, though. That is where the error occurred. There are other commands available to us that begin with an “r” (radius, rbscp, redundancy, etc.) so the command was actually valid up to that point.

Summary

As you can see, the error messages from IOS can be quite helpful if you pay attention to them. In this article, you learned how to use the help system built-in to Cisco IOS and got an introduction to its error messages.

The next article, Cisco IOS Error Messages, will explain the three major types of error messages that you’ll encounter. Later, we’ll look at some Cisco IOS Shortcuts you can use to save yourself some typing.

Image Source

Previous post:

Next post: