|
You configure and maintain the Catalyst 2900 by entering commands from the Command Line Interface (CLI). Through the CLI, you can configure and maintain the Catalyst 2900 components.
The Command Line Interface (CLI) for the Catalyst 2900 is a basic command-line interpreter similar to that of the UNIX C Shell. Command-line editing is provided, including history substitution and the creation of aliases.
You access the 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.
To access the switch through the EIA/TIA-232 port, use the following procedure:
A connection through the console port (EIA/TIA-232) displays the following prompts on the terminal:
Cisco Systems Console
Enter password:
Console>
Console>
Console> quit
To use Telnet, you must have previously set the IP address for the switch. Refer to the "Configuring the Software" chapter for information about setting the IP address. Multiple sessions through Telnet are possible.
To access the switch from a remote host with Telnet, perform the following tasks:
Task | Command |
---|---|
From the remote host, enter the telnet command and designate the name or IP address of the switch you want to access. | telnet hostname | ip address |
At the prompt, enter the password for the CLI. The default password is Return unless a password was previously established using the set password command (See the chapter "Switch Command Reference" for details about the set password command.) | None |
Enter the necessary commands to complete your desired tasks. | Appropriate commands |
When finished, exit the Telnet session. Refer to Figure 2-1 for a sample Telnet session. | quit |
Sample Telnet Session
% telnet catalyst1
Trying 123.236.273.11...
Connected to catalyst1.
Escape character is '^]'.
Cisco Systems Console Fri Mar 10 1995, 17:50:45
Enter password:
Sorry. Try again.
Enter password:
Console>
Console>
Console>
quit
Connection closed by foreign host.
%
The switch command line command sets are not case sensitive. In addition, commands and parameters can be abbreviated. The abbreviation you use must be unique from the other commands and parameters at that level, so make sure the abbreviation contains enough letters to differentiate it from other commands and parameters. When entering a command, use Ctrl-W to delete the last word typed; use Ctrl-U to delete an entire line. If you make a mistake while entering a command, use the Delete or Backspace key to erase the mistake, and then reenter the command. The escape sequence Ctrl-C terminates prompts and lengthy tasks.
Commands you enter during each terminal session are stored in a history buffer. Commands in the history buffer may be repeated or edited in a style similar to using the UNIX C Shell. The history buffer stores the last 20 commands entered during a terminal session.
To repeat a recent command:
!! - 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
There are 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 successfully, the system automatically enters normal mode, which gives you access to normal-mode commands only. You can enter privileged mode by issuing the enable command followed by a second password. Privileged mode is indicated by (enable) immediately after the system prompt. To return to normal mode, enter the disable command at the prompt.
The following is a sample session showing entry into privileged mode:
Cisco Systems Console Fri Mar 10 1995, 17:50:45
Enter password:
Console>
Console>
Console> enable
Enter Password:
Console> (enable)
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 give further usage. 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
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, use the ? command to display a list of commands, as follows:
Console> enable
Enter password:
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
reset Reset system or module
session Sets alias for command
set Set, use 'set help' for more info
show Show, use 'show help' for more info
slip Attach/detach Serial Line IP interface
telnet Starts a telnet connection from 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)
The Catalyst 2900 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 2900 modules (module slots), ports, and VLANs are numbered starting with 1. The supervisor module is module 1, residing in the top slot. 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, 2/1 denotes module 2, port 1. In some commands, such as set trunk, set cam, and set vlan commands, 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, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12
Example 3. 2/1-2/12 is the same as Example 2
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
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:
00-00-0c-24-d2-fe
The IP address format is 32 bits, written as four 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:
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. (See the set interface and set ip alias commands in the "Switch Command Reference" chapter.)
|