Cisco MDS 9000 Family Configuration Guide, Release 2.x
Working with Configuration Files

Table Of Contents

Working with Configuration Files

Working with Configuration Files

Displaying Configuration Files

Downloading Configuration Files to the Switch

From a Remote Server

From an External CompactFlash Disk (slot0:)

Saving Configuration Files to an External Device

To a Remote Server

To an External CompactFlash Disk (slot0:)

Saving the Configuration

Saving Startup Configurations in the Fabric

Unlocking the Startup Configuration File

Copying Files

Backing Up the Current Configuration

Rolling Back to a Previous Configuration

Restoring the Configured Redundancy Mode

Accessing Remote File Systems

Deleting Files


Working with Configuration Files


This chapter describes how to initially configure switches using the configuration files so they can be accessed by other devices. This chapter includes the following sections:

Working with Configuration Files

Accessing Remote File Systems

Deleting Files

Working with Configuration Files

Configuration files can contain some or all of the commands needed to configure one or more switches. For example, you might want to download the same configuration file to several switches that have the same hardware configuration so that they have identical module and port configurations.

This section describes how to work with configuration files and has the following topics:

Displaying Configuration Files

Downloading Configuration Files to the Switch

Saving the Configuration

Copying Files

Backing Up the Current Configuration

Rolling Back to a Previous Configuration

Displaying Configuration Files

Use the show running-config command to view the running configuration file.

switch# show running-config
Building Configuration ...
 interface port-channel 98
interface fc1/1
 interface fc1/2
interface mgmt0
ip address 172.22.95.112 255.255.255.0
no shutdown
vsan database
vsan 2 
clock summer-time Pacific 1 Sun Apr 02:00 5 Sun Oct 02:00 60
switchname switch112

Use the show startup-config command to view the startup configuration file.

switch# show startup-config
 interface port-channel 98
 interface fc1/1
channel-group 98 force
no shutdown
 interface mgmt0
ip address 172.22.95.112 255.255.255.0
boot system system-237; ep-41
boot kickstart boot-237 ep-41
ip domain-name cisco.com

Downloading Configuration Files to the Switch

You can configure a switch in the Cisco MDS 9000 Family by using configuration files you create or download from another switch. In addition, you can store configuration files on a bootflash device on the supervisor module and you can configure the switch using a configuration stored on an external CompactFlash disk.

Before you begin downloading a configuration file using a remote server, do the following:

Ensure the configuration file to be downloaded is in the correct directory on the remote server.

Ensure that the permissions on the file are set correctly. Permissions on the file should be set to world-read.

Ensure the switch has a route to the remote server. The switch and the remote server must be in the same subnetwork if you do not have a router or default gateway to route traffic between subnets.

Check connectivity to the remote server using the ping command.

From a Remote Server

To configure a switch in the Cisco MDS 9000 Family using a configuration file downloaded from a remote server using TFTP, FTP, SCP, or SFTP, follow these steps:


Step 1 Log into the switch through the console port or through a Telnet or SSH session.

Step 2 Configure the switch using the configuration file downloaded from the remote server using the
copy <scheme> :// <server address> system:running-config command, where scheme is TFTP, FTP, SCP, or SFTP.

The configuration file downloads and the commands are executed as the file is parsed line by line.


Use the following command to download a configuration file from a remote server to the running configuration.

switch# copy <scheme>://<url> system:running-config 

From an External CompactFlash Disk (slot0:)


Note The physical media must be inserted into slot0: after you log into the switch.


To configure a switch in the Cisco MDS 9000 Family using a configuration file stored on an external CompactFlash disk, follow these steps:


Step 1 Log into the switch through the console port or through a Telnet or SSH session.

Step 2 Locate the configuration file using the cd and dir commands. (See the "Copying Files" section.)

Step 3 Configure the switch using the configuration file stored on the external CompactFlash disk using the copy <source file> system:running-config command.

The commands are executed as the file is parsed line by line.


Use the following command to download a configuration file from an external CompactFlash to the running configuration:

switch copy slot0:dns-config.cfg system:running-config 

Saving Configuration Files to an External Device

You can save a configuration file stored on internal storage to a remote server or to an external Flash device on the switch.

To a Remote Server

To save a configuration file to a remote server such as TFTP, FTP, SCP, or SFTP, follow these steps:


Step 1 Log into the switch through the console port or through a Telnet or SSH session.

