home next prev

Table of Contents

Switch Command-Line Interface

Switch Command-Line Interface

You configure and maintain the Catalyst 5000 series Ethernet, Fast Ethernet, Copper Distributed Data Interface (CDDI), and Fiber Distributed Data Interface (FDDI) modules by entering commands from the switch command-line interface (CLI). In addition, through the CLI session command, you can access the router configuration software. The CLI is a basic command-line interpreter similar to the UNIX C shell. Command-line editing is provided, including history substitution and the creation of aliases.

This chapter contains the following sections:

In order to configure the Asynchronous Transfer Mode (ATM) module, you must use the ATM module CLI. For more information about the ATM module CLI, refer to the "ATM Command-Line Interface" chapter.

Accessing the Switch CLI

You 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 are automatically disconnected after remaining idle for a configurable time period.


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

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

To access the switch through the console (EIA/TIA-232) port, perform the steps in Table 2-1.


Table 2-1: Accessing the Switch CLI via the Console Port
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.
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 the following display:

Cisco Systems Console
Enter password:
Console>
Console>

Accessing the Switch CLI via Telnet

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 the steps in Table 2-2.


Table  2-2: Accessing the Switch CLI via Telnet
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 address
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. Appropriate commands
Step 4 When finished, exit the Telnet session. quit

After connecting through a Telnet session, you see the following display:

host% telnet cat5000-1.cisco.com
Trying 172.16.44.30 ...
Connected to cat5000-1.
Escape character is '^]'.


Cisco Systems Console




Enter password: <password>
cat5000-1> quit
Connection closed by foreign host.
host%

Operating the Switch CLI

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

Accessing the Command Modes

There are two modes of operation in the CLI: 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 issuing the enable command followed by the enable password. Privileged mode is indicated by the appearance of 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 Processing

Switch commands are not case sensitive. Commands and parameters can be abbreviated as long as they contain enough letters to be unique relative to any other currently available commands or parameters.

Table 2-3 shows special commands used for command-line processing:


Table  2-3: Command-Line Processing Commands
Command Function
Ctrl-W Deletes last word typed.
Ctrl-U Deletes entire line.
Ctrl-C Escapes and terminates prompts and lengthy tasks.
Delete key or backspace key Erases mistake when entering a command; reenter command after using this key.

Command Aliases

Table 2-4 lists command aliases that have been defined for ease of use. Like regular commands, aliases are not case sensitive. However, unlike regular commands, some aliases cannot be abbreviated.


Table  2-4: Switch CLI Command Aliases
Alias Command
? help
batch configure
di show
earl cam
exit quit
logout quit

History Substitution

Commands that you enter during each terminal session are stored in a history buffer. The history buffer stores the last 20 commands entered during a terminal session.


Table  2-5: History Substitution Commands
Command Function
Repeating recent commands:
!! Repeat the most recent command
!-nn Repeat the nnth most recent command
!nn Repeat command nn
!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
!nn aaa Add string aaa to the end of command nn
!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

Context-sensitive help for commands is provided. Type help or ? in normal or privileged mode to see a listing of the commands available in those modes. On selected commands, typing help or ? after a command will provide additional information. In general, 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.

The ? command allows you to display usage and syntax information about a specific command or to list groups of commands. In normal mode, use the ? command to display a list of top-level commands, as follows:

Console> ?
Commands:
----------------------------------------------------------------------
enable              Enable privileged mode
help                Show this message
history             Show contents of history substitution buffer
ping                Send echo packets to hosts
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
wait                Wait for x seconds
Console>

Note The overall function of the ? command is the same as the help command.

In privileged mode, enter the ? command to display a list of commands, as follows:

Console> (enable) ?
Commands:
----------------------------------------------------------------------
clear               Clear, use 'clear help' for more info
configure           Configure system from terminal/network
disable             Disable privileged mode
disconnect          Disconnect user session
download            Download code to a processor
enable              Enable privileged mode
help                Show this message
history             Show contents of history substitution buffer
ping                Send echo packets to hosts
quit                Exit from the Admin session
reconfirm           Reconfirm VMPS
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
switch              Switch to standby <clock|supervisor>
telnet              Telnet to a remote host
test                Test, use 'test help' for more info
upload              Upload code from a processor
wait                Wait for x seconds
write               Write system configuration to terminal/network
Console> (enable)

Note You can enter the ? command appended to any command associated with a group of commands, for example, clear, set, and show. Or you can append ? to any specific command for a list of usage and syntax information.

The Catalyst 5000 series switch is a multimodule system. Commands you enter from the CLI can apply to the entire system or to a specific module, port, or virtual LAN (VLAN).

The Catalyst 5000 modules (module slots), ports, and VLANs are numbered starting with 1. The supervisor module is module 1, residing in the top slot. If you are using a Catalyst 5500 with a redundant supervisor engine, the supervisor modules reside in slots 1 and 2. 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.

You 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 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, VLAN numbers 1 through 10 and VLAN 1000 are specified:

1-10,1000	

Designating MAC Addresses, IP Addresses, and IP Aliases

Some commands require a Media Access Control (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:

00-00-0c-24-d2-fe

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 the following example:

126.2.54.1

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. For more information about the set interface and set ip alias commands, refer to the "Switch set Commands" chapter.


Copyright 1989-1997 © Cisco Systems Inc.