cc/td/doc/product/lan/cat6000/ios127xe
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Command-Line Interfaces

Command-Line Interfaces

This chapter describes the command-line interfaces (CLIs) you use to configure the Catalyst 6000 family switches.


Note For descriptions of all switch and ROM-monitor commands, refer to the Catalyst 6000 Family IOS Command Reference publication.

This chapter contains these sections:

Understanding the Command-Line Interface

You can configure Catalyst 6000 family switches from the command-line interface (CLI) or remotely by Telnet. To use the CLI, you must be connected to the switch through the console interface.

IOS Command Modes

The IOS user interface is divided into many different modes. The commands available to you depend on which mode you are currently in. To get a list of the commands in a given mode, type a question mark (?) at the system prompt. See the "Getting a List of IOS Commands and Syntax" section.

When you start a session on the switch, you begin in user mode, often called user EXEC mode. Only a limited subset of the commands are available in EXEC mode. To have access to all commands, you must enter privileged EXEC mode. Normally, you must type in a password to access privileged EXEC mode. From privileged EXEC mode, you can type in any EXEC command or access global configuration mode. Most of the EXEC commands are one-time commands, such as show commands, which show the current configuration status, and clear commands, which clear counters or interfaces. The EXEC commands are not saved across reboots of the switch.

The configuration modes allow you to make changes to the running configuration. If you later save the configuration, these commands are stored across switch reboots. You must start at global configuration mode. From global configuration mode, you can enter interface configuration mode, subinterface configuration mode, and a variety of protocol-specific modes.

ROM-monitor mode is a separate mode used when the switch cannot boot properly. For example, the switch might enter ROM-monitor mode if it does not find a valid system image when it is booting, or if its configuration file is corrupted at startup. See the "ROM-Monitor Command-Line Interface" section.

Table 2-1 lists and describes the most commonly used IOS modes.


Table 2-1: Frequently Used IOS Command Modes
Mode Description of Use How to Access Prompt

User EXEC

Connect to remote devices, change terminal settings on a temporary basis, perform basic tests, and display system information.

Log in.

Router>

Privileged EXEC (enable)

Set operating parameters. The privileged command set includes the commands in user EXEC mode, as well as the configure command. Use this command to access the other command modes.

From the user EXEC mode, enter the enable command and the enable password.

Router#

Global configuration

Configure features that affect the system as a whole.

From the privileged EXEC mode, enter the configure terminal command.

Router(config)#

Interface configuration

Many features are enabled for a particular interface. Interface commands enable or modify the operation of a Gigabit Ethernet or Fast Ethernet interface.

From global configuration mode, enter the interface type location command.

Router(config-if)#

Console configuration

From the directly connected console or the virtual terminal used with Telnet, use this configuration mode to configure the console interface.

From global configuration mode, enter the line console 0 command.

Router(config-line)#

The IOS command interpreter, called the EXEC, interprets and executes the commands you enter. You can abbreviate commands and keywords by entering just enough characters to make the command unique from other commands. For example, you can abbreviate the show command to sh and the configure terminal command to config t.

When you type exit, the switch backs out one level. To exit configuration mode completely and return to privileged EXEC mode, press Ctrl-Z.

Getting a List of IOS Commands and Syntax

In any command mode, you can get a list of available commands by entering a question mark (?).

Router?

To obtain a list of commands that begin with a particular character sequence, type in those characters followed by the question mark (?). Do not include a space. This form of help is called word help, because it completes a word for you.

Router# co?
configure

To list keywords or arguments, enter a question mark in place of a keyword or argument. Include a space before the question mark. This form of help is called command syntax help, because it reminds you which keywords or arguments are applicable based on the command, keywords, and arguments you have already entered.

Router# configure ?
	memory	Configure from NV memory
	network	Configure from a TFTP network host
	overwrite-network	Overwrite NV memory from TFTP network host
	terminal	Configure from the terminal                         

To redisplay a command you previously entered, press the up-arrow key or Ctrl-P. You can continue to press the up-arrow key to see the last 20 commands you entered.

Tips If you are having trouble entering a command, check the system prompt, and enter the question mark (?) for a list of available commands. You might be in the wrong command mode or using incorrect syntax.

Press Ctrl-Z in any mode to immediately return to privileged EXEC mode. Enter exit to return to the previous mode.

Switch Command-Line Interface

The Catalyst 6000 family switch CLI is a command-line interpreter, similar to the UNIX C shell.

Accessing the Switch CLI

