cc/td/doc/product/lan/cat5000/rel_5_4
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Command-Line Interfaces

Command-Line Interfaces

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.

Switch CLI

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.

Accessing the Switch CLI

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.


Note EIA/TIA-232 was known as RS-232 before its acceptance as a standard by the Electronic Industries Alliance and Telecommunications Industry Association.

Accessing the Switch CLI through the Console (EIA/TIA-232) Port

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>

Accessing the Switch CLI through Telnet

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.

Operating the Switch CLI

This section describes command modes and functions that allow you to operate the switch CLI.

Accessing the Command Modes

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)

Command-Line Editing

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.


Table 1-1: Command-Line Editing Keystrokes
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.

Using History Substitution

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.


Table 1-2: 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.

Abbreviating a Command

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.

Completing a Partial 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.

Scrolling Down a Line or a Screen

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

  • Scroll down one line.

Press the Return key.

  • Scroll down one screen.

Press the Spacebar.


Note The ---More--- prompt is used for any output that has more lines than can be displayed on the terminal screen, including show command output.

Using Command Aliases

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.


Table 1-3: Switch CLI Command Aliases
Alias Command

?

help

batch

configure

di

show

exit

quit

logout

quit

Specifying Modules, Ports, and VLANs

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.


Table 1-4: Designating Ports and Port Ranges
Example Function

2/1

Specifies port 1 on module 2

3/4-8

Specifies ports 4, 5, 6, 7, and 8 on module 3

5/2,5/4,6/10

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.


Table 1-5: Designating VLANs and VLAN Ranges
Example Function

10

Specifies VLAN 10

5,10,15

Specifies VLANs 5, 10, and 15

10-50,500

Specifies VLANs 10 through 50, inclusive, and VLAN 500

Specifying MAC Addresses

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

Specifying IP Addresses, Hostnames, and IP Aliases

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.

Accessing Command Help

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.

Displaying Top-Level Commands and Command Categories

In normal mode, enter help or ? to display 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>
 

In privileged mode, enter help or ? to display top-level commands and command categories, as follows:

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)
Displaying Command Categories

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 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
...
Using Context-Sensitive Help

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> 

Performing Keyword Lookups

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

ROM Monitor CLI

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.


Note The ROM monitor CLI is present only on the Supervisor Engine III, Supervisor Engine III F and the Catalyst 4000 family, 2926G series, 2948G, and 29890G supervisor engine modules. The Supervisor Engine I and II modules do not have a ROM monitor interface.

Accessing the ROM Monitor CLI

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.


Note The Break key is always enabled for 60 seconds after rebooting the system, regardless of whether the Break key is configured to be off by configuration register settings.

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.

Operating the ROM Monitor CLI

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:


Note The Catalyst enterprise LAN switches do not support netboot.

Once you are in ROM monitor mode, the prompt changes to rommon #>.


hometocprevnextglossaryfeedbacksearchhelp
Posted: Tue Mar 21 09:06:03 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.