Managing multiple configuration files

Viewing the status and content of startup-config files

  • Use the show config files command to view a list of the available startup-config files on the switch and the current use of each file.

  • Use the show config command to view the content of the default startup-config file.

    The default startup-config file is the startup-config file that is currently active on the switch.

  • Use the show config <filename> command to view the content of a specific startup-config file. The filename argument specifies the file.

    With Multiple Configuration enabled, the switch can have up to three startup-config files. This command can display the content of any of the startup-config files stored in the switch, whereas the show config command always displays the content of the default startup-config file.

Changing or overriding the reboot configuration policy

To change the reboot configuration policy, do one of the following:

  • Use the startup-default primary config <filename> command to change the current policy so that the switch automatically reboots from the primary flash using the specified startup-config file. The filename argument specifies the startup-config file to use.

  • Use the startup-default secondary config <filename> command to change the current policy so that the switch automatically reboots from the secondary flash using the specified startup-config file. The filename argument specifies the startup-config file to use.

To override the default reboot configuration policy for a single reboot instance, do one of the following:

  • Use the boot system flash primary config <filename> command to override the current policy so that the switch automatically reboots from the primary flash using the specified startup-config file. The filename argument specifies the startup-config file to use.

  • Use the boot system flash secondary config <filename> command to override the current policy so that the switch automatically reboots from the secondary flash using the specified startup-config file. The filename argument specifies the startup-config file to use.

Reboot configuration policy that uses different startup-config files for different software versions

Suppose that you have the following situation:

  • Software release “A” is stored in primary flash and a later software release is stored in secondary flash.

  • Memory slot 1 stores a reliable, minimal configuration (named minconfig) to be used with the software version in the primary flash.

  • Memory slot 2 stores a modified startup-config file (named newconfig) to be used with the software version in secondary flash. This startup-config file includes untested changes for improved network operation.

The operator wants to ensure that in case of a need to reboot by pressing the Reset button, or if a power failure occurs, the switch will automatically reboot with the minimal startup-config file in memory slot 1. Since a reboot due to pressing the Reset button or to a power cycle always uses the software version in primary flash, the operator has to configure the switch to always boot from primary flash with the startup-config file named minconfig (in memory slot 1). Also, whenever the switch boots from secondary flash, the operator also wants the startup-config named newconfig to be used. The following two commands configure the desired behavior.

switch(config)# startup-default primary config minconfig
switch(config) # startup-default secondary config newconfig

Managing startup-config files in the switch

Managing the startup-config files involves renaming, copying, and erasing startup-config files.

  • Use the rename config <current-filename> <new-filename>command to change the name of an existing startup-config file. The current-filename argument specifies the existing startup-config file and the new-filename argument specifies the new name for the file.

    A file name can include up to 63, alphanumeric characters. Blanks are allowed in a file name enclosed in quotes (" " or ‘ ‘). File names are not case-sensitive.

    For redundant management systems, renaming a config file affects both the active management module and the standby management module, unless redundancy is disabled or the standby module failed selftest.

  • Use the copy config <source-filename> config <target-filename>command to create a new startup-config file or to replace an existing startup-config file with a new one.

    This command copies the contents of an existing startup-config file in one memory slot to a new startup-config file in another, empty memory slot.

    If the target startup-config file already exists, it is overwritten by the content of the source startup-config file; otherwise, it will be created in the first empty configuration memory slot on the switch. If the destination startup-config file does not already exist and there are no empty configuration memory slots on the switch, then a new startup-config file is not created.

  • Do one of the following to erase any of the startup-config files in the switches memory slots:

    • Use the erase config <filename> command to erase the specified startup-config file. filename argument specifies the file to be erased.

    • Use the erase startup-config command to erase the currently active startup-config file.

    In some cases, erasing a file causes the switch to generate a new, default-configuration file for the affected memory slot. Where a file is assigned to either the primary or the secondary flash, but is not the currently active startup config file, erasing the file does not remove the flash assignment from the memory slot for that file. Thus, if the switch boots using a flash location that does not have an assigned startup-config, then the switch creates a new, default startup-config file and uses this file in the reboot. (This new startup-config file contains only the default configuration for the software version used in the reboot.) Executing write memory after the reboot causes a switch-generated filename of config x to appear in the show config files display for the new file, where x corresponds to the memory slot number.

    In a redundant management system, these commands erase the startup config file on both the active and the standby management modules as long as redundancy has not been disabled. If the standby management module is not in standby mode or has failed selftest, the startup config file is not erased.