You can access the CLI from the switch through the EIA/TIA-232 interface or through Telnet. Telnet disconnects automatically after remaining idle for the period specified with the exec-timeout command.


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

Accessing the CLI through the EIA/TIA-232 Interface

To access the switch through the EIA/TIA-232 interface, perform this task
Step Command Purpose

1 . 

At the prompt, press Return.

2 . 

Router> enable

From the user EXEC prompt >, enter enable to change to enable mode (also known as privileged mode or privileged EXEC mode).

3 . 

Password: password
 
Router# 

At the password prompt, enter the system password. The enabled # prompt appears, indicating that you have accessed the CLI in enabled mode.

4 . 

Enter the necessary commands to complete your desired tasks.

5 . 

Router# quit

When finished, exit the session.

:

After accessing the switch through the EIA/TIA-232 interface, you see this display:

Press Return for Console prompt
 
 
Router> enable
Password:
Router# 

Accessing the CLI through Telnet

Before you can Telnet to the switch, you must set the IP address for the switch (see the "Configuring an IP Address on a Layer 3 Interface" section). The switch supports up to eight simultaneous Telnet sessions. Telnet sessions disconnect automatically after remaining idle for the period specified with the exec-timeout command.

To Telnet to the switch from a remote host with Telnet, perform this task
Step Command Purpose

1 . 

telnet {hostname | ip_addr}

From the remote host, enter the telnet command and the name or IP address of the switch you want to access.

2 . 

Password: password
 
Router# 

At the prompt, enter the password for the CLI. If no password has been configured, press Return.

3 . 

Enter the necessary commands to complete your desired tasks.

4 . 

Router# quit

When finished, exit the Telnet session.

:

This example shows how to open a Telnet session to the switch:

unix_host% telnet Router_1
Trying 172.20.52.40...
Connected to 172.20.52.40.
Escape character is '^]'.
 
 
User Access Verification
 
Password:
Router_1> enable
Password:
Router_1# 

Operating the Switch CLI

There are two modes of operation, which are both password protected: normal and privileged. Enter normal-mode commands for everyday system monitoring. Enter privileged-mode commands for system configuration and basic troubleshooting.

After you log in, the switch enters normal mode automatically, which gives you access to normal-mode commands only. You can enter privileged mode by entering the enable command followed by a second password. To return to normal mode, enter the disable command at the prompt.

This example shows how to enter privileged mode:

Router> enable
Enter Password:
Router#

Performing Command Line Processing

Switch commands are not case sensitive. You can abbreviate commands and parameters if the abbreviations 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. Table 2-2 lists the keyboard shortcuts for entering and editing switch commands.


Table 2-2: Keyboard Shortcuts
Keystrokes Purpose

Press Ctrl-B or
press the left arrow key1

Move the cursor back one character

Press Ctrl-F or
press the right arrow key1

Move the cursor forward one character

Press Ctrl-A

Move the cursor to the beginning of the command line

Press Ctrl-E

Move the cursor to the end of the command line

Press Esc B

Move the cursor back one word

Press Esc F

Move the cursor forward one word

1The arrow keys function only on ANSI-compatible terminals such as VT100s.

Performing History Substitution

The history buffer stores the last 20 commands you entered. History substitution allows you to access these commands without retyping them, by using special abbreviated commands. Table 2-3 lists the history substitution commands.


Table 2-3: History Substitution Commands
Command Purpose

Press Ctrl-P or the up arrow key.1

Recall commands in the history buffer, beginning with the most recent command. Repeat the key sequence to recall successively older commands.

Press Ctrl-N or the down arrow key.1

Return to more recent commands in the history buffer after recalling commands with Ctrl-P or the up arrow key. Repeat the key sequence to recall successively more recent commands.

show history

While in EXEC mode, list the last several commands you have just entered.

1The arrow keys function only on ANSI-compatible terminals such as VT100s.

ROM-Monitor Command-Line Interface

The ROM-monitor is a ROM-based program that executes upon platform power-up, reset, or when a fatal exception occurs. The switch enters ROM-monitor mode if the switch does not find a valid software 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 software 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.


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

To access the ROM-monitor mode 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 1>. Use the ? command to see the available ROM-monitor commands.

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 for commands that define the IP address or IP alias. For more information about the alias commands, refer to the Catalyst 6000 Family IOS Command Reference publication.


hometocprevnextglossaryfeedbacksearchhelp
Posted: Mon Jan 3 14:27:03 PST 2000
Copyright 1989-1999©Cisco Systems Inc.