Table Of Contents
Command-Line Interfaces
Catalyst Command-Line Interface
ROM-Monitor Command-Line Interface
Switch Command-Line Interface
Accessing the Switch CLI
Accessing the MSFC from the Switch
Working With the Command-Line Interface
MSFC Command-Line Interface
Cisco IOS Command Modes
Getting a List of Cisco IOS Commands and Syntax
Cisco IOS Command-Line Interface
Accessing Cisco IOS Configuration Mode
Viewing and Saving the Cisco IOS Configuration
Bringing Up an MSFC Interface
Command-Line Interfaces
This chapter describes the command-line interface (CLI) that you use to configure the Catalyst 6500 series switches and Ethernet modules. For descriptions of all switch and ROM monitor commands, refer to the Catalyst 6500 Series Switch Command Reference publication.
Note
For a description of the ATM Cisco IOS CLI and commands, refer to the ATM Software Configuration Guide and Command Reference—Catalyst 5000 Family and 6000 Family Switches publication. For a description of the Multilayer Switch Module (MSM) Cisco IOS CLI and commands, refer to the Multilayer Switch Module Installation and Configuration Note.
This chapter consists of these sections:
•
Catalyst Command-Line Interface
•
MSFC Command-Line Interface
Catalyst Command-Line Interface
These sections describe the Catalyst CLI:
•
ROM-Monitor Command-Line Interface
•
Switch Command-Line Interface
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 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 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.
Switch Command-Line Interface
The switch CLI is a basic command-line interpreter, similar to the UNIX C shell.
These sections describe how to use the switch CLI:
•
Accessing the Switch CLI
•
Accessing the MSFC from the Switch
•
Working With the Command-Line Interface
Accessing the Switch CLI
You can access the CLI through the supervisor engine console port or through a Telnet session.
These sections describe how to access the switch CLI:
•
Accessing the CLI through the Console Port
•
Accessing the CLI through Telnet
Accessing the CLI through the Console Port
To access the switch CLI through the console port, you must connect a console terminal to the console port through an EIA/TIA-232 (RS-232) cable.
Note
For complete information on how to connect to the supervisor engine console port, refer to the hardware documentation for your switch.
To access the switch through the console port, perform this task:
| |
Task
|
Command
|
Step 1
|
Initiate a connection from the terminal to the switch console prompt and 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.
|
-
|
Step 3
|
If necessary, enter privileged mode (you must enter privileged mode to change the switch configuration).
|
enable
|
Step 4
|
Enter the necessary commands to complete the desired tasks.
|
-
|
Step 5
|
When finished, exit the session.
|
exit
|
After accessing the switch through the console port, you see this display:
Accessing the CLI through Telnet
Before you can open a Telnet session to the switch, you must first set the IP address for the switch. For information about setting the IP address, see the "Assigning the In-Band (sc0 and sc1) Interface IP Address" section. Up to eight simultaneous Telnet sessions are supported. Telnet sessions disconnect automatically after remaining idle for a set time period.
To access the switch CLI from a remote host using Telnet, 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.
|
-
|
Step 3
|
Enter the necessary commands to complete your desired tasks.
|
-
|
Step 4
|
When finished, exit the Telnet session.
|
exit
|
This example shows how to open a Telnet session to the switch:
unix_host% telnet Catalyst_1
Escape character is '^]'.
Accessing the MSFC from the Switch
These sections describe how to access the Multilayer Switch Feature Card (MSFC) from a directly connected console port or from a Telnet session:
•
Accessing the MSFC from the Console Port
•
Accessing the MSFC from a Telnet Session
See the "MSFC Command-Line Interface" section.
Accessing the MSFC from the Console Port
You can enter the switch console command to access the MSFC from the switch CLI directly connected to the supervisor engine console port. To exit from the MSFC CLI and return to the switch CLI, press Ctrl-C three times at the Router> prompt.
To access the MSFC from the switch CLI, perform this task:
Task
|
Command
|
Access the MSFC from the switch CLI.
|
switch console [mod]1
|
Note
To access the Cisco IOS CLI on the standby MSFC, connect to the console port of the standby supervisor engine.
This example shows how to access the active MSFC from the switch CLI from the active supervisor engine and how to exit the MSFC CLI and return to the switch CLI:
Console> (enable) switch console 15
Type ^C^C^C to switch back...
Accessing the MSFC from a Telnet Session
You can enter the session mod command to access the MSFC from the switch CLI using a Telnet session. To exit from the MSFC CLI back to the switch CLI, enter the exit command at the Router> prompt.
Note
The supervisor engine software sees the MSFC as module 15 (when installed on a supervisor engine in slot 1) or module 16 (when installed on a supervisor engine in slot 2).
This example shows how to access the MSFC from the switch CLI and how to exit the MSFC CLI and return to the switch CLI:
Console> (enable) session 15
Working With the Command-Line Interface
These sections describe how to work with the switch CLI:
•
Switch CLI Command Modes
•
Designating Modules, Ports, and VLANs on the Command Line
•
Designating MAC Addresses, IP Addresses, and IP Aliases
•
Command Line Editing
•
History Substitution
•
Accessing Command Help
Switch CLI Command Modes
The switch CLI supports two modes of operation: normal and privileged. Both modes are password protected. Enter normal-mode commands for everyday system monitoring. Enter privileged-mode commands to configure the system and perform basic troubleshooting.
After you log in, the system enters normal mode automatically, which gives you access to normal-mode commands only. You can access privileged mode by entering the enable command followed by the privileged-mode password. To return to normal mode, enter the disable command at the prompt.
This example shows how to enter privileged mode:
Enter Password: <password>
Designating Modules, Ports, and VLANs on the Command Line
Switch commands are not case sensitive. You can abbreviate commands and parameters as long as they contain enough letters to be distinguished from any other currently available commands or parameters.
Catalyst 6500 series switches are multimodule systems. Commands that you enter from the CLI might apply to the entire system or to a specific module, port, or VLAN.
Modules, ports, and VLANs are numbered starting with 1. The supervisor engine is module 1, residing in slot 1. If your switch has a redundant supervisor engine, the supervisor engines reside in slots 1 and 2.
To designate a specific module, use the module number.
Port 1 is always the left-most port. To designate a specific port on a specific module, the command syntax is mod/port. For example, 3/1 denotes module 3, port 1. In some commands, such as set trunk and set port channel, 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 2-1 shows examples of how to designate ports and port ranges.
Table 2-1 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, which is a single number that is associated with the VLAN. To specify a list of VLANs, use a comma-separated list (do not insert spaces) to specify individual VLANs or a hyphen (-) between the VLAN numbers to specify a range of VLANs.
Table 2-2 shows examples of how to designate VLANs and VLAN ranges.
Table 2-2 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
|
Designating MAC Addresses, IP Addresses, and IP Aliases
Some commands require a MAC address, IP address, or IP alias, 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:
The IP address format is 32 bits, written as 4 octets separated by periods (dotted decimal format) that are made up of a network section, an optional subnet section, and a host section, as shown in the following example:
If you have configured IP aliases on the switch, 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 information on using IP aliases, see the "Defining IP Aliases" section.
If DNS is configured on the switch, you can use DNS host names in place of IP addresses. For information on configuring DNS, see "Configuring DNS."
Command Line Editing
You can scroll through the last 20 commands that are stored in the history buffer, and enter or edit the command at the prompt. Table 2-3 lists the keyboard shortcuts to use when entering and editing switch commands.
Table 2-3 Command-Line Editing Keyboard Shortcuts
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.
|
History Substitution
The history buffer stores the last 20 commands that you entered during a terminal session. History substitution allows you to access these commands without retyping them by using special abbreviated commands. Table 2-4 lists the history substitution commands.
Table 2-4 History Substitution Commands
Command
|
Function
|
Repeating 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.
|
Accessing Command Help
Enter help or ? in normal or privileged mode to see the commands that are available in those modes. On selected commands, entering help or ? after a command provides additional information, such as a command usage description. Command usage, the help menu, and when appropriate, parameter ranges are provided if you enter a command using the wrong number of arguments or inappropriate arguments. Additionally, appending help or ? to a command category displays a list of commands in that category.
MSFC Command-Line Interface
These sections describe the MSFC CLI:
•
Cisco IOS Command Modes
•
Cisco IOS Command-Line Interface
Note
In addition to the methods described in the "Accessing the MSFC from the Switch" section, you can configure Cisco IOS software to support direct Telnet access to the MSFC. Refer to "Configuring Authentication" in the Cisco IOS Security Configuration Guide:
http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/secur_c/scprt1/scdathen.htm
Cisco IOS Command Modes
The Cisco IOS user interface is divided into many different modes. The commands that are 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. For more information, see the "Getting a List of Cisco IOS Commands and Syntax" section on page 2-10.
When you start a session on the switch, you begin in user mode, which is 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 that is 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. For more information, see the "ROM-Monitor Command-Line Interface" section.
Table 2-5 lists and describes the most commonly used Cisco IOS modes.
Table 2-5 Frequently Used Cisco 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.
|
|
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.
|
|
Global configuration
|
Configure features that affect the system as a whole.
|
From the privileged EXEC mode, enter the configure terminal command.
|
|
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.
|
|
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.
|
|
The Cisco IOS command interpreter, called the EXEC, interprets and executes the commands that 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 Cisco 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. This form of help is called word help, because it completes a word for you.
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 that 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 that 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.
Press Ctrl-Z in any mode to return to privileged EXEC mode. Enter exit to return to the previous mode.
Cisco IOS Command-Line Interface
These sections describe basic Cisco IOS configuration tasks that you need to understand before you configure routing:
•
Accessing Cisco IOS Configuration Mode
•
Viewing and Saving the Cisco IOS Configuration
•
Bringing Up an MSFC Interface
Accessing Cisco IOS Configuration Mode
To access the Cisco IOS configuration mode, perform this task:
Note
Enter the switch console command to access the MSFC from the switch CLI when directly connected to the supervisor engine console port. To access the MSFC from a Telnet session, see the "Accessing the MSFC from a Telnet Session" section.
| |
Task
|
Command
|
Step 1
|
If you are in the switch CLI, enter the MSFC CLI.
|
Console> switch console [mod]
|
Step 2
|
At the EXEC prompt, enter enable mode.
|
Router> enable
|
Step 3
|
At the privileged EXEC prompt, enter global configuration mode.
|
Router# configure terminal
|
Step 4
|
Enter the commands to configure routing.
|
(Refer to the appropriate configuration tasks later in this chapter.)
|
Step 5
|
Exit configuration mode.
|
Router(config)# Ctrl-Z
|
Viewing and Saving the Cisco IOS Configuration
To view and save the configuration after you make changes, perform this task:
| |
Task
|
Command
|
Step 1
|
View the current operating configuration at the privileged EXEC prompt.
|
Router# show running-config
|
Step 2
|
View the configuration in NVRAM.
|
Router# show startup-config
|
Step 3
|
Save the current configuration to NVRAM.
|
Router# copy running-config startup-config
|
Bringing Up an MSFC Interface
In some cases, an MSFC interface might be administratively shut down. You can check the status of an interface using the show interface command.
Note
In a redundant supervisor engine setup, if an interface on one MSFC is shut down, the matching VLAN interface on the redundant MSFC will stop forwarding packets. Therefore, you should manually shut down the matching interface on the redundant MSFC.
To bring up an MSFC interface that is administratively shut down, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Specify the interface to bring up.
|
Router(config)# interface interface_type interface_num
|
Step 2
|
Bring the interface up.
|
Router(config-if)# no shutdown
|
Step 3
|
Exit configuration mode.
|
Router(config-if)# Ctrl-Z
|