Creating and assigning a new startup-config file

If you wanted to experiment with configuration changes to the software version in secondary flash, you could create and assign a separate starup-config file for this purpose, as shown in the following command sequence.

switch(config)# copy config config1 config config2
switch(config)# startup-default secondary config config2
switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | Config1
 2 |          *  | Config2
 3 |             | 

Erasing a non-active startup-config file

The memory configuration has a non-active configuration file named “config3”, which you want to erase.

switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             | config3

switch(config)# erase config config3
switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             | 

Uploading a configuration file to a remote TFTP host

Prerequisites

Before you upload a configuration file to a remote TFTP host, you must insure that the switch has a separate out-of-band management port if the traffic is being transmitted through the out-of-band management interface.

Uploading a configuration file from a remote TFTP host

To upload a configuration file to a remote TFTP host through the out-of-band management interface, do one of the following:

  • Use the copy config <src-file> tftp <ip-addr> <remote-file> pc oobm command to upload a configuration file to a remote TFTP PC host.

  • Use the copy config <src-file> tftp <ip-addr> <remote-file> unix oobm command to upload a configuration file to a remote TFTP UNIX host.

To upload a configuration file to a remote TFTP host through the data interface, do one of the following:

  • Use the copy config <src-file> tftp <ip-addr> <remote-file> pc command to upload a configuration file to a remote TFTP PC host.

  • Use the copy config <src-file> tftp <ip-addr> <remote-file> unix command to upload a configuration file to a remote TFTP UNIX host.

For more information on using TFTP to upload a file to a remote server, see "TFTP: Copying a Configuration File to a Remote Host" in Appendix A of the Management and Configuration Guide for your switch.

Example

The following command uploads a startup-config file named test01 from the switch to a (UNIX) TFTP server at IP address 10.10.28.14:

switch(config)# copy config test-01 tftp 10.10.28.14 test-01.txt unix

Downloading a configuration file from a remote TFTP host

Prerequisites

Before you download a configuration file from a remote TFTP host, you must insure that the switch has the following:

  • An empty memory slot.

  • A separate out-of-band management port, if the traffic is being transmitted through the out-of-band management interface.

Downloading a configuration file from a remote TFTP host

To download a configuration file from a remote TFTP host through the out-of-band management interface, do one of the following:

  • Use the copy tftp config <dest-file> <ip-addr> <remote-file> pc oobm command to download a configuration file from a remote TFTP PC host.

  • Use the copy tftp config <dest-file> <ip-addr> <remote-file> UNIX oobm command to download a configuration file from a remote TFTP UNIX host.

To download a configuration file from a remote TFTP host through the data interface, do one of the following:

  • Use the copy tftp config <dest-file> <ip-addr> <remote-file> pc command to download a configuration file from a remote TFTP PC host.

  • Use the copy tftp config <dest-file> <ip-addr> <remote-file> UNIX command to download a configuration file from a remote TFTP UNIX host.

For more on using TFTP to download a file from a remote host, see "TFTP: Copying a Configuration File from a Remote Host" in Appendix A of the Management and Configuration Guide for your switch.

Example

The following command downloads a startup-config file named test01.txt from a (UNIX) TFTP server at IP address 10.10.28.14 to the first empty memory slot in the switch:

switch(config)# copy tftp config test-01 10.10.28.14 test-01.txt unix

Uploading a configuration file to a serially connected host

To upload a configuration file to a serially connected host, do one of the following:

  • Use the copy config <filename> xmodem pc command to upload a configuration file to a serially connected PC host.

  • Use the copy config <filename> xmodem unix command to upload a configuration file to a serially connected UNIX host.

For more on using Xmodem to upload a file to a serially connected host, see "Xmodem: Copying a Configuration File to a Serially Connected PC or UNIX Workstation" in Appendix A of the Management and Configuration Guide for your switch.

Downloading a configuration file from a serially connected host

To download a configuration file from a serially connected host, do one of the following:

  • Use the copy xmodem config <dest-file> pc command to download a configuration file from a serially connected PC host.

  • Use the copy xmodem config <dest-file> unix command to download a configuration file from a serially connected UNIX host.

For more on using Xmodem to copy a file from a serially connected host, see "Xmodem: Copying a Configuration File from a Serially Connected PC or UNIX Workstation" in Appendix A of the Management and Configuration Guide for your switch.

Multiple configuration files

