Table Of Contents
Command-Line Interfaces
Accessing the Switch CLI
Accessing the CLI Using the EIA/TIA-232 Console Interface
Accessing the CLI through Telnet
Performing Command Line Processing
Performing History Substitution
IOS Command Modes
Getting a List of IOS Commands and Syntax
ROM-Monitor Command-Line Interface
Command-Line Interfaces
This chapter describes the command-line interfaces (CLIs) you use to configure the Catalyst 4006 switch with Supervisor Engine III.
This chapter consists of the following sections:
•
Accessing the Switch CLI
•
Performing Command Line Processing
•
Performing History Substitution
•
IOS Command Modes
•
Getting a List of IOS Commands and Syntax
•
ROM-Monitor Command-Line Interface
Note
For complete syntax and usage information for the commands used in this chapter, refer to the Command Reference for the Catalyst 4006 Switch with Supervisor Engine III and the publications at the following URL:
http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/index.htm
Accessing the Switch CLI
The following sections describe how to access the switch CLI:
•
Accessing the CLI Using the EIA/TIA-232 Console Interface
•
Accessing the CLI through Telnet
Accessing the CLI Using the EIA/TIA-232 Console Interface
Note
EIA/TIA-232 was known as recommended standard 232 (RS-232) before its acceptance as a standard by the Electronic Industries Alliance (EIA) and Telecommunications Industry Association (TIA).
Perform the initial switch configuration over a connection to the EIA/TIA-232 console interface. Refer to the Catalyst 4000 Family Module Installation Guide for console interface cable connection procedures.
To access the switch through the console interface, perform this task:
| |
Task
|
Command
|
Step 1
|
At the prompt, press Return.
|
|
Step 2
|
From the user EXEC prompt >, enter enable to change to enable mode (also known as privileged mode or privileged EXEC mode).
|
Switch> enable
|
Step 3
|
At the password prompt, enter the system password. The enabled # prompt appears, indicating that you have accessed the CLI in enabled mode.
|
Password: password
Switch#
|
Step 4
|
Enter the necessary commands to complete tasks.
|
|
Step 5
|
When finished, exit the session.
|
Switch# quit
|
After accessing the switch through the EIA/TIA-232 interface, you see this display:
Press Return for Console prompt
Accessing the CLI through Telnet
Note
Before you can Telnet to the switch, you must set the IP address for the switch (see the "Configuring Physical Layer 3 Interfaces" 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, perform this task:
| |
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: password
Switch#
|
Step 3
|
Enter the necessary commands to complete your desired tasks.
|
|
Step 4
|
When finished, exit the Telnet session.
|
Switch# quit
|
This example shows how to open a Telnet session to the switch:
unix_host% telnet Switch_1
Connected to 172.20.52.40.
Escape character is '^]'.
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 a command at the prompt. Table 2-1 lists the keyboard shortcuts for entering and editing switch commands.
Table 2-1 Keyboard Shortcuts
Keystrokes
|
Result
|
Press Ctrl-B or press the left arrow key1
|
Moves the cursor back one character
|
Press Ctrl-F or press the right arrow key1
|
Moves the cursor forward one character
|
Press Ctrl-A
|
Moves the cursor to the beginning of the command line
|
Press Ctrl-E
|
Moves the cursor to the end of the command line
|
Press Esc-B
|
Moves the cursor back one word
|
Press Esc-F
|
Moves the cursor forward one word
|
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-2 lists the history substitution commands.
Table 2-2 History Substitution Commands
Command
|
Result
|
Ctrl-P or the up arrow key.1
|
Recalls commands in the history buffer, beginning with the most recent command. Repeat the key sequence to recall older commands successively.
|
Ctrl-N or the down arrow key.1
|
Returns 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.
|
Switch# show history
|
Lists the last several commands you have entered in EXEC mode.
|
IOS Command Modes
Note
For complete information about IOS command modes, refer to the Cisco IOS Configuration Fundamentals Configuration Guide and the Cisco IOS Configuration Fundamentals Command Reference at
http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/index.htm
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, also called user EXEC mode. Only a limited subset of commands are available in EXEC mode. To have access to all commands, you must enter privileged EXEC mode. To access the privileged EXEC mode, you must type in a password. When you are in the privileged EXEC mode, you can type in any EXEC command or access global configuration mode. Most EXEC commands are one-time commands, such as show commands, which display the current configuration status, and clear commands, which reset counters or interfaces. The EXEC commands are not saved when the switch is rebooted.
The configuration modes allow you to make changes to the running configuration. If you save the configuration, these commands are stored when you reboot the switch. 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-up 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. For more information, see the "ROM-Monitor Command-Line Interface" section.
Table 2-3 lists and describes frequently used IOS modes.
Table 2-3 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.
|
Switch>
|
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 (if a password has been configured).
|
Switch#
|
Global configuration
|
Configure features that affect the system as a whole, such as the system time or switch name.
|
From the privileged EXEC mode, enter the configure terminal command.
|
Switch(config)#
|
Interface configuration
|
Some features are enabled for a particular interface only. 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.
|
Switch(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.
|
Switch(config-line)#
|
The IOS command interpreter, called the EXEC, interprets and runs 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 (?).
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 before the question mark. This form of help is called word help because it completes a word for you. For example, for the configure command, enter:
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.
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.
Tip
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.
Type exit to return to the previous mode. Press Ctrl-Z or enter the end command in any mode to immediately return to privileged EXEC mode.
ROM-Monitor Command-Line Interface
The ROM-monitor is a ROM-based program that is involved at power-up, reset, or when a fatal exception error 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 Ctrl-C during the first 5 seconds of startup.
Note
Ctrl-C is always enabled for 60 seconds after rebooting the switch, even if Ctrl-C is configured to be off in the configuration register settings.
When you are in ROM-monitor mode, the prompt changes to rommon 1>. Use the ? command to see the available ROM-monitor commands.
For more information about the ROM-monitor commands, refer to the Command Reference for the Catalyst 4006 Switch with Supervisor Engine III.