Using the Catalyst 5000/6000 Command-Line Interface

Using the Catalyst 5000/6000 Command-Line Interface

Because the Catalyst has a different pedigree than the Cisco routers, the CLI differs between the two. For example, changes in a Cisco router are not permanent until you copy the running configuration to NVRAM. The Catalyst, on the other hand, immediately and automatically copies your commands to NVRAM. Individuals who suffer from an inability to remember to save configuration files on a router enjoy this feature. However, automatic configuration saves makes restoring a configuration more challenging, as discussed earlier.

The Catalyst does not have a special configuration mode like the routers. Rather, changes can be made directly from the privileged mode. Many users enjoy this feature because it allows them to make changes (set, clear) and view results (show) from the same command level. This eliminates the effort of bouncing between configuration mode and privileged mode to make changes and observe the results.

  • Tip
    You might occasionally see Cisco refer to the Catalyst 5000/6000 interface as an XDI interface. This is Cisco’s internal identification of the interface. Another name is “CatOS.”

Command-line recall and editing vastly differed prior to Catalyst code version 4.4. With system codes prior to 4.4, command-line recall and editing consists of using UNIX shell-like commands. To recall a previous command, you need to specify how many commands back in the history file you want. Or, you can recall a command through pattern matching. To edit a command line, you need to use UNIX-like commands that specify a pattern and what to substitute in the pattern’s place. Doing command-line editing in this manner is not self intuitive for many users, unless the user is a UNIX guru.

With Catalyst Supervisor engine software release 4.4, Cisco introduced IOS-type command-line recall and editing where up and down arrows on your terminal keypad scroll you through the Catalyst’s command history buffer. If you are familiar with command-line recall and editing with a Cisco router, you will be comfortable with the Catalyst CLI. If however, you still have code levels prior to 4.4, regrettably, you must continue to use the UNIX structure.

The manner in which the Catalyst displays help differs from the router displays. The router uses a parameter-by-parameter method of displaying help, whereas the Catalyst displays a complete command syntax.

The following sections describe command-line recall, editing, and help for the Catalyst 5000 series with the XDI/CatOS style interface.

Command-Line Recall

When you enter a command in the Catalyst, it retains the command in a buffer called the history buffer. The history buffer can store up to 20 commands for you to recall and edit. Various devices have methods of recalling commands. The Catalyst uses abbreviated key sequences to recall commands. These sequences resemble what a UNIX c-shell user might use. UNIX users often live with awkward methods of recalling and editing commands. Therefore, their comfort level with the legacy Catalyst editing system is probably fairly high, but might be low for the rest of us.

In UNIX, you often perform commands with a bang included in the command line. A bang is nothing more than an exclamation point (!) on a keyboard, but “exclamation” is too difficult to say when dictating commands. Therefore, bang is used in its place. Table 4-3 summarizes the key sequence for recalling previous commands in the history buffer.

Table 4-3. Command Recall from Catalyst History Buffer

Command SequenceEffect
!!Repeats the previous command.
!-nRepeats the command n places before the previous.
!nRepeats command n in the buffer.
!aaaRepeats the command that starts with the matching string aaa.
!?aaaRepeats the command that contains the string aaa anywhere in the command.

Sometimes you not only want to recall a command, but also edit it. Table 4-4 shows the sequences to recall and edit previous commands.

Table 4-4. Catalyst Command Recall with Substitution

Command SequenceEffect
^aaa^bbbRecall previous command and substitute bbb for aaa.
!!aaaRecall previous command and append aaa.
!n aaaRecall command n and append aaa.
!aaa bbbRecall command that starts with aaa and append bbb.
!?aaa bbbRecall the command that contains aaa and append bbb. 

Suppose, for example, that you enter a command set vlan 3 2/1-10,4/12-216/1,5/7.

This command string assigns a set of ports to VLAN 3. However, you realize after entering the command that you really mean for them to be in VLAN 4 rather VLAN 3. You could retype the whole command a second time and move the ports to VLAN 4, or you could simply type ^3^4. This forces the Catalyst not only to use the previous command, but to change the number 3 to a number 4, which in this case, corrects the VLAN assignment.

One frustration when mentally recalling commands can be that you have a hard time remembering what command you entered, seven lines previously. This can become particularly challenging because the Catalyst history buffer can store up to 20 commands. Use the history command to see your history buffer. Example 4-2 shows output from a history command. Notice that the commands are numbered allowing you to reference a specific entry for command recall. For example, the output recalls command 2 from the history buffer. This caused the Catalyst to recall the history command. Note also that new commands add to the bottom of the list. Newer commands have higher numbers.

Example 4-2 Catalyst History Buffer Example

Using Help

In a Cisco router, you access help by entering ? on a command line. The router then prompts you with all possible choices for the next parameter. If you type in the next parameter and type ? again, the router displays the next set of command-line choices. In fact, the router displays help on a parameter-by-parameter basis. Additionally, when the router displays help options, it also ends by displaying the portion of the command that you entered so far. This enables you to continue to append commands to the line without needing to reenter the previous portion of the command.

The Catalyst help system functions differently from the router, though. You access help in the same manner as you do in a router, but the results differ. For example, where a router prompts you for the next parameter, the Catalyst displays the entire usage options for the command, if your command string is unique so that the Catalyst knows what command you want. Example 4-3 shows the help result for a partial command string. However, the string does not uniquely identify what parameter should be modified, so it lists all set system commands.

Example 4-3 Catalyst Help Example

On the other hand, if you have enough of the command on the line that the Catalyst recognizes what command you intend to implement, it displays the options for that command. This time, in Example 4-4, the string identifies a specific command and the Catalyst displays help appropriate for that command. The user wants to modify the console interface in some way, but is unsure of the syntax to enter the command.

