|
|
This chapter describes the command-line interface (CLI) available on the Catalyst 5000 family, 4000 family, 2926G series, 2948G, and 2980G switches and contains the following sections:
"Acronyms," contains a list of acronyms used in this publication. For complete definitions of terms listed in this publication, refer to the Internetworking Terms and Acronyms publication.
The Catalyst 5000 family, 4000 family, 2926G series, 2948G, and 2980G switches are multimodule systems. Commands you enter from the CLI can apply to the entire system or to a specific module, port, or VLAN.
You can configure and maintain the Catalyst 5000 family, 4000 family, 2926G series, 2948G, and 2980G switches Ethernet, Fast Ethernet, Gigabit Ethernet, CDDI, and FDDI modules by entering commands from the switch CLI. The CLI is a basic command-line interpreter similar to the UNIX C shell. Using the CLI session command, you can access the router configuration software and perform tasks such as history substitution and alias creation.
You can access the switch CLI from a console terminal connected to an EIA/TIA-232 port or through a Telnet session. The CLI allows fixed baud rates. Telnet sessions disconnect automatically after remaining idle for a user-defined time period.
To access the switch through the console (EIA/TIA-232) port, perform these steps:
| Task | Command |
|---|---|
Step 1 From the Cisco Systems Console prompt, press Return. |
|
Step 2 At the prompt, enter the system password. The Console> prompt appears indicating that you have accessed the CLI in normal mode. | <password> |
Step 3 Enter the necessary commands to complete your desired tasks. | Appropriate commands |
Step 4 When finished, exit the session. | quit |
After connecting through the console port, you see this display:
Cisco Systems Console Enter password: Console> Console>
You can open multiple sessions to the switch through Telnet. To access the switch through a Telnet session, you must first set the IP address for the switch. To set the IP address, use the set interface command.
To access the switch from a remote host with Telnet, perform these steps:
| Task | Command |
|---|---|
Step 1 From the remote host, enter the telnet command and the name or IP address of the switch you want to access. | telnet hostname | ip_addr |
Step 2 At the prompt, enter the password for the CLI. If no password has been configured, press Return. | <password> |
Step 3 Enter the necessary commands to complete your desired tasks. | Appropriate commands |
Step 4 When finished, exit the Telnet session. | quit |
After connecting through a Telnet session, you see this display:
host% telnet cat5000-1.cisco.com Trying 172.16.44.30 ... Connected to cat5000-1.
This section describes command modes and functions that allow you to operate the switch CLI.
The CLI has two modes of operation: normal (login) and privileged (enable). Both are password-protected. Use normal-mode commands for everyday system monitoring. Use privileged commands for system configuration and basic troubleshooting.
After you log in, the system enters normal mode, which gives you access to normal-mode commands only. You can enter privileged mode by entering the enable command followed by the enable password. Privileged mode is indicated by the word "enable" in the system prompt. To return to normal mode, enter the disable command at the prompt.
The following example shows how to enter privileged mode:
Console> enable Enter password: <password> Console> (enable)
Switch commands are not case sensitive. You can abbreviate commands and parameters as long as they contain enough letters to be different from any other commands or parameters available in the same context. You can scroll through the last 20 commands stored in the history buffer, and enter or edit the command at the prompt. Table 1-1 describes the keys used for editing.
| Keystroke | Function |
|---|---|
Ctrl-A | Jumps to the first character of the command line. |
Ctrl-B or the left arrow key | Moves the cursor back one character. |
Ctrl-C | Escapes and terminates prompts and tasks. |
Ctrl-D | Deletes the character at the cursor. |
Ctrl-E | Jumps to the end of the current command line. |
Ctrl-F or the right arrow key1 | Moves the cursor forward one character. |
Ctrl-K | Deletes from the cursor to the end of the command line. |
Ctrl-L; Ctrl-R | Repeats current command line on a new line. |
Ctrl-N or the down arrow key1 | Enters next command line in the history buffer. |
Ctrl-P or the up arrow key1 | Enters previous command line in the history buffer. |
Ctrl-U; Ctrl-X | Deletes from the cursor to the beginning of the command line. |
Ctrl-W | Deletes last word typed. |
Esc B | Moves the cursor back one word. |
Esc D | Deletes from the cursor to the end of the word. |
Esc F | Moves the cursor forward one word. |
Delete key or Backspace key | Erases mistake when entering a command; reenter command after using this key. |
| 1The arrow keys function only on ANSI-compatible terminals such as VT100s. |
Commands that you enter during each terminal session are stored in a history buffer, which stores the last 20 commands you entered. History substitution allows you to access these commands without retyping them by using special abbreviated commands. Table 1-2 describes the history substitution commands.
| Command | Function |
|---|---|
| To repeat recent commands: | |
!! | Repeat the most recent command. |
!-nn | Repeat the nnth most recent command. |
!n | Repeat command n. |
!aaa | Repeat the command beginning with string aaa. |
!?aaa | Repeat the command containing the string aaa. |
| To modify and repeat the most recent command: | |
^aaa^bbb | Replace the string aaa with the string bbb in the most recent command. |
| To add a string to the end of a previous command and repeat it: | |
!!aaa | Add string aaa to the end of the most recent command. |
!n aaa | Add string aaa to the end of command n. |
!aaa bbb | Add string bbb to the end of the command beginning with string aaa. |
!?aaa bbb | Add string bbb to the end of the command containing the string aaa. |
You can abbreviate commands and keywords to the number of characters that allow a unique abbreviation.
You can abbreviate the show command to sh. After entering the command at the system prompt, press Return to execute the command.
The Tab key allows you to use the command-completion feature. When you enter a unique partial character string and press the Tab key, the system completes the command or keyword on the command line.
For example, if you enter co and press the Tab key, the system completes the command as configure because it is the only command that matches the criteria.
When the output of a command fills more than 1 terminal screen a ---More--- prompt is displayed at the bottom of the screen. To view the next line or screen, perform these tasks:
| Task | Keystrokes |
|---|---|
| Press the Return key. |
| Press the Spacebar. |
Like regular commands, aliases are not case sensitive. However, unlike regular commands, some aliases cannot be abbreviated. See Table 1-3 for a list of switch CLI aliases that cannot be abbreviated.
| Alias | Command |
|---|---|
? | help |
batch | configure |
di | show |
exit | quit |
logout | quit |
Modules, ports, and VLANs are numbered sequentially, beginning with 1. The supervisor engine module is module 1, residing in slot 1. If your Catalyst 5500 series switch has a redundant supervisor engine, the supervisor modules must be installed in slots 1 and 2.
To designate a specific module, use the module number. In most systems, the module number and the slot number are the same. However, in some cases the slot number and the module number are different. For example, the Route Switch Feature Card (RSFC) on the supervisor engine is physically in slot 1 or slot 2 but is logically identified as module 15 or module 16.
On the fixed-configuration switches, there are two logical modules. However, on the Catalyst 4912G switch and the Catalyst 2948G switch, there are two modules but only one slot. When you enter configuration commands on these switches, you must refer to the module number, not the slot number. For example, all of the user-configurable ports on these switches are logically on module 2.
On modules that have user-configurable ports, the left-most port is always port 1. To designate a specific port on a specific module, the command syntax is mod_num/port_num. For example, 3/1 specifies module 3, port 1. On the Catalyst 4912G switch and the Catalyst 2948G switch, the left-most switch port is numbered 2/1 rather than 1/1 because logically the ports are located on module 2.
With many commands, you can enter lists of ports. To specify a range of ports, use a comma-separated list (do not insert spaces) to specify individual ports or a hyphen (-) between the port numbers to specify a range of ports. Hyphens take precedence over commas.
Table 1-4 shows examples of how to designate ports and port ranges.
| Example | Function |
|---|---|
| Specifies port 1 on module 2 |
| Specifies ports 4, 5, 6, 7, and 8 on module 3 |
| Specifies ports 2 and 4 on module 5 and port 10 on module 6 |
3/1-2,4/8 | Specifies ports 1 and 2 on module 3 and port 8 on module 4 |
VLANs are identified using the VLAN ID, a single number associated with the VLAN. To specify a list of VLANs, use a comma-separated list (do not insert spaces) to specify individual VLANs or use a hyphen (-) between the VLAN numbers to specify a range of VLANs.
Table 1-5 shows examples of how to designate VLANs and VLAN ranges.
| Example | Function |
|---|---|
| Specifies VLAN 10 |
| Specifies VLANs 5, 10, and 15 |
10-50,500 | Specifies VLANs 10 through 50, inclusive, and VLAN 500 |
Some commands require you to specify a Media Access Control (MAC) address, which must be designated in a standard format. The MAC address format must be six hexadecimal numbers separated by hyphens, as shown in the following example:
00-00-0c-24-d2-fe
Some commands require an IP address, IP hostname, or IP alias. The IP address format is 32 bits, written in dotted decimal format, as shown in the following example:
172.16.10.1
If DNS is configured properly on the switch, you can use IP hostnames instead of IP addresses. For information on configuring DNS, see the Software Configuration Guide for your switch.
You also can configure IP aliases on the switch, which you can use in place of IP addresses. IP aliases can be used for most commands that use an IP address, except for commands that define the IP address or IP alias. For information on using IP aliases, see the Software Configuration Guide for your switch.
To display a list of top-level commands and command categories, enter help or ? in normal or privileged mode. Context-sensitive help (usage and syntax information) for individual commands can be seen by appending help or ? to any specific command. If you enter a command using the wrong number of arguments or inappropriate arguments, usage and syntax information for that command is displayed. Additionally, appending help or ? to a command category displays a list of commands in that category.
In normal mode, enter help or ? to display top-level commands and command categories, as follows:
Console> help Commands: ----------------------------------------------------------------------cd Set default flash devicedir Show list of files on flash deviceenable Enable privileged modehelp Show this messagehistory Show contents of history substitution bufferping Send echo packets to hostspwd Show default flash devicequit Exit from the Admin sessionsession Tunnel to ATM or Router moduleset Set, use 'set help' for more infoshow Show, use 'show help' for more infotraceroute Trace the route to a hostverify Verify checksum of file on flash devicewait Wait for x secondswhichboot Which file bootedConsole>
In privileged mode, enter help or ? to display top-level commands and command categories, as follows:
Console> (enable) help Commands: ----------------------------------------------------------------------cd Set default flash deviceclear Clear, use 'clear help' for more infoconfigure Configure system from networkcopy Copy files between TFTP/module/flash devicesdelete Delete a file on flash devicedir Show list of files on flash devicedisable Disable privileged modedisconnect Disconnect user sessiondownload Download code to a processorenable Enable privileged modeformat Format a flash devicehelp Show this messagehistory Show contents of history substitution bufferping Send echo packets to hostspwd Show default flash devicequit Exit from the Admin sessionreconfirm Reconfirm VMPSreload Force software reload to linecardreset Reset system or modulesession Tunnel to ATM or Router moduleset Set, use 'set help' for more infoshow Show, use 'show help' for more infoslip Attach/detach Serial Line IP interfacesqueeze Reclaim space used by deleted filesswitch Switch to standby <clock|supervisor>telnet Telnet to a remote hosttest Test, use 'test help' for more infotraceroute Trace the route to a hostundelete Undelete a file on flash deviceupload Upload code from a processorverify Verify checksum of file on flash devicewait Wait for x secondswhichboot Which file bootedwrite Write system configuration to terminal/networkConsole> (enable)
When you enter help or ? after some commands (such as clear, set, and show), a list of commands in that category is displayed. For example, the following display shows a partial list of commands for the clear category:
Console> (enable) clear help Clear commands: ----------------------------------------------------------------------------clear alias Clear aliases of commandsclear arp Clear ARP table entriesclear banner Clear Message Of The Day bannerclear boot Clear booting environment variableclear cam Clear CAM table entries...
Usage and syntax information for individual commands are displayed by appending help or ? to any specific command. For example, the following display shows usage and syntax information for the set length command:
Console> set length help
Usage: set length <screenlength>
(screenlength = 5..512, 0 to disable 'more' feature)
Console>
You can use the self-repeat feature and the keyword-lookup or partial-keyword-lookup functions by entering ?.
To use the keyword-lookup function, enter ? to display a list of valid keywords and arguments for a command. Insert a space between the last parameter and the question mark (?). For example, eight parameters are used by the set mls command. To see these parameters, enter set mls ? at the privileged prompt. The system displays all valid keywords and arguments as follows:
Console> (enable) set mls ? agingtime Set agingtime for MLS cache entry disable Disable MLS in the switch enable Enable MLS in the switch nde Configure Netflow Data Export flow Set minimum flow mask include Include MLS-RP multicast Set MLS feature for multicast statistics Add protocols to protocol statistics list Console> (enable) set mls
Note that the system repeats the command you entered without the ?.
To use the partial-keyword-lookup function, enter ? to display a list of commands that begin with a specific set of characters. Do not insert a space between the last letter of the variable and the question mark (?). For example, enter co? at the privileged prompt to display a list of commands that start with co. The system displays all commands that begin with co as follows:
Console> (enable) co? configure Configure system from network copy Copy files between TFTP/RCP/module/flash devices Console> (enable) co
Note that the system repeats the command you entered without the ?.
The ROM monitor is a ROM-based program that executes upon platform power-up, reset, or when a fatal exception occurs. The system enters ROM monitor mode if the switch does not find a valid system image, if the nonvolatile RAM (NVRAM) configuration is corrupted, or if the configuration register is set to enter ROM monitor mode.
The system enters ROM monitor mode if the switch does not find a valid system image, if the NVRAM configuration is corrupted, or if the configuration register is set to enter ROM monitor mode. You can manually load an image from any Flash device.
You can also enter ROM monitor mode by restarting the switch and pressing the Break key during the first 60 seconds of startup.
To access the ROM monitor through a terminal server, you can escape to the Telnet prompt and enter the send break command for your terminal emulation program to break into ROM monitor mode.
Once you are in ROM monitor mode, the prompt changes to rommon>. Use the ? command to see the available ROM monitor commands.
The ROM monitor commands are used to load and copy system images, microcode images, and configuration files. System images contain the system software. Microcode images contain microcode to be downloaded to various hardware devices. Configuration files contain commands entered to customize the function of Cisco IOS software.
The manual boot command has the following syntax:
Once you are in ROM monitor mode, the prompt changes to rommon #>.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Tue Mar 21 09:06:03 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.