Step 2 Save the configuration using the copy system:running-config <scheme> :// <url> command, where scheme is TFTP, FTP, SCP, or SFTP.

Step 3 Specify the IP address or host name of the remote server and the name of the file to download.

The configuration file is saved to the remote server.


Use the following command to save a running configuration file to a remote server:

switch# copy system:running-config <scheme>://<url>

Use the following command to save a startup configuration file to a remote server:

switch# copy nvram:startup-config <scheme>://<url>

To an External CompactFlash Disk (slot0:)

To save a configuration file on an external CompactFlash device, follow these steps:


Step 1 Log into the switch through the console port or through a Telnet session.

Step 2 Locate the configuration file using the cd and dir commands. (See the "Copying Files" section.)

Step 3 Save the configuration file using the copy system:running-config <destination file> command.

The configuration file is saved to the CompactFlash disk.


Use the following command to save a running configuration file to an external CompactFlash disk:

switch# copy system:running-config slot0:dns-config.cfg

Use the following command to save a startup configuration file to an external CompactFlash disk:

switch# copy nvram:startup-config slot0:dns-config.cfg

Saving the Configuration

After you have created a running configuration in system memory, you can save it to the startup configuration in NVRAM.

Use the following copy command to save the configuration to NVRAM:

switch# copy system:running-config nvram:startup-config 

The copy running-config startup-config command is an alias to the previous command and is used frequently throughout this guide.

To cancel the copy operation initiated by another switch, use the following command:

switch# system startup-config abort

To cancel the operation locally and throughout the fabric, enter Ctrl-c on the console or telnet session of the initiator switch.

See the "Preserving Module Configuration" section on page 10-9.

Saving Startup Configurations in the Fabric

As of Cisco MDS SAN-OS Release 2.1(1a), you can use Cisco Fabric Services (CFS) to instruct the other switches in the fabric to save their configurations to their local NVRAM using the following copy command:

switch# copy running-config startup-config fabric


Note If any remote switch in the fabric fails to complete the copy running-config startup-config fabric process, the request is discarded on the initiator switch and the failure errors are displayed in the initiator switch CLI session.


You can use the show cfs application command to verify that the Fabric Startup Configuration Manager (FSCM) application is enabled.

switch# show cfs application

----------------------------------------------
 Application    Enabled   Scope
----------------------------------------------
 ntp            No        Physical
 fscm           Yes       Physical
 role           No        Physical
 radius         No        Physical
 tacacs         No        Physical
 fctimer        No        Physical
 syslogd        No        Physical
 callhome       No        Physical
 device-alias   Yes       Physical
 port-security  No        Logical

Total number of entries = 10

Unlocking the Startup Configuration File

The startup configuration file can be locked by applications on the switch. To display locks on the startup configuration file, use the following command:

switch# show system internal sysmgr startup-config locks

To release a lock on the startup configuration file, use the following command:

switch# system startup-config unlock 10

Copying Files

The syntax for the copy command follows and is explained in Table 7-1.

switch# copy <scheme>://<username@><server>/<file name> 
<scheme>://<username@><server>/<file name>

Table 7-1 copy Command Syntax 

Scheme
Server
File Name

bootflash

sup-active
sup-standby
sup-1 or module-5
sup-2 or module-6
sup-local
sup-remote

User-specified

slot0

User-specified

volatile

User-specified

nvram

startup-config or snapshot-config

system

running-config

tftp1

IP address or DNS name

User-specified

ftp

scp (secure copy)

sftp

core

slot-number

Process identifier number

1 When downloading and uploading files, a TFTP limitation restricts a TFTP client to a 32 MB file size and some TFTP servers to a 16 MB file size.


This example shows how to copy a file from the active supervisor module's (sup-1 in slot 5) bootflash to the standby supervisor module's (sup-2 in slot 6) bootflash.

switch# copy bootflash:system_image bootflash://sup-2/system_image

This example shows how to overwrite the contents of an existing configuration in NVRAM.

switch# copy nvram:snapshot-config nvram:startup-config 
Warning: this command is going to overwrite your current startup-config. 
Do you wish to continue? {y/n} [y] y

This example shows how to copy a running configuration to the bootflash: file system.

switch# copy system:running-config bootflash:my-config 

This example shows how to copy a system image file from the SCP server to bootflash.

switch# copy scp://user@10.1.7.2/system-image bootflash:system-image

This example shows how to copy a script file from the SFTP server to the volatile: file system.

switch# copy sftp://172.16.10.100/myscript.txt volatile:myscript.txt

