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

Table of Contents

Switch Command-Line Interface

Switch Command-Line Interface

You can configure and maintain the Catalyst 5000 series Ethernet, Fast 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.

To configure the 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.


Note The commands in the Switch Commands part of this book apply to the Catalyst 29xx series switches also.

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 automatically disconnect 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 Association and Telecommunications Industry Association.

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

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 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 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.
Escape character is '^]'.
Cisco Systems Console
Enter password: 
Console> quit
Connection closed by foreign host.
host%

Operating the Switch CLI

This section describes how to access the command modes and operate the switch CLI.

Accessing the Command Modes

The CLI has two modes of operation: 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 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: 
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-1 shows special keystrokes used for command-line processing:


Table  2-1: Command-Line Processing Keystrokes
Keystroke 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-2 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-2: 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. 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 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

To see a list of top-level commands and command categories, type 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, use the ? command to display a list of top-level commands and command categories, 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>

In privileged mode, enter the ? command to display a list of top-level commands and command categories, 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 
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)

Context-Sensitive Help

Usage and syntax information for individual commands can be seen by appending help or ? to any specific command.

Command Categories

On some commands (such as clear, set, and show), typing help or ? after the command provides a list of commands in that category. For example:

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 cam           Clear CAM table entries
clear cgmp          Clear CGMP statistics
clear config        Clear configuration and reset system
clear counters      Clear MAC and Port counters
clear help          Show this message
clear ip            Clear IP, use 'clear ip help' for more info
clear log           Clear log information
clear logging       Clear system logging information
clear multicast     Clear multicast router port
clear ntp           Clear NTP servers and timezone
clear port          Clear port features
clear snmp          Clear SNMP trap receiver address
clear spantree      Clear spantree parameters
clear tacacs        Clear TACACS server host/key
clear timezone      Clear timezone
clear tokenring     Clear tokenring information
clear trunk         Clear trunk ports
clear vlan          Clear a VLAN
clear vmps          Clear VMPS information
clear vtp           Clear VTP statistics

The following display shows the command categories:

clear               Clear, use 'clear help' for more info
set                 Set, use 'set help' for more info
show                Show, use 'show help' for more info
test                Test, use 'test help' for more info
clear ip            Clear IP, use 'clear ip help' for more info
set bridge          Set bridge, use 'set bridge help' for more info
set cdp             Set cdp, use 'set cdp help' for more info
set fddi            Set FDDI, use 'set fddi help' for more info
set ip              Set IP, use 'set ip help' for more info
set module          Set module, use 'set module help' for more info
set ntp             Set NTP, use 'set ntp help' for more info
set port            Set port, use 'set port help' for more info
set snmp            Set SNMP, use 'set snmp help' for more info
set spantree        Set spantree, use 'set spantree help' for more info
set system          Set system, use 'set system help' for more info
test help           Show this message
test snmp           Send trap message to SNMP trap receivers

Additional Usage Guidelines

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

The Catalyst 5000 series 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 5505 or 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 can 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 can 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 MAC address, IP address, or IP alias, which you must designate 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.

hometocprevnextglossaryfeedbacksearchhelp
Copyright 1989-1997 © Cisco Systems Inc.