Table Of Contents
Getting Started with the CLI
Command Usage Basics
Accessing Command Modes
Abbreviating Commands
Using the No and Default Forms of Commands
Redisplaying a Command
Getting Help
Command-Line Error Messages
Accessing the CLI
Accessing the CLI from a Browser
Saving Configuration Changes
Where to Go Next
Getting Started with the CLI
This chapter provides information that you should know before using the Cisco IOS command-line interface (CLI). If you have never used IOS software or if you need a refresher, take a few minutes to read this chapter before reading the rest of this guide.
•
Command usage basics
•
Command-line error messages
•
Accessing the CLI
•
Saving configuration changes
This switch software release is based on Cisco IOS Release 12.0(5). It has been enhanced to support a set of features for the Catalyst 2900 XL and Catalyst 3500 XL switches. This guide provides procedures for using only the commands that have been created or changed for these switches. The Catalyst 2900 Series XL and Catalyst 3500 Series XL Command Reference provides complete descriptions of these commands.
For information about the standard Cisco IOS Release 12.0 commands, refer to the Cisco IOS Release 12.0 documentation on Cisco.com.
Command Usage Basics
This section provides the following topics:
•
Accessing command modes
•
Abbreviating commands
•
Using the No and Default forms of commands
•
Redisplaying a command
•
Getting help
Accessing Command Modes
The CLI is divided into different modes. The commands available to you at any given time depend on which mode you are in. Entering a question mark (?) at the system prompt provides a list of commands for each command mode.
The switch supports the following command modes:
•
User EXEC
•
Privileged EXEC
•
VLAN database
•
Global configuration
•
Interface configuration
•
Line configuration
When you start a session on the switch, you begin in user mode, often called user EXEC mode, which has only a limited subset of the commands. To access all commands and modes, you must first enter privileged EXEC mode. Normally, a password is required 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 the current configuration status, and clear commands, which clear counters or interfaces.
You can use the virtual LAN (VLAN) database and the various configuration modes to make changes to the running configuration. To access the various configuration modes, you must start at global configuration mode. From global configuration mode, you can enter interface and line configuration modes.
Each command mode supports specific Cisco IOS commands. For example, the interface command is used only from global configuration mode.
Table 3-1 describes how to access each mode, the prompt you see in that mode, and how to exit the mode. The examples in the table use the host name switch.
Table 3-1 Command Modes Summary
Modes
|
Access Method
|
Prompt
|
Exit Method
|
|
User EXEC
|
Begin a session with your switch.
|
|
Enter logout or quit.
|
Use this mode to
• Change terminal settings.
• Perform basic tests.
• Display system information.
|
Privileged EXEC
|
Enter the enable command while in user EXEC mode.
|
|
Enter disable to exit.
|
Use this mode to verify commands you have entered. Use a password to protect access to this mode.
|
VLAN database
|
Enter the vlan database command while in privileged EXEC mode.
|
|
To exit to privileged EXEC mode, enter exit.
|
Use this mode to configure VLAN-specific parameters.
|
Global configuration
|
Enter the configure command while in privileged EXEC mode.
|
|
To exit to privileged EXEC mode, enter exit or end, or press Ctrl-Z.
|
Use this mode to configure parameters that apply to your switch as a whole.
|
Interface configuration
|
Enter the interface command (with a specific interface) while in global configuration mode.
|
|
To exit to global configuration mode, enter exit.
To exist to privileged EXEC mode, enter Ctrl-Z or end.
|
Use this mode to configure parameters for the Ethernet interfaces.
|
Line configuration
|
Specify a line with the line vty or line console command while in global configuration mode.
|
|
To exit to global configuration mode, enter exit.
To exit to privileged EXEC mode, enter Ctrl-Z or end.
|
Use this mode to configure parameters for the terminal line.
|
Abbreviating Commands
You can abbreviate commands and keywords to the number of characters that allow a unique abbreviation. For example, you can abbreviate the show command to sh or the show configuration command to show conf.
Using the No and Default Forms of Commands
Almost every configuration command has a no form. In general, use the no form to
•
Disable a feature or function.
•
Reset a command to its default values.
•
Reverse the action of a command. For example, the no shutdown command reverses the shutdown of an interface.
Use the command without the no form to reenable a disabled feature or to reverse the action of a no command.
Configuration commands can also have a default form. The default form of a command returns the command setting to its default.
Redisplaying a Command
To redisplay a command you previously entered, press the up-arrow key. You can continue to press the up-arrow key for more commands.
Getting Help
Entering a question mark (?) at the system prompt displays a list of commands for each command mode. You can also get a list of any command's associated keywords and arguments with the context-sensitive help feature.
The following are the commands to get help specific to a command mode, a command, a keyword, or an argument:
•
help—Obtain a brief description of the help system in any command mode.
•
abbreviated-command-entry?—Obtain a list of commands that begin with a particular character string.
switch> disable disconnect
•
abbreviated-command-entry<Tab>—Complete a partial command name.
Note
No space before tabbing.
•
? — List all commands available for a particular command mode.
•
command ?—List of command keywords.
•
command keyword ?— List of command keyword arguments.
FastEthernet FastEthernet IEEE 802.3
VLAN Switch VLAN Virtual Interface
When using context-sensitive help, the space (or lack of a space) before the question mark (?) is significant. To obtain a list of commands that begin with a particular character sequence, enter those characters followed immediately by the question mark (?). Do not include a space. This form of help is called word help, because it completes a word for you.
To list keywords or arguments, enter a question mark (?) in place of a keyword or argument. Include a space before the ?. This form of help is called command syntax help, because it reminds you which keywords or arguments are applicable based on the command, keywords, and arguments you already have entered.
Command-Line Error Messages
Table 3-2 lists some error messages that you might encounter while using the CLI.
Table 3-2 Common CLI Error Messages
Error Message
|
Meaning
|
How to Get Help
|
% Ambiguous
command: "show con"
|
You did not enter enough characters for your switch to recognize the command.
|
Reenter the command followed by a space and a question mark (?).
The possible keywords that you can enter with the command appear.
|
|
You did not enter all of the keywords or values required by this command.
|
Reenter the command followed by a space and a question mark (?).
The possible keywords that you can enter with the command appear.
|
% Invalid input
detected at `^'
marker.
|
You entered the command incorrectly. The caret (^) marks the point of the error.
|
Enter a question mark (?) to display all of the commands that are available in this command mode.
The possible keywords that you can enter with the command appear.
|
Accessing the CLI
The following procedure assumes you have already assigned IP information and password to the switch or command switch. You can assign this information to the switch in the following ways:
•
Using the setup program, as described in the release notes
•
Manually assigning an IP address and password, as described in the "Changing IP Information" section and "Changing the Password" section.
Considerations for assigning this information to a command switch and cluster members are described in the "IP Addresses" section and "Passwords" section.
To access the CLI, follow these steps:
Step 1
Start up the emulation software (such as ProComm, HyperTerminal, tip, or minicom) on the management station.
Step 2
If necessary, reconfigure the terminal-emulation software to match the switch console port settings (default settings are 9600 baud, no parity, 8 data bits, and 1 stop bit).
Step 3
Establish a connection with the switch by either
•
Connecting the switch console port to a management station or dial-up modem. For information about connecting to the console port, refer to the switch hardware installation guide.
•
Using any Telnet TCP/IP package from a remote management station. The switch must have network connectivity with the Telnet client, and the switch must have an enable secret password configured. For information about configuring the switch for Telnet access, see the "SNMP Network Management Platforms" section.
The switch supports up to seven simultaneous Telnet sessions. Changes made by one Telnet user are reflected in all other Telnet sessions.
After you connect through the console port or through a Telnet session, the User EXEC prompt appears on the management station.
Accessing the CLI from a Browser
The following procedure assumes you have met the software requirements, (including browser and Java plug-in configurations) and have assigned IP information and a Telnet password to the switch or command switch, as described in the release notes.
To access the CLI from a web browser, follow these steps:
Step 1
Start one of the supported browsers.
Step 2
In the URL field, enter the IP address of the command switch.
Step 3
When the Cisco Systems Access page appears, click Telnet to start a Telnet session.
You can also access the CLI by clicking Web Console - HTML access to the command line interface from the Cisco Systems Access page. For information about the Cisco Systems Access page, see the "Accessing CMS" section and the release notes.
Step 4
Enter the switch password.
The User EXEC prompt appears on the management station.
Note
Copies of the CMS pages you display are saved in your browser memory cache until you exit the browser session. A password is not required to redisplay these pages, including the Cisco Systems Access page. You can access the CLI by clicking Web Console - HTML access to the command line interface from a cached copy of the Cisco Systems Access page. To prevent unauthorized access to CMS and the CLI, exit your browser to end the browser session.
Saving Configuration Changes
The show command always displays the running configuration of the switch. When you make a configuration change to a switch or switch cluster, the change becomes part of the running configuration. The change does not automatically become part of the config.txt file in Flash memory, which is the startup configuration used each time the switch restarts. If you do not save your changes to Flash memory, they are lost when the switch restarts.
To save all configuration changes to Flash memory, you must enter the write memory command in privileged EXEC mode.
Note
The write memory command does not apply to the Catalyst 1900 and Catalyst 2820 switches, which automatically save configuration changes to Flash memory as they occur.
Tips
As you make cluster configuration changes, make sure you periodically save the configuration. The configuration is saved on the command and member switches.
Where to Go Next
The rest of this guide provides descriptions of the software features and general switch administration. Table 4-2 lists the defaults for all key features and gives the page numbers in this guide where the feature is described and CLI procedures are provided.
Refer to the Catalyst 2900 Series XL and Catalyst 3500 Series XL Command Reference for complete descriptions of the switch commands.
Refer to the Cisco IOS Release 12.0 documentation on Cisco.com for information about the standard Cisco IOS Release 12.0 commands.