|
|
This chapter describes the command-line interfaces (CLI) available on the Catalyst 6000 family switches and contains the following sections:
For definitions of terms and acronyms listed in this publication, refer to "Acronyms" section.
The Catalyst 6000 family 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 6000 family switches 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>
To access the switch through a Telnet session, you must first set the IP address for the switch. You can open multiple sessions to the switch via Telnet.
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 cat6000-1.cisco.com Trying 172.16.44.30 ... Connected to cat6000-1.
This section describes command modes and functions that allow you to operate the switch CLI.
The CLI has two modes of operation: normal and privileged. 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 currently available commands or parameters. You can scroll through the last 20 commands stored in the history buffer, and enter or edit the command at the prompt. (See Table 1-1.)
| 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. |
Catalyst 6000 family switch software includes an enhanced editing mode that provides a set of editing key functions similar to those of the Emacs editor. You can enter commands in uppercase, lowercase, or a mix of both. Only passwords are case sensitive. 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. After entering the command at the system prompt, press Return to execute the command.
Perform one of these tasks to move the cursor around on the command line for corrections or changes:
| Task | Keystrokes |
|---|---|
| Press Ctrl-B or press the left arrow key1. |
| Press Ctrl-F or press the right arrow key1. |
| Press Ctrl-A. |
| Press Ctrl-E. |
| Press Esc B. |
| Press Esc F. |
| 1The arrow keys function only on ANSI-compatible terminals such as VT100s. |
The system provides a buffer that contains the last ten items you deleted. You can recall these items and paste them in the command line by performing this task:
| Task | Keystrokes |
|---|---|
Step 1 Recall the most recent entry in the buffer. | Press Ctrl-Y. |
Step 2 Recall the next buffer entry. | Press Esc Y. |
The buffer contains only the last ten items you have deleted or cut. If you press Esc Y more than ten times, you cycle back to the first buffer entry.
The new editing command set provides a wraparound feature for commands that extend beyond a single line on the screen. When the cursor reaches the right margin, the command line shifts ten spaces to the left. You cannot see the first ten characters of the line, but you can scroll back and check the syntax at the beginning of the command. To scroll back, perform this task:
| Task | Keystrokes |
|---|---|
Return to the beginning of a command line to verify that you have entered a lengthy command correctly. | Press Ctrl-B or the left arrow key repeatedly until you scroll back to the beginning of the command entry, or press Ctrl-A to return directly to the beginning of the line1. |
| 1The arrow keys function only on ANSI-compatible terminals such as VT100s. |
Use line wrapping with the command history feature to recall and modify previous complex command entries. See the "Using History Substitution" section for information about recalling previous command entries.
The system assumes your terminal screen is 80 columns wide. If your screen has a different width, enter the terminal width command to tell the router the correct width of your screen.
Perform one of these tasks to delete command entries if you make a mistake or change your mind:
| Task | Keystrokes |
|---|---|
| Press the Delete or Backspace key. |
| Press Ctrl-D. |
| Press Ctrl-K. |
| Press Ctrl-U or Ctrl-X. |
| Press Ctrl-W. |
| Press Esc D. |
When you use the help facility to list the commands in a particular mode, the list is often longer than the terminal screen can display. In such cases, 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. |
If you enter a command and the system suddenly sends a message to your screen, you can recall your current command line entry. To do so, perform this task:
| Task | Keystrokes |
|---|---|
Redisplay the current command line. | Press Ctrl-L or Ctrl-R. |
If you mistype a command entry, you can transpose the mistyped characters by performing this task:
| Task | Keystrokes |
|---|---|
Transpose the character to the left of the cursor with the character located at the cursor. | Press Ctrl-T. |
You can change words to uppercase or lowercase, or capitalize a set of letters, with simple keystroke sequences:
| Task | Keystrokes |
|---|---|
| Press Esc C. |
| Press Esc L. |
| Press Esc U. |
You can use a particular keystroke as an executable command. Perform this task:
| Task | Keystrokes |
|---|---|
Insert a code to indicate to the system that the keystroke immediately following should be treated as a command entry, not an editing key. | Press Ctrl-V or Esc Q. |
Like regular commands, aliases are not case sensitive. However, unlike regular commands, some aliases cannot be abbreviated. See Table 1-2 for a list of switch CLI aliases that cannot be abbreviated.
| Alias | Command |
|---|---|
? | help |
batch | configure |
di | show |
earl | cam |
exit | quit |
logout | quit |
Commands that you enter during each terminal session are stored in a history buffer, which stores the last 20 commands you entered during a terminal session. History substitution allows you to access these commands without retyping them by using special abbreviated commands. (See Table 1-3.)
| 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 string aaa with 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 string aaa. |
To see a list of top-level commands and command categories, type 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, use the help or ? command to display a list of top-level commands and command categories, as follows:
Console> help Commands: ---------------------------------------------------------------------- cd Set default flash device dir Show list of files on flash device enable Enable privileged mode help Show this message history Show contents of history substitution buffer ping Send echo packets to hosts pwd Show default flash device quit Exit from the Admin session session Tunnel to ATM or Router module set Set, use 'set help' for more info show Show, use 'show help' for more info traceroute Trace the route to a host verify Verify checksum of file on flash device wait Wait for x seconds whichboot Which file booted Console> Console>
Console> (enable) help Commands: ---------------------------------------------------------------------- cd Set default flash device clear Clear, use 'clear help' for more info configure Configure system from network copy Copy files between TFTP/module/flash devices delete Delete a file on flash device dir Show list of files on flash device disable Disable privileged mode disconnect Disconnect user session download Download code to a processor enable Enable privileged mode format Format a flash device help Show this message history Show contents of history substitution buffer ping Send echo packets to hosts pwd Show default flash device quit Exit from the Admin session reconfirm Reconfirm VMPS reload Force software reload to linecard reset Reset system or module session Tunnel to ATM or Router module set Set, use 'set help' for more info show Show, use 'show help' for more info slip Attach/detach Serial Line IP interface squeeze Reclaim space used by deleted files switch Switch to standby <clock|supervisor> telnet Telnet to a remote host test Test, use 'test help' for more info traceroute Trace the route to a host undelete Undelete a file on flash device upload Upload code from a processor verify Verify checksum of file on flash device wait Wait for x seconds whichboot Which file booted write Write system configuration to terminal/network Console> (enable)
On some commands (such as clear, set, and show), typing help or ? after the command provides a list of commands in that category. For example, this display shows a partial list of commands for the clear category:
Console> (enable) clear help Clear commands: ---------------------------------------------------------------------------- clear alias Clear aliases of commands clear arp Clear ARP table entries clear banner Clear Message Of The Day banner clear boot Clear booting environment variable clear cam Clear CAM table entries clear channel Clear PAgP statistical information ...
Usage and syntax information for individual commands can be seen 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> [default]
(screenlength = 5..512, 0 to disable 'more' feature)
Console>
The Catalyst 6000 family modules (module slots), ports, and VLANs are numbered starting with 1. The supervisor engine module is module 1, residing in the top slot. On each module, port 1 is the left-most port. To reference a specific port on a specific module, the command syntax is mod_num/port_num. For example, 3/1 denotes module 3, port 1. In some commands, such as set trunk, set cam, and set vlan, you can enter lists of ports and VLANs.
To reference ports or a range of ports on a specific module, the command syntax is displayed as mod/ports..., mod/port..., or mod_num/port_num. You can designate ports by entering the module and port number pairs, separated by commas. To specify a range of ports, use a dash (-) between the module number and port number pairs. Dashes take precedence over commas. The following examples show several ways of designating ports:
Example 1: 2/1,2/3 denotes module 2, port 1 and module 2, port 3.
Example 2: 2/1-12 denotes module 2, ports 1 through 12.
Example 3: 2/1-2/12 also denotes module 2, ports 1 through 12.
Each VLAN is designated by a single number. You can specify lists of VLANs the same way you do for ports. Individual VLANs are separated by commas (,); ranges are separated by dashes (-). In the following example, VLANs 1 through 10 and VLAN 1000 are specified:
1-10,1000
Some commands require a MAC address that you must designate in a standard format. The MAC address format must be six hexadecimal numbers separated by hyphens, as shown in this example:
00-00-0c-24-d2-fe
Some commands require an IP address. The IP address format is 32 bits, written as four octets separated by periods (dotted decimal format). IP addresses are made up of a network section, an optional subnet section, and a host section, as shown in this example:
126.2.54.1
If DNS is configured properly on the switch, you can use IP hostnames instead of IP addresses. For information on configuring DNS, refer to the Software Configuration Guide for your switch.
If the IP alias table is configured, you can use IP aliases in place of the dotted decimal IP address. This is true for most commands that use an IP address, except commands that define the IP address or IP alias.
When entering the IPX address syntax, use the following format:
The command completion feature consists of these functions:
Use the command self-repeat function to display matches to all possible keywords if a string represents a unique match. If a unique match is not found, the longest matching string is provided. To display the matches, enter a space after the last parameter and enter ?. Once the matches are displayed, the system comes back to the prompt and displays the last command without the ?. In the example below, notice how the system repeats the command entered without the ?.
Console> (enable)set mls ndedisable Disable multilayer switching data export filterenable Enable multilayer switching data export filterengineer Engineer setting of the export filterflow Setting multilayer switching export filter<collector_ip> IP addressConsole> (enable)set mls nde
Use the keyword-lookup function to display a list of valid keywords and arguments for a command. To display the matches, enter a space after the last parameter and enter ?. For example, eight parameters are used by the set mls command. To see these parameters, enter set mls ? at the privileged prompt. In the example below, notice how the system repeats the command entered without the ?:
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
Use the partial-keyword-lookup function to display a list of commands that begin with a specific set of characters. To display the matches, enter ? immediately after the last parameter. 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 and repeats the command entered without the ?:
Console> (enable) co? configure Configure system from network copy Copy files between TFTP/RCP/module/flash devices Console> (enable) co
Use the command completion function to complete a command or keyword. When you enter a unique partial character string and press Tab, the system completes the command or keyword on the command line. For example, if you enter co at the privileged prompt and press Tab, the system completes the command as configure because it is the only command that matches the criteria.
If no completion can be done, no action is carried out and the system returns to the prompt and the last command. The cursor appears immediately after the keyword, allowing you to enter additional information.
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 NVRAM configuration is corrupted, or if the configuration register is set to enter ROM-monitor mode. From the ROM-monitor mode, you can load a system image manually from Flash memory, from a network server file, or from bootflash. You can also enter ROM-monitor mode by restarting the switch and pressing the Break key during the first 60 seconds of startup.
To connect through a terminal server, escape to the Telnet prompt, and enter the send break command to break back to the ROM-monitor mode.
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 to customize Catalyst 6000 family software.
The manual boot command has the following syntax:
Once you are in ROM-monitor mode, the prompt changes to rommon 1>. While you are in ROM-monitor mode, everytime you enter a command, the number in the prompt increments by one.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Fri Mar 3 07:06:36 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.