3.2 Basic Configuration of the Switch
3.2.1 Clearing a configuration and Cisco 2900 series

When connecting to a Catalyst OS "set command" based switch (such as the Catalyst 4000 and 6000), you are presented with a password prompt at the initial login. The default password for a Catalyst 4000 is pressing the ENTER key. Assuming you enter the correct password, you enter the switch's NORMAL mode. Normal mode equates to a router's User EXEC mode, allowing you to view most switch parameters, but not permitting any configuration changes. To make changes, you must enter PRIVILEGED mode. The privileged mode functionally equates to the router PRIVILEGED EXEC mode. In the privileged mode, you can view configuration files like you can with a router; however, in the switch privileged mode you can make configuration changes, unlike a router where you have to enter global configuration mode. With both a CLI-based switch and a set command-based switch, you enter the switch privileged mode with the enable command. With a CLI-based switch, the command prompt turns to Switch#, where a pound sign (#) rather than a greater than sign (>) follows the switch name. With a set command-based switch, the command prompt turns to Console> (enable). The switch then prompts you for a password to enter privileged mode.

Remember, you can access the switch CLI through the console interface or through a Telnet session. Like in a router, commands in a switch are additive. This means that adding configuration statements to an existing file will not completely overwrite the existing configuration.

A foolproof way of ensuring that a new configuration completely overwrites an existing configuration is to enter the clear config all command, as shown in Figure . If you clear the configuration while accessing the switch via Telnet, you will not see the output in the Figure. You see this only when directly attached to the console. This CLI command returns the switch Supervisor module to its default configuration where all ports belong to virtual LAN (VLAN) 1, there is no Virtual Trunking Protocol (VTP) domain (explained in Chapter 4), and all Spanning-Tree parameters go back to their default values. It is important to note also that entering this command also clears the console IP address. You can clear the configuration with any of the access methods, but if you do so while telnetting to the Catalyst Switch, you lose your connection because the switch no longer has an IP address. On a 2900 switch, the erase startup-config command erases the configuration that is stored in NVRAM. On a 2900 switch, this does not erase the VLAN information. In order to erase the VLAN information, use the del flash:vlan.dat command.

The clear config all command affects only modules that are directly configured from the Supervisor module. To clear the configurations on the router modules, you need to access the modules with the session module_number command. This command performs the equivalent of an internal Telnet to the module. To display which slot the router module is in, use the show module command. The router modules on a switch use Cisco IOS commands to change, save, and clear configurations.

Unlike routers, the set command-based switch immediately stores commands in nonvolatile random-access memory (NVRAM) and does not require you to perform a copy run start command. Any command typed into a switch is immediately stored and remembered, even through a power cycle. This presents a challenge when attempting to reverse a series of commands. On a router, you can reverse a series of commands with reload, as long as you didn't write the running configuration into NVRAM.

Before making serious changes to a set command-based switch, copy the configuration to a backup text file or to a Trivial File Transfer Protocol (TFTP) server (described later in this section). Then if you do not like the changes you made, you can use the clear config all command to clear the switch. Then load the previously saved configuration file.

On the other hand, if you are working with a Cisco IOS command-based switch, the switch behaves much more like a router. In the switch user exec mode, you cannot make changes. Use the enable command to access privileged mode where you will be able to view extensive configuration parameters. However, you still cannot configure the switch. To configure the switch, you must enter configuration mode by using the configure command. This command puts the switch in global configuration mode, where you are able to configure the switch.

Configuring the switch through the console and through Telnet allows you to enter commands in real time, but only one at a time. Unlike set command-based switches, the Cisco IOS command-based switch does not immediately store commands in NVRAM, and does require you to perform a copy run start like a router. This greatly reduces the challenge when attempting to reverse a series of commands. As with a router, you can reverse a series of commands with a reload (provided that you didn't write the running configuration into NVRAM).