Table Of Contents
Before You Begin
About the Switch Prompt
Default Switch Roles
About the CLI Command Modes
CLI Command Hierarchy
EXEC Mode Options
Configuration Mode
Configuration Mode Commands and Submodes
CLI Command Navigation
Getting Help
Command Completion
File System Completion
The no and Default Forms of Commands
CLI Command Configuration Options
Displaying the Switch Configuration
Saving a Configuration
Clearing a Configuration
Displaying Users
Using the ping Command
Setting the Terminal Timeout
Setting the Terminal Length
Displaying Terminal Settings
Internal bootflash:
Using the File System
Setting the Current File System
Listing the Files in a File System
Moving Files
Copying Files
Deleting Files
Executing Commands Specified in a Script
Setting the Delay Time
Before You Begin
This chapter prepares you to configure switches from the CLI. It also lists the information that you need before you begin, and it describes the CLI command modes.
This chapter includes the following sections:
•About the Switch Prompt
•Default Switch Roles
•About the CLI Command Modes
•CLI Command Hierarchy
•CLI Command Navigation
•Using the File System
About the Switch Prompt
Note Refer to the Cisco MDS 9020 Fabric Switch Hardware Installation Guide for installation and connection instructions.
When the switch is powered on successfully, you see the default switch prompt (switch#), as shown in Example 2-1.
Example 2-1 Output When Switch Boots Up
INIT: Switching to runlevel: 6
Saving random seed: [ OK ]
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
Sending all processes the TERM signal...
Sending all processes the KILL signal...
Unmounting loopback filesystems: umount: /dev/loop0: not mounted
Unmounting loopback filesystems (retry):
Please stand by while rebooting the system...
U-Boot 0.2.0 Revision 1.3.0.08 (Mar 8 2005 - 10:21:12)
Kernel Source Revision 2.4.18_mvl30-amazon-0034
CPU: MPC8245 Revision 1.4 at 249.999 MHz: 16 kB I-Cache 16 kB D-Cache
NAND device: Manufacture ID: 0x98, Chip ID: 0x79 (Toshiba NAND 128MiB 3,3V)
Creating 2 MTD partitions on "NAND 128MiB 3,3V":
Partition 0: 0x00000000-0x05000000 : "Amazon Image Partition"
Partition 1: 0x05000000-0x08000000 : "Amazon Config Partition"
Mounting partition '0' offset 0x0 size 80MB
### YAFFS booting: kernel=kernel.1 root=ramdisk.1 args="ramdisk=38056"
### YAFFS loading 'kernel.1' to 0x1000000
### YAFFS loading 'ramdisk.1' to 0x1100000
helper entry, hp @ 0x0x1000000, data @ 0x0x100025c, magic num 0x27051956
## Booting image at 01000000 ...
Image Name: Linux-2.4.18_mvl30-amazon
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 638540 Bytes = 623.6 kB
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 01100000 ...
Image Name: Amazon RAMDisk
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 12874182 Bytes = 12.3 MB
Verifying Checksum ... OK
Loading Ramdisk to 0f258000, end 0fe9f1c6 ... OK
Memory BAT mapping: BAT2=256Mb, BAT3=0Mb, residual: 0Mb
Linux version 2.4.18_mvl30-amazon (builds@gotham) (gcc version 3.2.1 20020930
(MontaVista)) #1 Tue F
On node 0 totalpages: 65536
Kernel command line: ramdisk=38056
OpenPIC Version 1.2 (1 CPUs and 26 IRQ sources) at fc040000
time_init: decrementer frequency = 25.011598 MHz
Calibrating delay loop... 166.29 BogoMIPS
Memory: 243920k available (1100k kernel code, 376k data, 60k init, 0k highmem)
Dentry-cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode-cache hash table entries: 16384 (order: 5, 131072 bytes)
Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
Buffer-cache hash table entries: 16384 (order: 4, 65536 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Disabling the Out Of Memory Killer
i2c-core.o: i2c core module version 2.6.2 (20011118)
i2c-dev.o: i2c /dev entries driver module version 2.6.2 (20011118)
i2c-proc.o version 2.6.2 (20011118)
pty: 256 Unix98 ptys configured
adm1021.o version 2.6.2 (20011118)
adm9240.o version 2.6.2 (20011118)
eeprom.o version 2.6.2 (20011118)
ds1339.o version 2.6.2 (20011118)
mic74.o version 2.6.2 (20011118)
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xfc004500 (irq = 137) is a 16550A
block: 128 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 38056K size 1024 blocksize
loop: loaded (max 8 devices)
natsemi.c:v1.07 1/9/2001 Written by Donald Becker <becker@scyld.com>
http://www.scyld.com/network/natsemi.html
(unofficial 2.4.x kernel port, version 1.07+LK1.0.14, Nov 27, 2001 Jeff Garzik, Tjeerd
Mulder)
eth0: NatSemi DP8381[56] at 0xd1000000, 00:c0:dd:07:12:9f, IRQ 16.
Amazon Boot Flash: Probing for AMD compatible flash...
Amazon Boot Flash: Found 1 x 1MiB AMD AM29LV800BB at 0x0
Creating 1 MTD partitions on "Amazon Boot Flash":
0x00000000-0x00100000 : "BootFlash"
NAND device: Manufacture ID: 0x98, Chip ID: 0x79 (Toshiba NAND 128MiB 3,3V)
Creating 2 MTD partitions on "NAND 128MiB 3,3V":
0x00000000-0x05000000 : "Amazon Image Partition"
0x05000000-0x08000000 : "Amazon Config Partition"
MPC10x I2C - interrupt vector 129
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 32768)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 12572k freed
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 60k init
INIT:version 2.78 bootin Welcome to Red Hat Linux
Mounting proc filesystem: [ OK ]
Configuring kernel parameters: [ OK ]
Setting hostname switch: [ OK ]
Finding module dependencies: [ OK ]
mke2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
Fragment size=1024 (log=0)
9520 inodes, 38056 blocks
1902 blocks (5.00%) reserved for the super user
8192 blocks per group, 8192 fragments per group
Superblock backups stored on blocks:
Writing inode tables: 0/51/52/53/54/5done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Mounting local filesystems: [ OK ]
Enabling swap space: [ OK ]
INIT: Entering runlevel: 3
Initializing random number generator: [ OK ]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Starting fcswitch: [ OK ]
Cisco MDS 9000 FabricWare
Copyright (C) 2002-2005, by Cisco Systems, Inc.
and its suppliers. All rights reserved.
Copyrights to certain works contained herein are owned by
third parties, and used and distributed under license.
Portions of this software are governed by the GNU Public License,
which is available at http://www.gnu.org/licenses/gpl.html.
---- Basic System Configuration Dialog ----
This setup utility will guide you through the basic configuration of
the system. Setup configures only enough connectivity for management
*Note: setup is mainly used for configuring the system initially,
when no configuration is present. So setup always assumes system
defaults and not the current system configuration values.
Press Enter if you want to skip any dialog. Use ctrl-c at anytime
to skip all remaining dialogs.
Would you like to enter the basic configuration dialog (yes/no): y
Create another login account (yes/no) [n]: n
Configure read-only SNMP community string (yes/no) [n]: y
SNMP community string: public
Configure read-write SNMP community string (yes/no) [n]: y
SNMP community string: private
Enter the switch name: rtp-9020-top
Continue with Out-of-band (mgmt0) management configuration? (yes/no) [y]: y
Mgmt0 IP address: 172.18.172.160
Mgmt0 IP netmask: 255255.255.255.0
Configure the default gateway? (yes/no) [y]: y
IP address of the default gateway: 172.18.172.1
Enable the telnet service? (yes/no) [y]: y
Enable SSH service? (yes/no) [n]: y
Configure ntp server? (yes/no) [n]: n
Configure default switchport interface state (shut/noshut) [shut]:
Configure default zone policy (permit/deny) [deny]:
The following configuration will be applied:
snmp-server community public ro
snmp-server community private rw
ip address 172.18.172.160 255.255.255.0
ip default-gateway 172.18.172.1
system default switchport shutdown
no zone default-zone permit
Would you like to edit the configuration? (yes/no) [n]:
Use this configuration and save it? (yes/no) [y]:
[########################################] 100%
You can perform embedded CLI operations, access command histories, and use command parsing functions at this prompt. The switch gathers the command string upon detecting an Enter (CR) and accepts commands from a terminal.
Default Switch Roles
The following roles are available in all switches:
•Network operator—Has permission to view the configuration.
•Network administrator—Has permission to perform all functions.
When you execute a command, perform command completion, or obtain context sensitive help, the switch software allows the operation to progress if you have the correct permission as specified in the description of the command. (See "Configuring Switch Security.")
About the CLI Command Modes
Switches in the Cisco MDS 9020 Fabric Switch 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 2-1 lists and describes the two commonly used modes, how to enter the modes, and the resulting system prompts. The system prompt helps you to identify which mode you are in and which commands are available to you.
Table 2-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. See the "Saving a Configuration" section.
|
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.
Note Do not enter percent ( % ), pound ( # ), ellipsis ( ... ), vertical bar ( | ), less than or great than ( < > ), brackets ( [ ] ), semicolor ( ; ), period ( .), comma ( , ), or braces ( { } ) in command lines. These characters have special meaning in Cisco MDS 9000 FabricWare text strings.
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. Figure 2-1 illustrates a portion of the config terminal command hierarchy.
Figure 2-1 CLI Command Hierarchy Example
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. When you are in configuration mode, enter 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.
switch(config)# interface fc1/1
end Exit from configure mode
exit Exit from this submode
help Press '?' key to display available commands
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. (See the "Role-Based Authorization" section.) 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:
cd Change current directory
clock Manage the system clock
config Enter configuration mode
copy Copy from one file to another
dir List files in a directory
help Press '?' key to display available commands
reload Reboot the entire box
run-script Run shell scripts
setup Run the basic SETUP command facility
show Show running system information
sleep Sleep for the specified number of seconds
system System management commands
terminal Set terminal line parameters
write Write current configuration
zone Execute zone server commands
zoneset Execute zoneset 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. When 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.
clock Configure time-of-day clock
end Exit from configure mode
exit Exit from configure mode
fcalias Fcalias configuration commands
fcdomain Enter the fcdomain configuration mode
fctimer Configure fibre channel timers
help Press '?' key to display available commands
interface Select an interface to configure
logging Modify message logging facilities
no Negate a command or set its defaults
snmp-server Configure snmp server
ssh Configure SSH parameters
switchname Configure system's network name
username Configure user information.
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.
You can execute an EXEC mode command from a configuration mode or submode prompt. You can enter 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 entering 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 entering a do command along with the EXEC command.
Table 2-2 lists some useful command keys that can be used in both EXEC and configuration modes:
Table 2-2 Useful Command Key Description
Command
|
Description
|
Ctrl-P
|
Up history.
|
Ctrl-N
|
Down history.
|
Ctrl-R
|
Refreshes the current line and reprints it.
|
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-L
|
Clear screen.
|
CLI Command Navigation
To redisplay a command that you previously entered, press the Up Arrow key. You can continue to press the Up Arrow key to see more previously entered commands. Similarly, you can press the Down Arrow, Right Arrow, Left Arrow, and Delete keys to navigate through the command history and to modify an existing command string.
Getting Help
In any command mode, you can get a list of available commands by entering a question mark (?).
To obtain a list of commands that begin with a particular character sequence, type in those characters followed immediately by the question mark (?). Do not include a space.
To list keywords or arguments, enter a question mark in place of a keyword or argument. Include a space before the question mark. This form of help is called command syntax help because it reminds you which keywords or arguments are applicable based on the commands, keywords, and arguments you have already entered.
terminal Configure the system from the terminal
Tip If you are having trouble entering a command, check the system prompt and enter the question mark (?) for a list of available commands. You might be in the wrong command mode or using incorrect syntax.
Command Completion
In any command mode, you can begin a particular command sequence and immediately press the Tab key to complete the rest of the command.
switch(config)# show in<tab>
switch(config)# show interface
This form of help is called command completion because it completes a word for you. If several options are available for the typed letters, all options that match those letters are presented:
switch(config)# fc<Tab><Tab>
switch(config)# fcdo<Tab>
File System Completion
You can use the Tab key to complete schemes, servers, and file names that are available in the file system, as shown in this example.
962 May 2 19:42:32 2005 running-config
26 May 1 20:16:45 2005 startup-config
The no and Default Forms of Commands
You can enter the no form of any command to perform the following actions:
•Undo a wrongly entered command.
If you enter the zone member command, you can undo the results as shown in the following example:
switch(config)# zone name test
switch(config-zone)# member pwwn 12:12:12:12:12:12:12:12
switch(config-zone)# no member pwwn 12:12:12:12:12:12:12:12
WARNING: Zone is empty. Deleting zone test. Exit the submode.
•Delete a created facility.
If you want to delete a zone that you created, enter the no zone name command, as shown in the following example:
switch(config)# zone name test
switch(config-zone)# exit
switch(config)# no zone name test
You cannot delete a zone facility called test while residing in it. You must first exit the zone submode and return to configuration mode.
CLI Command Configuration Options
You can configure the software in one of two ways:
•You can create the configuration for the switch interactively by entering commands at the CLI prompt.
•You can create an ASCII file containing a switch configuration and then load this file on the required system.
Displaying the Switch Configuration
You can view the ASCII form of the configuration file when required. To view the current configuration tree from the EXEC prompt, enter the show running-config command. If the running configuration is different from the startup configuration, enter the show startup-config command to view the ASCII version of the current startup configuration that was used to boot the switch if a copy run start command was not entered after the reboot. Use the show startup command to view the contents of the current startup configuration.
You can also gather specific information on the entire switch configuration by entering the relevant show commands. Configurations are displayed based on a specified feature, interface, or module. Available show commands for each feature are briefly described in this section and listed at the end of each chapter.
Examples 2-2 to 2-5 display show command examples.
Example 2-2 Displays Details on the Specified Interface
switch# show interface fc1/1
fc1/1 is Down (Administratively down)
Hardware is Fibre Channel, SFP is long wave laser
Port WWN is 20:00:00:0d:ec:19:cb:0e
Receive data field Size is 2112
5 minutes input rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
5 minutes output rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
0 input OLS, 0 LRR, 0 loop inits
5 output OLS, 0 LRR, 1 loop inits
Example 2-3 Displays the Software and Hardware Version
Cisco MDS 9000 FabricWare
Copyright (C) 2002-2005, by Cisco Systems, Inc.
and its suppliers. All rights reserved.
Copyrights to certain works contained herein are owned by
third parties, and used and distributed under license.
Portions of this software are governed by the GNU Public License,
which is available at http://www.gnu.org/licenses/gpl.html.
system compile time: Thu Apr 21 12:48:49 2005
switch uptime is 0 days 11 hours 34 minute(s) 3 second(s)
Last reset at 41643 usecs after Mon Apr 25 11:01:12 2005
Example 2-4 Displays the Running Configuration
ip default-gateway 10.20.83.1
ip address 10.20.83.122 255.255.255.0
Example 2-5 Displays the Difference Between the Running and Startup Configuration
switch# show running diff
ip default-gateway 172.18.172.1
snmp-server community public ro
snmp-server community private rw
ip address 172.18.172.160 255.255.255.0
Saving a Configuration
Use the copy running-config startup-config command to save the new configuration into nonvolatile storage. When this command is entered, the running and the startup copies of the configuration are identical.
See the "Copying Files" section.
Clearing a Configuration
Use the write erase command to clear a startup configuration. When this command is entered, the switch's startup configuration reverts to factory defaults. The running configuration is not affected.
Caution The
write erase command erases the entire startup configuration with the exception of any configuration that affects the loader functionality.
The write erase boot command erases the startup configuration and any configuration that affects the loader functionality. The loader functionality configuration includes the boot variables and the mgmt0 IP configuration information (IP address, netmask, and default gateway).
This command will erase the boot variables and the ip configuration of interface mgmt 0
Displaying Users
Use the show users command to display all users currently accessing the switch.
snmp@IB-session2 Mon Apr 25 11:02:07 2005 (Unknown)
snmp@OB-session3 Mon Apr 25 11:02:07 2005 (Unknown)
admin@OB-session11 Wed Apr 27 13:50:49 2005 (10.20.32.70)
Using the ping Command
Use the ping command to verify the connectivity of a remote host or server by sending echo messages.
The syntax for this command is ping host or ip-address.
switch# ping 10.20.83.107
PING 10.20.83.107 (10.20.83.107): 10 data bytes
18 bytes from 10.20.83.107: icmp_seq=0 ttl=64 time=0.5 ms
--- 10.20.83.107 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.5/0.5/0.5 ms
Setting the Terminal Timeout
Use the terminal session-timeout command in EXEC mode to configure the automatic logout time for the current terminal session on that switch. When the time limit configured by this command is exceeded, the switch closes that session and exits.
The syntax for this command from is terminal session-timeout minutes.
The default is 30 minutes. You can set the terminal session-timeout value to 0 to disable this feature so the terminal remains active until you choose to exit the switch. This change is not saved in the configuration file.
switch# terminal session-timeout 600
Specifies the terminal timeout to be 600 minutes for the current session.
Setting the Terminal Length
Use the terminal length command in EXEC mode to set the terminal screen length for the current session. This command is specific to only the console port. Telnet and SSH sessions set the length automatically.
The syntax for this command is terminal length lines.
switch# terminal length 20
Sets the screen length for the current session to 20 lines for the current terminal session. The default is 20 lines.
Displaying Terminal Settings
Use the show terminal command to display the terminal settings for the current session:
Session Timeout: 0 minutes
Internal bootflash:
The Cisco MDS 9020 Fabric Switch has two locations within the internal bootflash: file system.
•The volatile: file system provides temporary storage, and it is also the default location for file system commands. Files in temporary storage (volatile:) are erased when the switch reboots.
•The bootflash: (nonvolatile storage) file system provides permanent storage. The files in bootflash: are preserved through reboots and power outages.
Using the File System
The switch provides the following useful functions to help you manage software image files and configuration files:
•Setting the Current File System
•Listing the Files in a File System
•Moving Files
•Copying Files
•Deleting Files
•Executing Commands Specified in a Script
•Setting the Delay Time
Setting the Current File System
The cd command changes the current file system to a specified file system. CLI defaults to the volatile: file system. This command requires a file system name input.
Tip Any file saved in the volatile: file system is erased when the switch reboots.
The syntax for this command is cd file system.
This example changes the current file system to the volatile: file system:
Listing the Files in a File System
The dir command displays the contents of the current file system. The syntax for this command is dir filesystem.
This example shows how to list the files on the volatile: file system:
962 May 5 15:26:49 2005 running-config
26 May 1 20:16:45 2005 startup-config
Moving Files
The move command removes a file from the source location and places it in the destination location. If a file with the same name already exists in the destination location, that file is overwritten by the moved file.
This example moves the file called latest_mpc from the bootflash: file system to the volatile: file system:
switch# move bootflash:latest_mpc volatile:latest_mpc
Copying Files
The copy command copies a file. (See the "Copying Files" section.)
This example saves your configuration to the startup configuration:
switch# copy running-config startup-config
The following example saves a copy of the startup configuration on a remote host:
switch# copy startup-config ftp://10.20.102.98/configs/q100-startup
Deleting Files
The delete command deletes a specified file. (See the "Deleting Files" section.)
This example shows how to delete a file from the current working directory:
switch# delete dns_config.cfg
This example deletes the my-file file from the bootflash: file system:
switch# delete bootflash:my-file
Caution If you specify a file system, the
delete command deletes the file system contents.
Executing Commands Specified in a Script
The run-script command executes the commands specified in a file. To use this command, be sure to create the file and specify commands in the required order.
Note You cannot create the script files at the switch prompt. You can create the script file on an external machine and copy it the bootflash: file system. This section assumes that the script file resides in the bootflash: file system.
The syntax for this command is run-script file_name
The file, testfile, contains the following commands.
This file output is in response to the run-script command executing the contents in the testfile file:
switch# run-script testfile
Enter configuration commands, one per line.
fc1/1 is Up (Link failure or not connected)
Hardware is Fibre Channel, SFP is long wave laser
Port WWN is 20:00:00:0d:ec:19:cb:0e
Port mode is Unknown, FCID is 0x690000
Receive data field Size is 2112
5 minutes input rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
5 minutes output rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
0 discards, 154096 errors
1 input OLS, 1 LRR, 11 loop inits
13 output OLS, 4 LRR, 11 loop inits
Setting the Delay Time
The sleep command delays an action by a specified number of seconds.
The syntax for this command is sleep <seconds>
You will see the switch prompt return after 30 seconds.
This command is useful within scripts. For example, consider a script called test-script with the following contents:
clear counters interface all
show interface counters brief
When you execute the test-script, the switch software executes the clear counters interface all command and then waits for 5 seconds before executing the show interface counters brief command.
switch# run-script test-script