Table Of Contents
Using the Command-Line Interface
Type of Memory
Platforms
CLI Command Modes
User EXEC Mode
Privileged EXEC Mode
VLAN Configuration Mode
Global Configuration Mode
Interface Configuration Mode
Line Configuration Mode
Command Summary
Using the Command-Line Interface
The Catalyst 2950 switches are supported by Cisco IOS Release 12.1(6)EA2. This chapter describes how to use the switch command-line interface (CLI) to configure the software features.
For a complete description of the commands that support these features, see "Cisco IOS Commands." For more information about Cisco IOS Release 12.1, refer to the IOS documentation set available from the Cisco.com home page at Service and Support > Technical Documents. On the Cisco Product Documentation home page, select Release 12.1 from the Cisco IOS Software drop-down list.
For task-oriented configuration steps, refer to the Catalyst 2950 Desktop Switch Software Configuration Guide.
The switches are preconfigured and begin forwarding packets as soon as they are attached to compatible devices.
By default, all ports belong to virtual LAN (VLAN) 1. Access to the switch itself is also through VLAN 1, which is the default management VLAN. The management VLAN is configurable. You manage the switch by using Telnet, web-based management, and Simple Network Management Protocol (SNMP) through devices connected to ports assigned to the management VLAN.
Type of Memory
The switch Flash memory stores the Cisco IOS software image, the startup configuration file, and helper files.
Platforms
Cisco IOS Release 12.1(6)EA2 runs on a variety of switches. For a complete list, refer to the Release Notes for the Catalyst 2950 Switch.
CLI Command Modes
This section describes the CLI command mode structure. Command modes support specific Cisco IOS commands. For example, the interface type_number command works only when entered in global configuration mode. These are the main command modes:
•
User EXEC mode
•
Privileged EXEC mode
•
VLAN configuration mode
•
Global configuration mode
•
Interface configuration mode
•
Line configuration mode
Table 1-1 lists the command modes, how to access each mode, the prompt you will see in that mode, and how to exit that mode. The prompts listed assume the default name Switch.
Table 1-1 Command Modes Summary
Command Mode
|
Access Method
|
Prompt
|
Exit or Access Next Mode
|
User EXEC
|
This is the first level of access.
(For the switch) Change terminal settings, perform basic tasks, and list system information.
|
|
Enter the logout command.
To enter privileged EXEC mode, enter the enable command.
|
Privileged EXEC
|
From user EXEC mode, enter the enable command.
|
|
To exit to user EXEC mode, enter the disable command.
To enter global configuration mode, enter the configure command.
|
VLAN configuration
|
From privileged EXEC mode, enter the vlan database command.
|
|
To exit to privileged EXEC mode, enter the exit command.
|
Global configuration
|
From privileged EXEC mode, enter the configure command.
|
|
To exit to privileged EXEC mode, enter the exit or end command, or press Ctrl-Z.
To enter interface configuration mode, enter the interface command.
|
Interface configuration
|
From global configuration mode, specify an interface by entering the interface command.
|
|
To exit to privileged EXEC mode, enter the end command, or press Ctrl-Z.
To exit to global configuration mode, enter the exit command.
To enter subinterface configuration mode, specify a subinterface with the interface command.
|
Line configuration
|
From global configuration mode, specify a line by entering the line command.
|
|
To exit to global configuration mode, enter the exit command.
To return to privileged EXEC mode, enter the end command, or press Ctrl-Z.
|
User EXEC Mode
After you access the device, you are automatically in user EXEC command mode. The EXEC commands available at the user level are a subset of those available at the privileged level. In general, use the user EXEC commands to change terminal settings temporarily, to perform basic tests, and to list system information.
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
Privileged EXEC Mode
Because many of the privileged commands configure operating parameters, privileged access should be password-protected to prevent unauthorized use. The privileged command set includes those commands contained in user EXEC mode, as well as the configure command through which you access the remaining command modes.
If your system administrator has set a password, you are prompted to enter it before being granted access to privileged EXEC mode. The password does not appear on the screen and is case sensitive.
The privileged EXEC mode prompt is the device name followed by the pound sign (#).
Enter the enable command to access privileged EXEC mode:
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
To return to user EXEC mode, enter the disable command.
VLAN Configuration Mode
Use the VLAN configuration commands to modify VLAN parameters. Enter the vlan database command to access VLAN configuration mode:
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
To return to privileged EXEC mode, enter the abort command to abandon the proposed database. Otherwise, enter exit to implement the proposed new VLAN database and to return to privileged EXEC mode.
Global Configuration Mode
Global configuration commands apply to features that affect the device as a whole. Use the configure privileged EXEC command to enter global configuration mode. The default is to enter commands from the management console.
When you enter the configure command, a message prompts you for the source of the configuration commands:
Configuring from terminal, memory, or network [terminal]?
You can specify either the terminal or nonvolatile RAM (NVRAM) as the source of configuration commands.
This example shows you how to access global configuration mode:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
To exit global configuration command mode and to return to privileged EXEC mode, enter the end or exit command, or press Ctrl-Z.
Interface Configuration Mode
Interface configuration commands modify the operation of the interface. Interface configuration commands always follow a global configuration command, which defines the interface type.
Use the interface type_number.subif command to access interface configuration mode. The new prompt shows interface configuration mode.
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
To exit interface configuration mode and to return to global configuration mode, enter the exit command. To exit interface configuration mode and to return to privileged EXEC mode, enter the end command, or press Ctrl-Z.
Line Configuration Mode
Line configuration commands modify the operation of a terminal line. Line configuration commands always follow a line command, which defines a line number. Use these commands to change terminal parameter settings line-by-line or for a range of lines.
Use the line vty line_number [ending_line_number] command to enter line configuration mode. The new prompt indicates line configuration mode.
This example shows how to enter line configuration mode for virtual terminal line 7:
Switch(config)# line vty 0 7
The supported commands can vary depending on the version of IOS software in use. To view a comprehensive list of commands, enter a question mark (?) at the prompt.
To exit line configuration mode and to return to global configuration mode, use the exit command.
To exit line configuration mode and to return to privileged EXEC mode, enter the end command, or press Ctrl-Z.
Command Summary
Note
Cisco IOS Release 12.1(6)EA2 does not support the Catalyst 2950-12 and 2950-24 switches.
Table 1-2 lists and describes commands that have the same function but different syntax in software releases earlier than Release 12.1(6)EA2 and in Release 12.1(6)EA2 or later. It lists the commands supported in releases earlier than Release 12.1(6)EA2, the equivalent commands in Release 12.1(6)EA2 or later, and command descriptions.
If you are running Release 12.1(6)EA2 or later, the switch supports the commands in the left column of Table 1-2 only if they are in a saved configuration file. When you save the switch configuration after modifying it, the commands in Table 1-2 are replaced by equivalent commands supported in Release 12.1(6)EA2 or later.
For information about commands listed in the left column of Table 1-2, refer to the Catalyst 2950 Desktop Switch Command Reference, Cisco IOS Release 12.0(5.2)WC(1) (April 2001). You can access this document at this URL:
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat2950/2950_wc/index.htm.
Table 1-2 Command Comparison
Command in IOS releases earlier than Release 12.1(6)EA2
|
Command in Release 12.1(6)EA2 or later
|
Description
|
mac-address-table secure
|
switchport port-security mac-address
|
Adds secure addresses to the MAC address table.
|
port group
|
channel-group
|
Assigns a port to a Fast EtherChannel or Gigabit EtherChannel port group.
|
port monitor
|
monitor session
|
Enables Switch Port Analyzer (SPAN) port monitoring on a port.
|
port protected
|
switchport protected
|
Isolates Layer 2 unicast, multicast, and broadcast traffic from other protected ports on the same switch.
|
port security
|
switchport port-security
|
Enables port security on a port and restricts the use of the port to a user-defined group of stations.
|
port security action
|
switchport port-security violation
|
Specifies the action to take when an address violation occurs on a secure port.
|
port security max-mac-count
|
switchport port-security maximum
|
Specifies the maximum number of secure addresses supported by a secure port.
|
port storm-control
|
storm-control
|
Enables unicast, multicast, or broadcast storm control on a port, and specifies storm-control parameters on a port.
|
show mac-address-table secure
|
show port-security
|
Displays the port security settings for an interface and the secure addresses in the MAC address table.
|
show port group
|
show etherchannel
|
Displays EtherChannel information for a channel.
|
show port monitor
|
show monitor
|
Displays SPAN session information.
|
show port protected
|
show interfaces switchport
|
Displays the port protection settings of a port.
|
show port security
|
show port-security
|
Displays the port security settings defined for a port.
|
show port storm-control
|
show storm-control
|
Displays the packet-storm control information.
|
spanning-tree rootguard
|
spanning-tree guard
|
Enables the root guard feature for all VLANs associated with a port.
|
switchport priority
|
mls qos cos
|
Defines the default class of service (CoS) value of a port.
|
switchport priority override
|
mls qos cos override
|
Assigns the default CoS value to all incoming packets on a port.
|
Table 1-3 lists and describes the commands that are not supported in Release 12.1(6)EA2 or later. These commands are supported only in software releases earlier than Release 12.1(6)EA2. If you are running Release 12.1(6)EA2 or later, the switch supports the commands listed in Table 1-3 only if they are in a saved configuration file.
Table 1-3 Commands Not Supported in Release 12.1(6)EA2 or Later
Command
|
Description
|
clear ip address
|
Deletes an IP address for a switch without disabling the IP processing.
|
clear mac-address-table static
|
Deletes static entries from the MAC address table.
|
management
|
Shuts down the current management VLAN interface and enables the new management VLAN interface.
|
show mac-address-table self
|
Displays the addresses added by the switch itself to the MAC address table.
|
spanning-tree protocol
|
Specifies the Spanning Tree Protocol (STP) to be used for specified spanning-tree instances.
In Release 12.1(6)EA2 or later, the switch supports only IEEE Ethernet STP.
|
For detailed command syntax and descriptions, see "Cisco IOS Commands." For task-oriented configuration steps, refer to the software configuration guide for this release.