|
|
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:
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.

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.
| 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:
|
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:
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:
|
Line configuration | Specify a line with the line console command while in global configuration mode. | 1900(config-line)# |
| 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.
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.
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).
This example shows how to enter configuration mode on a Catalyst 2820 series or Catalyst 1900 series switch:
> enable
Password: <enable_password> #
Enable mode is indicated by the # symbol in the prompt. You can now make changes to your switch configuration.
3. Enter the config command to enter configuration mode, which is indicated by the (config)# in the prompt:
# config
(config)#
You can now make changes to your switch configuration.
This section provides some tips about entering Cisco Enterprise Edition software CLI 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.
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.
Table 1-2 shows the five types of CLI error messages you are most likely to see:
| 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. |
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.
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.
|
|