Note Use the show version image command to verify if the downloaded images are valid.


Backing Up the Current Configuration

Before installing or migrating to any software configuration, back up the startup configuration.

This example shows how to create a snapshot of the startup configuration in a predefined location on the switch (binary file).

switch# copy nvram:startup-config nvram:snapshot-config

This example shows how to back up the startup configuration copy in the bootflash: file system (ASCII file).

switch# copy nvram:startup-config bootflash:my-config

This example shows how to back up the startup configuration to the TFTP server (ASCII file).

switch# copy nvram:startup-config tftp://172.16.10.100/my-config

This example shows how to back up the running configuration to the bootflash: file system (ASCII file).

switch# copy system:running-config bootflash:my-config

Rolling Back to a Previous Configuration

All switch configurations reside in the internal bootflash: file system. If your internal bootflash: file system is corrupted, you could potentially lose your configuration. Save and back up your configuration file periodically.

This example shows how to roll back to a snapshot copy of a previously saved running configuration (binary file).

switch# copy nvram:snapshot-config nvram:startup-config


Note You can issue a rollback command only when a snapshot is already created. Otherwise, you will receive the No snapshot-config found error message.


This example shows how to roll back to a configuration copy that was previously saved in the bootflash: file system (ASCII file).

switch# copy bootflash:my-config nvram:startup-config 


Note Each time a copy running-config startup-config command is issued, a binary file is created and the ASCII file is updated. A valid binary configuration file reduces the overall boot time significantly. A binary file cannot be uploaded, but its contents can be used to overwrite the existing startup configuration. The write erase command clears the binary file.


Restoring the Configured Redundancy Mode


Tip If you configure the combined mode as the redundancy mode for power supplies on a Cisco MDS 9509 switch, exert care when using the write erase and reload command sequence before rolling back to a saved configuration.


By issuing the write erase command and the reload command, you restore the switch settings to their factory defaults. This sequence also restores the redundancy mode setting for the power supplies back to the redundant mode (default).

Depending on the type of power supply, the input voltage, and the number of modules (line cards) in the chassis, the redundancy mode may prevent the line cards from being powered on after a system reboot (see the "Power Supply Configuration Modes" section on page 9-6). If you use this sequence, the commands that apply to the powered down line cards will not be enforced on the switch (and will not be part of its running configuration).

If using the write erase and reload command sequence before rolling back to a saved configuration, follow these steps:


Step 1 Manually change (if originally configured) the redundant mode configuration to combined mode.

Step 2 Wait until all modules are back online—the module status displays ok in response to the show module command.

Step 3 Roll back to the saved configuration (see the "Rolling Back to a Previous Configuration" section).


Accessing Remote File Systems

To access contents of the standby supervisor module (remote), follow these steps:


Step 1 Verify if the standby supervisor module has sufficient space for new image files.

switch# dir bootflash://sup-remote
   12198912     Aug 27 17:21:10 2003  bt-39a
   12198912     Aug 27 16:29:18 2003  m9500-sf1ek9-kickstart-mzg.1.3.0.39a.bin
    1921922     Sep 14 19:58:12 2003  aOldImage
    1864931     Apr 29 12:41:50 2003  bOldImage
    1864931     Apr 29 12:41:59 2003  dplug2
      12288     Apr 18 20:23:11 2003  lost+found/
   12097024     Nov 21 16:34:18 2003  m9500-sf1ek9-kickstart-mz.1.3.1.1.bin
   41574014     Nov 21 16:34:47 2003  m9500-sf1ek9-mz.1.3.1.1.bin
       1024     Oct 28 20:24:59 2003  newer-fs/
    2021518     Oct 11 15:49:41 2003  plugin-69a
Usage for bootflash://sup-remote
  102081536 bytes used
   82478080 bytes free
  184559616 bytes total

Step 2 Delete files, if required, to make more space for the new image files.

switch# del aOldImage


Deleting Files

Assuming you are already in the bootflash: file system, use the delete command as follows:

This example shows how to delete a file from the bootflash: file system.

switch# delete dns_config.cfg

This example shows how to delete a file from an external CompactFlash (slot0:) file system.

switch# delete slot0:dns_config.cfg

This example shows how to delete the file named test from the Flash card inserted in slot 0.

switch# delete slot0:test
Delete slot0:test? [y/n]: y

This example shows how to delete the entire my-dir directory and all its contents.

switch# delete bootflash:my-dir