|
|
This chapter introduces the command-line interface (CLI) and presents you with enough information to configure those switch features that require you to use the CLI.
This chapter is an introduction to Cisco IOS. The Catalyst 2900 Series XL Command Reference is a complete description of commands that have been created or changed for the Catalyst 2900 series switches. The documentation set for Cisco IOS Release 11.2(8) describes all commands supported by the switches.
This chapter presents the following topics:
This section describes how to perform the following tasks:
When you first power up the switch, you are prompted for IP information. To redisplay this series of prompts, enter the setup command in normal EXEC mode:
switch> setup
You can also enter IP information by following these steps:
Broadcast-storm control blocks the forwarding of packets created by broadcast storms, the bursts of broadcast traffic that ports can sometimes generate. When you enable broadcast-storm control on a port, two parameters define the beginning and end of a broadcast storm. The threshold rising parameter determines when the forwarding of broadcast packets from the port is blocked. The threshold falling parameter determines when normal forwarding resumes. You can set the port to generate a trap when these thresholds are crossed, and you can disable the port during a broadcast storm.
Switch ports are referred to with the constant fastethernet and a module and port number. Fixed ports are module 0, and 1 and 2 refer to the Catalyst 2916M expansion slot ports. The following examples are valid ports:fastethernet0/8
fa2/2
fa2/1
Follow these steps to enable broadcast storm control:
| Task | Prompt | Command |
|---|---|---|
| Step 1 Enter privileged EXEC mode | switch>
| enable |
| Step 1 Enter global configuration mode. | switch#
| configure terminal |
| Step 2 Enter interface configuration mode and define the interface to configure. | switch(config)#
| interface interface |
| Step 3 Enter the port storm-control command and the two threshold parameters. | switch(config-if)#
| port storm-control threshold [rising number falling number] |
| Step 4 Return to EXEC mode to verify the entry. | switch(config-if)#
| end |
| Step 5 Verify that the parameters were entered correctly by using the show command. | switch#
| show port storm-control interface |
You can use the file system in Flash memory to copy files and troubleshoot configuration problems. Use the dir flash: command to display the contents of Flash memory:
Switch# dir flash: Directory of flash: 2 -rwx 843947 Mar 01 1993 00:02:18 C2900XL-h-mz-112.8-SA 4 drwx 3776 Mar 01 1993 01:23:24 html 66 -rwx 130 Jan 01 1970 00:01:19 env_vars 68 -rwx 1296 Mar 01 1993 06:55:51 config.text 1728000 bytes total (456704 bytes free)
The file system uses a URL-based file specification. The following example uses the TFTP protocol to copy the file conffile.txt from the host arno to Catalyst 2900 Flash memory with the name bootfile:
switch# copy tftp://arno/2900/conffile.txt flash:bootfile
You can enter the following protocols as part of a file name:
Enter the write memory command to save your configuration changes to NVRAM so that they are not lost if there is a system reload or power outage. This example shows how to use this command to save your changes:
switch# write mem
Building configuration...
It might take a minute or two to save the configuration to NVRAM of Flash. After the configuration has been saved, the following appears:
[OK] switch#
This section describes the Cisco IOS command-mode structure. Each command mode supports specific Cisco IOS commands. For example, the interface type_number command is used only when in global configuration mode.
The Catalyst 2900 series switches support the following command modes:
Table 5-1 describes how to access each mode, the prompt you see in that mode, and how to exit the mode. The examples in the table use the host name switch.
You can use the question mark (?) and arrow keys to help you enter commands.
For a list of available commands in a command mode, enter a question mark:
switch> ?
To complete a command, enter a few known characters followed by a tab (with no space):
switch> s
For a list of command variables, enter the command followed by a space and a question mark:
switch> show ?
To redisplay a command you previously entered, press the up-arrow key. You can continue to press the up arrow key for more commands.
| Modes (Continued) | Access Method | Prompt | Exit Method | About This Mode1 |
|---|---|---|---|---|
| User EXEC | Begin a session with your switch. | switch> | Enter the logout command or quit. | Use this mode to:
|
|
Privileged EXEC | Enter the enable command while in user EXEC mode. | switch# | Enter the disable command to exit. | Use this mode to verify commands you have entered. Access to this mode should be protected with a password. |
| Global configuration | Enter the configure command while in privileged EXEC mode. | switch(config)# | To exit to privileged EXEC mode, enter the exit or end command, or press Ctrl-Z. | Use this mode to configure parameters that apply to your switch as a whole. |
| Interface configuration | Enter the interface command (with a specific interface) while in the global configuration mode. | switch(config-if)# | To exit to global configuration mode, enter the exit command. | Use this mode to configure parameters for the Ethernet interfaces. |
| Line configuration | Specify a line with the line vty or line console command while in the global configuration mode. | switch(config-line)# | To exit to global configuration mode, enter the exit command. | Use this mode to configure parameters for the terminal line. |
Because many privileged EXEC commands are used to set operating parameters, you should password-protect these commands to prevent unauthorized use.
You use two commands to do this:
You must enter an enable password to gain access to privileged EXEC mode.
For maximum security, the passwords should be different. If you enter the same password for both during the setup process, your switch prompts you to make them different.
An enable secret password can contain from 1 to 25 uppercase and lowercase alphanumeric characters. An enable password can contain any number of uppercase and lowercase alphanumeric characters. In both cases, a number cannot be the first character. Spaces are also valid password characters; for example, "two words" is a valid password. Leading spaces are ignored; trailing spaces are recognized.
If you lose or forget your enable password, refer to the "Troubleshooting" chapter for a recovery procedure.
You only have to enter enough characters for the switch to recognize the command as unique. This example show how to enter the show configuration command:
switch# show conf
The word no is a parameter that can be used as follows with most commands:
Table 5-2 lists some error messages that you might encounter while using the CLI to configure your switch.
| Error Message | Meaning | How to Get Help |
|---|---|---|
| % Ambiguous command: "show con" | You did not enter enough characters for your switch to recognize the command. | Re-enter the command followed by a question mark (?) with no space between the command and the question mark.
The possible keywords that you can enter with the command are displayed. |
| % Incomplete command. | You did not enter all of the keywords or values required by this command. | Re-enter the command followed by a question mark (?) with no space between the command and the question mark. |
| % Invalid input detected at '^' marker. | You entered the command incorrectly. The error occurred where the caret (^) appears. | Enter a question mark (?) to display all of the commands that are available in this command mode. |
|
|