Table Of Contents
Before You Begin
About the Switch Prompt
About the CLI Command Modes
Understanding CLI Command Hierarchy
EXEC Mode Options
Configuration Mode
Configuration Mode Commands and Submodes
Before You Begin
This chapter prepares you to configure switches from the CLI. It also lists the information you need to have before you begin, and it describes the CLI command modes.
This chapter includes the following sections:
•About the Switch Prompt
•About the CLI Command Modes
•Understanding CLI Command Hierarchy
About the Switch Prompt
Note Refer to the Cisco MDS 9200 Series Hardware Installation Guide or the Cisco MDS 9500 Series Hardware Installation Guide for installation and connection instructions.
Once the switch is powered on successfully, you see the default switch prompt (switch#) as shown in Example 1-1.
Example 1-1 Output When a Switch Boots Up
You can perform embedded CLI operations, access command history, and use command parsing functions at this prompt. The switch gathers the command string upon detecting an Enter (CR) and accepts commands from the terminal.
About the CLI Command Modes
Switches in the Cisco MDS 9000 Family have two main command modes—user EXEC mode and configuration mode. The commands available to you depend on the mode you are in. To obtain a list of available commands in either mode, type a question mark (?) at the system prompt.
Table 1-1 lists and describes the two commonly used modes, how to enter the modes, and the resulting system prompts. The system prompt helps you identify which mode you are in and hence, which commands are available to you.
Table 1-1 Frequently Used Switch Command Modes
Mode
|
Description of Use
|
How to Access
|
Prompt
|
EXEC
|
Enables you to temporarily change terminal settings, perform basic tests, and display system information.
Note Changes made in this mode are generally not saved across system resets.
|
At the switch prompt, enter the required EXEC mode command.
|
|
Configuration mode
|
Enables you to configure features that affect the system as a whole.
Note Changes made in this mode are saved across system resets if you save your configuration.
|
From EXEC mode, enter the config terminal command.
|
|
You can abbreviate commands and keywords by entering just enough characters to make the command unique from other commands. For example, you can abbreviate the config terminal command to conf t.
Understanding CLI Command Hierarchy
The CLI commands are organized hierarchically, with commands that perform similar functions grouped under the same level. For example, all commands that display information about the system, configuration, or hardware are grouped under the show command, and all commands that allow you to configure the switch are grouped under the config terminal command.
To execute a command, you enter the command by starting at the top level of the hierarchy. For example, to configure a Fibre Channel interface, use the config terminal command. Once you are in configuration mode, issue the interface command. When you are in the interface submode, you can query the available commands there.
The following example shows how to query the available commands in the interface submode:
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface fc1/1
Interface configuration commands:
channel-group Add to/remove from a port-channel
exit Exit from this submode
fcdomain Enter the interface submode
fspf To configure FSPF related parameters
no Negate a command or set its defaults
shutdown Enable/disable an interface
switchport Configure switchport parameters
EXEC Mode Options
When you start a session on the switch, you begin in EXEC mode. Based on the role or group to which you belong, you have access to limited commands or to all commands. From EXEC mode, you can enter configuration mode. Most of the EXEC commands are one-time commands, such as show commands, which display the current configuration status. Here is a list of EXEC mode commands:
attach Connect to a specific linecard
callhome Callhome commands
cd Change current directory
clock Manage the system clock
config Enter configuration mode
copy Copy from one file to another
debug Debugging functions
dir Directory listing for files
discover Discover information
fctrace Trace the route for an N-Port.
find Find a file below the current directory
mkdir Create new directory
no Disable debugging functions
purge Deletes unused data
pwd View current directory
reload Reboot the entire box
rmdir Remove existing directory
run-script Run shell scripts
send Send message to all the open sessions
setup Run the basic SETUP command facility
show Show running system information
sleep Sleep for the specified number of seconds
system System management commands
tail Display the last part of a file
telnet Telnet to another system
terminal Set terminal line parameters
traceroute Trace route to destination
undebug Disable Debugging functions (See also debug)
write Write current configuration
zone Execute Zone Server commands
Configuration Mode
In configuration mode, you can make changes to the existing configuration. When you save the configuration, these commands are preserved across switch reboots. Once you are in configuration mode, you can enter interface configuration mode, zone configuration mode, and a variety of protocol-specific modes. Configuration mode is the starting point for all configuration commands. When you are in configuration mode, the switch expects configuration commands from the user.
The following example shows output from the config terminal command:
Enter configuration commands, one per line. End with CNTL/Z.
Configuration Mode Commands and Submodes
Here is a list of configuration mode commands:
Enter configuration commands, one per line. End with CNTL/Z.
arp [no] remove an entry from the ARP cache
boot Configure boot variables
callhome Enter the callhome configuration mode
clock Configure time-of-day clock
end Exit from configure mode
exit Exit from configure mode
fcalias Fcalias configuration commands
fcanalyzer Configure cisco fabric analyzer
fcc Configure FC Congestion Control
fcdomain Enter the fcdomain configuration mode
fcdroplatency Configure switch or network latency
fcinterop Interop commands.
fcns Name server configuration
fcroute Configure FC routes
fcs Configure Fabric Config Server
fctimer Configure fibre channel timers
in-order-guarantee Set in-order delivery guarantee
interface Select an interface to configure
line Configure a terminal line
logging Modify message logging facilities
no Negate a command or set its defaults
power Configure power supply
poweroff Poweroff a module in the switch
qos Configure priority of FC control frames
radius-server Configure RADIUS related parameters
rscn Config commands for RSCN
snmp-server Configure snmp server
span Enter SPAN configuration mode
ssh Configure SSH parameters
switchname Configure system's network name
system System config command
trunk Configure Switch wide trunk protocol
username Configure user information.
vsan Enter the vsan configuration mode
wwn Set secondary base MAC addr and range for additional WWNs
zone Zone configuration commands
zoneset Zoneset configuration commands
Configuration mode, also known as terminal configuration mode, has several submodes. Each of these submodes places you deeper in the prompt hierarchy. When you type exit, the switch backs out one level and returns you to the previous level. When you type end, the switch backs out to the user EXEC level.
Note In configuration mode, you can alternatively enter
— Ctrl-Z instead of the end command, and
— Ctrl-G instead of the exit command
You can execute an EXEC mode command from a configuration mode or submode prompt. You can issue this command from any submode within the configuration mode. When in configuration mode (or in any submode), enter the do command along with the required EXEC mode command. The entered command is executed at the EXEC level and the prompt resumes its current mode level.
switch(config)# do terminal session-timeout 0
In this example, terminal session-timeout is an EXEC mode command—you are issuing an EXEC mode command using the configuration mode do command.
The do command applies to all EXEC mode commands other than the end and exit commands. You can also use the help (?) and command completion (Tab) features for EXEC commands when issuing a do command along with the EXEC command.
Table 1-2 lists some useful command keys that can be used in both EXEC and configuration modes.
Table 1-2 Useful Command Key Description
Command
|
Description
|
Ctrl-P
|
Up history
|
Ctrl-N
|
Down history
|
Ctrl-R
|
Refreshes the current line and reprints it.
|
Ctrl-X-H
|
List history
|
Alt-P
|
History search backwards
Note The difference between Tab completion and Alt- P or Alt-N is that Tab completes the current word while Alt- P and Alt-N completes a previously entered command.
|
Alt-N
|
History search forwards
|
Ctrl-G
|
Exit
|
Ctrl-Z
|
End
|
Ctrl-L
|
Clear screen
|
Table 1-3 displays the commonly used configuration submodes.
Table 1-3 Submodes Within the Configuration Mode
Submode Name
|
From Configuration Mode Enter
|
Submode Prompt
|
Configured Information
|
Call Home
|
callhome
|
switch(config-callhome)#
|
Contact, destination, and e-mail
|
FCS Registration
|
fcs register
|
switch(config-fcs-register)#
|
FCS attribute registration
|
From FCS registration submode:
platform name name vsan vsan-id
|
switch(config-fcs-register-att
rib)#
|
Platform name and VSAN ID association
|
Fibre Channel alias
|
fcalias name name vsan vsan-id
|
switch(config-fcalias)#
|
Alias member
|
FSPF
|
fspf config vsan vsan-id
|
switch(config-(fspf-config))#
|
Static SPF computation, hold time, and autonomous region
|
Interface configuration
|
interface type slot/port
|
switch(config-if)#
|
Channel groups, Fibre Channel domains, FSPF parameters, switch port trunk and beacon information, and IP address
|
From the VSAN or mgmt0 (management) interface configuration submode:
vrrp number
|
switch(config-if-vrrp)#
|
Virtual router
|
Line console
|
line console
|
switch(config-console)#
|
Primary terminal console
|
VTY
|
line vty
|
switch(config-line)#
|
Virtual terminal line
|
Role
|
role name
|
switch(config-role)#
|
Rule
|
SPAN
|
span session number
|
switch(config-span)#
|
SPAN source, destination, and suspend session information
|
VSAN database
|
vsan database
|
switch(config-vsan-db)#
|
VSAN database
|
Zone
|
zone name string vsan vsan-id
|
switch(config-zone)#
|
Zone member
|
Zone set
|
zoneset name name vsan vsan-id
|
switch(config-zoneset)#
|
Zone set member
|