In this mode of operation, you cannot preserve different startupconfig files across a reboot without using remote storage.

The switch allows up to three startup-config files with options for selecting which startup-config file to use for:

  • A fixed reboot policy using a specific startup-config file for a specific boot path (primary or secondary flash)

  • Overriding the current reboot policy on a per-instance basis

Optional reboot process

While you can still use remote storage for startup-config files, you can now maintain multiple startup-config files on the switch and choose which version to use for a reboot policy or an individual reboot.

This choice of which configuration file to use for the startup-config at reboot provides the following new options:

  • The switch can reboot with different configuration options without having to exchange one configuration file for another from a remote storage location.

  • Transitions from one software release to another can be performed while maintaining a separate configuration for the different software release versions.

  • By setting a reboot policy using a known good configuration and then overriding the policy on a per-instance basis, you can test a new configuration with the provision that if an unattended reboot occurs, the switch will come up with the known, good configuration instead of repeating a reboot with a misconfiguration.

Operating notes for multiple configuration files

Multiple configuration storage in the switch. The switch uses three memory "slots", with identity (id) numbers of 1, 2, and 3, as shown by the following output of the show config files command.

switch(config)# show config files
Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |             | oldConfig 
 2 |  *   *   *  | workingConfig 
 3 |             | 

A startup-config file stored in a memory slot has a unique, changeable file name. The switches covered in this guide can use the startup-config in any of the memory slots (if the software version supports the configured features). In the default configuration, if the switch was shipped from the factory with software installed in both the primary and secondary boot paths, then one startup-config file named “config1” is used for both paths and is stored in memory slot 1. Memory slots 2 and 3 are empty in this default configuration.

An asterisk ( * ) in the act, pri, or sec column has the following meaning:

  • act column: The corresponding startup-config file is currently in use.

  • pri column: The corresponding startup-config file is currently assigned to the primary boot path.

  • sec column: The corresponding startup-config file is currently assigned to the secondary boot path.

Reboot policy. With multiple startup-config files in the switch you can specify a policy for the switch to use upon reboot. The options include:

  • Use the designated startup-config file with either or both reboot paths (primary or secondary flash)

  • Override the current reboot policy for one reboot instance by specifying a boot path (primary or secondary flash) and the startup-config file to use.

For a given reboot, the switch automatically reboots from the startup-config file assigned to the flash location (primary or secondary) being used for the current reboot. For example, when you first download a software version that supports multiple configuration files and boot from the flash location of this version, the switch copies the existing startup-config file (named oldConfig) into memory slot 2, renames this file to workingConfig, and assigns workingConfig as:

  • The active configuration file

  • The configuration file to use when booting from either primary or secondary flash

In this case, the switch is configured to automatically use the workingConfig file in memory slot 2 for all reboots.

Changes to the startup-config file. When the switch reboots, the startupconfig file supplies the configuration for the running-config file the switch uses to operate. Changes to the running-config file are written back to the startup-config file that was used at the last reboot. The changes are written when the write-mem command (or, in the Menu interface, the Save command) is executed. For example, suppose that a system administrator performs the following on a switch that has two startup-config files (workingconfig and backupconfig):

  1. Reboot the switch through the Primary boot path using the startup-config file named backupconfig.

  2. Use the CLI to make configuration changes in the running-config file, and then execute write-mem.

The result is that the startup-config file used to reboot the switch is modified by the actions in step 2.

Reboot process and making changes to the startup-config file

An alternate startup-config file. A new configuration file can be created for an alternate startup-config file. There are two methods for creating a new configuration file:

  • Copy an existing startup-config file to a new filename, then reboot the switch, make the desired changes to the running-config file, then execute write memory.

  • Erase the active startup-config file. This generates a new, default startupconfig file that always results when the switch automatically reboots after deletion of the currently active startup-config file.

The transition to multiple configuration files. At the first reboot with a software release supporting multiple configuration, the switch:

  • Assigns the filename oldConfig to the existing startup-config file (which is stored in memory slot 1).

  • Saves a copy of the existing startup-config file in memory slot 2 with the filename workingConfig.

  • Assigns the workingConfig file as the active configuration and the default configuration for all subsequent reboots using either primary or secondary flash.

The following output of the show config files command shows the switch memory assignments after the first reboot from software that supports multiple configuration. In this state, the switch always uses the workingConfig file to reboot.


switch(config)# show config files
Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |             | oldConfig 
 2 |  *   *   *  | workingConfig 
 3 |             |