|
Table Of Contents
Example: How to Find Command Options
Using the No and Default Forms of Commands
Searching and Filtering Output of show and more Commands
Using Cisco IOS Software
This chapter provides helpful tips for understanding and configuring Cisco IOS software using the command-line interface (CLI). It contains the following sections:
• Using the No and Default Forms of Commands
• Saving Configuration Changes
• Searching and Filtering Output of show and more Commands
For an overview of Cisco IOS software configuration, refer to the Cisco IOS Configuration Fundamentals Configuration Guide.
For information on the conventions used in the Cisco IOS documentation set, see the "About the Cisco IOS Software Documentation" chapter located at the beginning of this book.
Understanding Command Modes
The Cisco IOS user interface is divided into many different modes. 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 allows you to obtain a list of commands available for each command mode.
When you log in to the Cisco IOS software, you begin in user mode, often called EXEC mode. Only a limited subset of the commands are available in EXEC mode. 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 mode, you can enter any EXEC command or enter global configuration mode. Most of the EXEC commands are one-time commands, such as show commands, which show important status information, and clear commands, which clear counters or interfaces. The EXEC commands are not saved when the networking device reboots.
The configuration modes allow you to make changes to the running configuration. If you later save the configuration to the startup configuration, these commands are stored when the networking device reboots. To enter the various configuration modes, you must start at global configuration mode. From global configuration mode, you can enter interface configuration mode, subinterface configuration mode, and a variety of protocol-specific modes.
ROM monitor mode is a separate mode used when a networking device running Cisco IOS software cannot boot properly. If your networking device 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.
Summary of Main Command Modes
Table 1 summarizes the main command modes of the Cisco IOS software.
For more information regarding command modes, refer to the "Using the Command-Line Interface" chapter in the Cisco IOS Configuration Fundamentals Configuration Guide.
Getting Help
Entering a question mark (?) at the system prompt displays a list of commands available for each command mode. You can also get a list of keywords and arguments associated with any command by using the context-sensitive help feature.
To get help specific to a command mode, a command, a keyword, or an argument, use one of the following commands:
Example: 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 and arguments. To display keywords and arguments for a command, enter a question mark (?) at the configuration prompt, or after entering part of a command followed by a space. The Cisco IOS software displays a list of keywords and arguments available along with a brief description of them. For example, if you were in global configuration mode, typed the command arap, and wanted to see all the keywords or arguments that may be entered next on the command line, you would type arap ?.
Table 2 shows examples of how you can use the question mark (?) to assist you in entering commands. The table steps you through configuring a serial interface IP address on a Cisco 7206 router running Cisco IOS Release 12.0(3).
Using the No and Default Forms of Commands
Almost every configuration command also has a no form. In general, use 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, use the no ip routing command and specify ip routing to reenable it. The Cisco IOS software command reference publications provide the complete syntax for the configuration commands and describe what the no form of a command does.
Configuration commands can also 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 variables set to certain default values. In these cases, the default command enables the command and sets variables to their default values. The Cisco IOS software command reference publications describe what the default form of a command does if the command is not the same as the no form.
Saving Configuration Changes
Enter the copy system:running-config nvram:startup-config command 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. For example:
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#
On most platforms, this task saves the configuration to NVRAM. On the Class A Flash file system platforms, this task saves the configuration to the location specified by the CONFIG_FILE environment variable. The CONFIG_FILE variable defaults to NVRAM.
Searching and Filtering Output of show and more Commands
In Cisco IOS Release 12.0(1)T or later, you can search and filter the output for show and more commands. This functionality is useful when you need to sort through large amounts of output, or if you want to exclude output that you do not need to see.
To use this functionality, enter a show or more command followed by the "pipe" character (|), one of the keywords begin, include, or exclude, and an expression that you want to search or filter on:
command | {begin | include | exclude} regular-expression
The following is an example of the show interface command in which you want the output to only include lines where the expression "protocol" appears:
Router# show interface | include protocol
FastEthernet0/0 is up, line protocol is up
Serial4/0 is up, line protocol is up
Serial4/1 is up, line protocol is up
Serial4/2 is administratively down, line protocol is down
Serial4/3 is administratively down, line protocol is down
For more information on the search and filter functionality, refer to the "Using the Command-Line Interface" chapter in the Cisco IOS Configuration Fundamentals Configuration Guide.
Posted: Wed Feb 8 10:32:40 PST 2006
All contents are Copyright © 1992--2006 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.