cc/td/doc/product/lan/28201900/1928v8x
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Overview

Overview

This chapter defines the following aspects of the Cisco Enterprise Edition software command-line interface (CLI) commands of the Catalyst 2820 series and Catalyst 1900 series switches:

Understanding Command Modes

The CLI commands for the Catalyst 2820 series and Catalyst 1900 series switches are sorted into classes: Exec commands and configuration commands. Configuration commands are further categorized into three modes: global configuration, interface (and sub-interface) configuration, and line configuration.

Figure 1-1 illustrates the class and mode hierarchy.


Figure 1-1: CLI Command Classes and Modes


Table 1-1 lists the command modes that are used in this guide, how to access each mode, the prompt you see in that mode, and how to exit that mode. The examples in the table use the hostname 1900.


Table 1-1: Command Modes Summary
Mode Access Method Prompt Exit Method About This Mode1

User Exec

Begin a session with your switch.


1900>

Enter the exit command.

This mode contains the nonpassword-protected Exec mode commands. Use this mode to:

  • Change terminal settings

  • Perform basic tests

  • Display system information

Privileged Exec

Enter the enable command while in user Exec mode, or select the Command Line option [K] from the User Interface menu.


1900#

To exit to user Exec mode, enter the disable command.

To enter global configuration mode, enter the configure command.

Use this mode to:

  • Configure your switch operating parameters.

  • Verify information.

To prevent unauthorized changes to your switch configuration, protect access to this mode with a password.

Global configuration

Enter the configure command while in privileged Exec mode.


1900(config)#

To exit to privileged Exec mode, enter the exit or end command, or press Ctrl-C.

To enter interface configuration mode, enter the interface command.

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 the global configuration mode.


1900(config-if)#

To exit to global configuration mode, enter the exit command.

To exit to privileged Exec mode, enter the end command, or press Ctrl-C.

Use this mode to configure parameters for the various LAN and WAN interfaces of your switch, including:

  • Ethernet, Fast Ethernet, and EtherChannel

  • FDDI

  • ATM

Line configuration

Specify a line with the line console command while in global configuration mode.


1900(config-line)#

  • To exit to global configuration mode, enter the exit command.

  • To enter privileged Exec mode, enter the end command, or press Ctrl-C.

Use this mode to configure parameters for the terminal line.

1For any of the modes, you can see a comprehensive list of the available commands by entering a question mark (?) at the prompt.

The commands of each mode are accessible only to users with privileges assigned for the mode.

Enabling Passwords

Because many privileged-level Exec commands are used to set operating parameters, you should password-protect these commands to prevent unauthorized use.

Use two commands to do this:

For maximum security, the privileged and user Exec passwords should be different.

An enable password can contain from 4  to  8 alphanumeric characters. The passwords are not case-sensitive, although the first character cannot be a number. Spaces are also valid password characters; for example, two words is a valid password as long the string is inclosed in quotation marks.

Entering Configuration Mode

To make any configuration changes to your switch, you must be working in configuration mode. This section describes how to enter configuration mode while using a terminal or PC that is connected to your switch console port.

To enter configuration mode:

    1. After your switch boots ups, select [K] from the User Interface menu:

        User Interface menu
[M] Menus
[K] Command Line
[I] IP Configuration
Enter Selection: K

    2. Enter the enable command, and if you have configured your switch with an enable password, enter the password when you are prompted for it (the enable password does not show on the screen).

> enable
Password: <enable_password>
#

    3. Enter the config command to enter configuration mode, which is indicated by the (config)# in the prompt:

# config
(config)#

Using Commands

This section provides some tips about entering Cisco Enterprise Edition software CLI commands.

Abbreviating Commands

The CLI requires a minimum number of characters to uniquely identify a keyword in a command. For example, for the fictional commands catch and catalog, the minimum number of characters required to identify them are catc and cata, respectively. An error message appears if the keyword is ambiguous.

Command Completion

If you enter part of a keyword and press the Tab key, the CLI displays the remaining keyword characters to the point of a keyword ambiguity. For example, for the fictional commands catch and catalog, entering ca and pressing the Tab key displays the characters cat.

Command-Line Error Messages

Table 1-2 shows the five types of CLI error messages you are most likely to see:


Table 1-2: Common CLI Error Messages
Error Message Meaning

2820(config)# network-port
% Incomplete command

Incomplete command error message:

You did not enter all of the keywords or values required by this command. This example requires a module and port specification.

Reenter the command followed by a question mark with a space between the command and the question mark. The possible keywords that you can enter with the command are displayed.


2820(config)# network-port 9/42
^
% Invalid input detected at `^' marker

Invalid input error message:

This example lists module and port values outside the valid range.

Reenter the command followed by a question mark with a space between the command and the question mark. The possible keywords that you can enter with the command are displayed.


2820(config)# fddi?
% Unrecognized command

This example uses a command that is not available within that mode.

Backspace over the previous text and enter a question mark with no space between the command and the question mark to see all the commands for that mode.

Refer to the "Command Descriptions" chapter of this book to find the correct mode for the command you want and enable that mode. Enter a question mark with a space between the command and the question mark to see all the commands for that mode.


2820(config)# co
% Ambiguous command: "co"

Ambiguous command error message:

The example shows a command word fragment that could be either configure or copy.

Reenter the command followed by a question mark with no space between the command and the question mark. The possible keywords that you can enter with the command are displayed.


2820(config)# no mac-address-table                            permanent 0040.C80A.2F07
% Error: MAC address not found

Configuration error error message:

If you enter a complete command with the correct syntax, errors might still occur due to mismatches between the configuration you want and the configuration choices you have. These messages are command-specific. Refer to the "Command Descriptions" chapter of this book to find the correct syntax for the command.

Getting Help

You can use the question mark (?) and arrow keys to help you enter commands. For a list of available commands within that command mode, enter a question mark:

1900(config-if)#?
Interface configuration commands:
  cdp              Cdp interface subcommands
  description      Interface specific description
  duplex           Configure duplex operation
  exit             Exit from interface configuration mode
  help             Description of the interactive help system
  no               Negate a command or set its defaults
  port             Perform switch port configuration
  shutdown         Shutdown the selected interface
  spantree         Spanning tree subsystem
  vlan-membership  VLAN membership configuration

To check the correct spelling of a command, enter a few known characters followed by a question mark (with no space):

2820(config)# address?
address-violation

For a list of command keywords and parameters, enter the command followed by a space and a question mark:

2820(config)# address ?
disable      Disable the port on address violation ignore        Ignore the address violation suspend      Suspend the port on address violation

To redisplay a command you previously entered, press the up-arrow key. You can continue to press the up-arrow key for more commands.

Saving Configuration Changes

All configuration changes are saved to NVRAM immediately after the command is entered successfully. You can save the configuration to a TFTP server using the copy (nvram tftp) command. You can restore the saved configuration using the copy (tftp) command.


hometocprevnextglossaryfeedbacksearchhelp
Copyright 1989-1998 © Cisco Systems Inc.