Example 4-4 Another Catalyst Help Example

Notice that when the console displays help, it returns the command line with a blank line. The command string you entered so far is not displayed for you as it is on a router. You can now elect to use command recall. Suppose you want to disable the logical interface, sc0. So you want to enter the command set int sc0 down. Being a clever network administrator, you elect to use command recall and complete the command. What happens if you type !! sc0 down ? You see the command usage screen again, without the console changing state to down (see Example 4-5). This happens because the command recall executes the previous statement that was set int ? with the help question mark and your appended parameters. When you add the additional parameters, the Catalyst interprets the string as set int ? sc0 down , sees the question mark, and displays help.

Example 4-5 Command Recall after Help

If you have system code 4.4 or later, you can use the up/down arrow to perform command recall after help, but the recall includes the question mark. The advantage here, though, over the !! recall is that you can edit out the question mark on the recalled command line using router editing commands. Therefore, you can perform command recall, remove the question mark, and enter the rest of the command. The Catalyst then correctly interprets the command, assuming that you subsequently enter correct and meaningful parameters.

A Catalyst invokes help when you enter a question mark on the command line. It also provides help if you enter a partial command terminated with <ENTER>. For example, the command in Example 4-4 displays the same screen if the user enters set interface <ENTER>. The Catalyst uniquely recognizes set int, but also observes that the command is not complete enough to execute. Therefore, the Catalyst displays the command usage screen. If you intend to modify the sc0 VLAN membership to VLAN 5 and change the IP address in the same line, you can enter the command set int sc0 5 144.254.100.1 255.255.255.0. Suppose that as you enter the command you enter the VLAN number, but forget the rest of the command line.

You might be tempted to hit <ENTER> to get a command usage screen. But you do not see the usage screen. Instead, the Catalyst sees the current command line and says, “There is enough on this line to execute, so I will.” You just successfully changed the sc0 VLAN membership without changing the IP address. If you do this through a Telnet session in a production network, you probably just completely removed Telnet access to the Catalyst. It is now time to walk, drive, or fly to the Catalyst to restore connectivity. (Or call someone who can do it for you and confess your mistake!)

  • Tip
    In many cases, you can get usage help with a partial command and <ENTER>. However, it is best to use the question mark to ensure that you do not prematurely execute a command that might prove to be catastrophic to your network and career.

Supervisor Module Configuration

Modifying and viewing Catalyst 5000/6000 configuration files consists of using set, clear, and showcommands. Because the Catalyst does not use a separate configuration mode to make changes, you can make changes and view system configurations all from the same prompt level. You must make all changes from the privilege mode, which requires an enable password.

Important show Statements

To view configurations, use the show command. Example 4-6 annotates a simple Supervisor module configuration file displayed through the show config command. Some configuration lines are editorially deleted because they are redundant and needlessly consume printed space. The remaining portion of the file enables you to see the general organization of the configuration file.

Example 4-6 Annotated Supervisor Configuration File

Note in Example 4-6 that the file collates in logical sections. First, the Catalyst writes any globally applicable configuration items such as passwords, SNMP parameters, system variables, and so forth. Then, it displays configurations for each Catalyst module installed. Note that the module configuration files refer to Spanning Tree and VLAN assignments. Further, it does not display any details about other functions within the module. For example, an RSM is installed in module 5 of this Catalyst.

Although this is a router module, it attaches to a virtual bridge port internally. The Catalyst displays the bridge attachment parameters, but not the Route Switch Module (RSM) or ATM LANE configuration lines. To see the these module specific configurations, you need to access them with the session module_number and view its own configuration file.

Other show commands display item specific details. For example, to look at the current console configuration, you can use the show interface (sh int) command as demonstrated in Example 4-7.

Example 4-7 show interface Display

Another useful show command displays the modules loaded in your Catalyst (see Example 4-8).

Example 4-8 show module Output

The output in Example 4-8 displays details about the model number and description of the modules in each slot. The second block of the output tells you what MAC addresses are associated with each module. Notice that the Supervisor module reserves 1024 MAC addresses. Many of these addresses support Spanning Tree operations, but other processes are involved too. Module 3, the 24-port Ethernet module, reserves 24 MAC addresses, one for each port. These also support Spanning Tree in that they are the values used for the port ID in the Spanning Tree convergence algorithm. The third block of the display offers details regarding the Supervisor module.

Other key show statements are demonstrated throughout the rest of the book.

Modifying Catalyst Configurations

To modify a Catalyst parameter, you use either the set or clear commands. The set command changes a parameter to a value that you specify, whereas the clear command returns some parameters to their default setting.

To change system parameters, you use the set system command as demonstrated in Example 4-9.

Example 4-9 set system Example

Clearly, there are several system variables that you can modify. Example 4-9 modifies the system location object.

Some commands provide a warning if your action might cause connectivity problems for you or the users. For example, in Example 4-10, the user intends to change the IP address of the console interface. If the user is making the change remotely—that is, the user is logged in to the Catalyst through a Telnet session—the user loses connectivity and needs to re-establish the Telnet session.

Example 4-10 set interface Example

Use a clear command to restore a parameter to a default value. Suppose you have a VLAN 4 configured on the Catalyst and want to remove it. You use the command clear vlan 4. This eliminates references to VLAN 4 in the Catalyst. However, some things associated with VLAN 4 are not eliminated. For example, if you have ports assigned to VLAN 4 and you clear vlan 4, the ports assigned to VLAN 4 move into a disabled state. They do not move to VLAN 1.

You need to manually reassign the ports to VLAN 1. The clear config command demonstrated in Example 4-1 returns the whole Catalyst to its default out-of-the-box configuration. The Catalyst warns you about potential connectivity issues with this command before executing it.

About the author

Scott

Leave a Comment