Configuration Management

Managing Configuration Files

Saving the Running Configuration to the Startup Configuration

You can save the running configuration to the startup configuration to save your changes for the next time you that reload the device. To save the running configuration to the startup configuration, use the following command:

admin@NX-3550-T# show running-config

(Optional) Displays the running configuration.

admin@NX-3550-T# copy running-config startup-config

Copies the running configuration to the startup configuration.

Copying a Configuration File to a Remote Server

You can copy a configuration file stored in the internal memory to a remote server as a backup or to use for configuring other Cisco NX-OS devices. To copying a configuration file to a remote server, use the following commands:

admin@NX-3550-T# copy running-config scheme://server/[url /]filename

Copies the running-configuration file to a remote server.

For the scheme argument, you can enter tftp: , ftp: , scp: , or sftp: . The server argument is the address or name of the remote server, and the url argument is the path to the source file on the remote server.

The server, url, and filename arguments are case sensitive.

admin@NX-3550-T# copy startup-config scheme://server/[url /]filename

Copies the startup-configuration file to a remote server.

For the scheme argument, you can enter tftp: , ftp: , scp: , or sftp: . The server argument is the address or name of the remote server, and the url argument is the path to the source file on the remote server.

The server, url, and filename arguments are case sensitive.

Example

This example shows how to copy the configuration file to a remote server:

admin@NX-3550-T# copy running-config 
    tftp://10.10.1.1/sw1-run-config.bak 
admin@NX-3550-T# copy startup-config 
    tftp://10.10.1.1/sw1-start-config.bak

Downloading the Running Configuration From a Remote Server

You can configure your Cisco NX-OS device by using configuration files that you created on another Cisco NX-OS device and uploaded to a remote server. You then download the file from the remote server to your device using TFTP, FTP, Secure Copy (SCP), or Secure Shell FTP (SFTP) to the running configuration.

Before you begin

Ensure that the configuration file that you want to download 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 that your device has a route to the remote server. Your device and the remote server must be in the same subnetwork if you do not have a router or a default gateway to route traffic between subnets.

Check connectivity to the remote server using the ping or ping6 command.

Use the following commands to download the running configuration from a remote server

admin@NX-3550-T# copy scheme://server/[url/]filename running-config

Downloads the running-configuration file from a remote server.

For the scheme argument, you can enter tftp: , ftp: , scp: , or sftp: . The server argument is the address or name of the remote server, and the url argument is the path to the source file on the remote server.

The server, url, and filename arguments are case sensitive.

(Optional)
admin@NX-3550-T# show running-config

(Optional) Displays the running configuration.

(Optional)
admin@NX-3550-T# copy running-config startup-config

(Optional) Copies the running configuration to the startup configuration.

(Optional)
admin@NX-3550-T# show startup-config

(Optional) Displays the startup configuration.

Related Information

Copying Files

Downloading the the Startup Configuration From a Remote Server

You can configure your Cisco NX-OS device by using configuration files that you created on another Cisco NX-OS device and uploaded to a remote server. You then download the file from the remote server to your device using TFTP, FTP, Secure Copy (SCP), or Secure Shell FTP (SFTP) to the startup configuration.

caut.gif

Cautionblank.gifThis procedure disrupts all traffic on the Cisco NX-OS device.

Before you Begin

Log in to a session on the console port.

Ensure that the configuration file that you want to download 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 that your device has a route to the remote server. Your device and the remote server must be in the same subnetwork if you do not have a router or a default gateway to route traffic between subnets.

Check connectivity to the remote server using the ping or ping6 command.

Use the following commands to downloading the the startup configuration from a remote server

admin@NX-3550-T# write erase

Erases the startup configuration file.

admin@NX-3550-T# reload

Reloads the Cisco NX-OS device.

Note Do not use the setup utility to configure the device.

Example

admin@NX-3550-T# reload
This command will reboot the system. (y/n)?  [n] y
...
Enter the password for "admin": <password>
Confirm the password for "admin": <password>
...
Would you like to enter the basic configuration 
dialog (yes/no): n
admin@NX-3550-T#


admin@NX-3550-T# copy scheme://server/[url /]filename running-config

Downloads the running configuration file from a remote server.

For the scheme argument, you can enter tftp: , ftp: , scp: , or sftp: . The server argument is the address or name of the remote server, and the url argument is the path to the source file on the remote server.

The server, url, and filename arguments are case sensitive.

admin@NX-3550-T# copy running-config startup-config

Saves the running configuration file to the startup configuration file.

(Optional)
admin@NX-3550-T# show startup-config

(Optional) Displays the running configuration.

Related Information

Copying Files

Copying Configuration Files to an External Flash Memory Device

Use the following commands to copy configuration files to an external flash memory device as a backup for later use.

Before you Begin

Insert the external Flash memory device into the active supervisor module.

(Optional)
admin@NX-3550-T# dir {usb1: | usb2:}[directory/]

(Optional) Displays the files on the external flash memory device.

admin@NX-3550-T# copy running-config {usb1: | usb2:}[directory/]filename

Copies the running configuration to an external flash memory device. The filename argument is case sensitive.

admin@NX-3550-T# copy startup-config {usb1: | usb2:}[directory/]filename

Copies the startup configuration to an external flash memory device. The filename argument is case sensitive.

Related Information

Copying Files

Copying the Running Configuration from an External Flash Memory Device

You can configure your device by copying configuration files created on another Cisco NX-OS device and saved to an external flash memory device. Use the following commands to copy a running configuration from an external flash memory device.

Before you Begin

Insert the external Flash memory device into the active supervisor module.

(Optional)
admin@NX-3550-T# dir {usb1: | usb2:}[directory/]

(Optional) Displays the files on the external flash memory device.

admin@NX-3550-T# copy {usb1: | usb2:}[directory/]filename running-config

Copies the running configuration from an external flash memory device. The filename argument is case sensitive..

(Optional)
admin@NX-3550-T# show running-config

(Optional) Displays the running configuration.

(Optional)
admin@NX-3550-T# copy running-config startup-config

(Optional) Copies the running configuration to the startup configuration.

(Optional)
admin@NX-3550-T# show startup-config

(Optional) Displays the startup configuration.

Related Information

Copying Files

Copying the Startup Configuration From an External Flash Memory Device

You can recover the startup configuration on your device by downloading a new startup configuration file saved on an external flash memory device. Use the following commands to copy a startup configuration from an external flash memory device

Before you Begin

Insert the external Flash memory device into the active supervisor module.

(Optional)
admin@NX-3550-T# dir {usb1: | usb2:}[directory/]

(Optional) Displays the files on the external flash memory device.

admin@NX-3550-T# copy {usb1: | usb2:}[directory/]filename running-config

Copies the startup configuration from an external flash memory device. The filename argument is case sensitive.

(Optional)
admin@NX-3550-T# show startup-config

(Optional) Displays the startup configuration.

Related Information

Copying Files

Copying Configuration Files to an Internal File System

Use the following commands to copy configuration files to the internal memory as a backup for later use.

admin@NX-3550-T# copy running-config [filesystem:][directory/] | [directory/]filename

Copies the running-configuration file to internal memory. The filesystem , directory , and filename arguments are case sensitive.

admin@NX-3550-T# copy startup-config [filesystem:][directory/] | [directory/]filename

Copies the startup-configuration file to internal memory. The filesystem , directory , and filename arguments are case sensitive.

Related Information

Copying Files

Rolling Back to a Previous Configuration

Problems, such as memory corruption, can occur that make it necessary for you to recover your configuration from a backed up version.

Note

Each time that you enter a copy running-config startup-config command, 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.

Use the following commands to roll back to a previous configuration.

admin@NX-3550-T# write erase

Clears the current configuration of the switch

admin@NX-3550-T# reload

Restarts the device. You will be prompted to provide an nx-os image file for the device to boot and run.

admin@NX-3550-T# copy configuration-file running-configuration

Copies a previously saved configuration file to the running configuration.

Note

The configuration-file filename argument is case sensitive.

admin@NX-3550-T# copy running-config startup-config

Copies the running configuration to the start-up configuration.

Removing the Configuration for a Missing Module

When you remove an I/O module from the chassis, you can also remove the configuration for that module from the running configuration.

Note

You can only remove the configuration for an empty slot in the chassis.

Before you Begin

Remove the I/O module from the chassis.

(Optional)
admin@NX-3550-T# show hardware

(Optional)Displays the installed hardware for the device.

admin@NX-3550-T# purge module slot running-config

Removes the configuration for a missing module from the running configuration.

(Optional)
admin@NX-3550-T# copy running-config startup-config

(Optional) Copies the running configuration to the startup configuration.

Erasing a Configuration

Use the following commands to erase a configuration

admin@NX-3550-T# write erase [boot | debug]

Erases configurations in persistent memory. The default action erases the startup configuration.

The boot option erases the boot variable definitions and the IPv4 configuration on the mgmt0 interface.

The debug option erases the debugging configuration.

Note

The running-configuration file is not affected by this command.

Clearing Inactive Configurations

Use the following commands to clear inactive configurations

(Optional)
admin@NX-3550-T# show running-config type inactive-if-config

(Optional) Displays any inactive access control list (ACL) or quality of service (QoS) configurations.

The values for the type argument are aclmgr and ipqos.

aclmgr - Displays any inactive configurations for aclmgr.

ipqos - Displays any inactive configurations for qosmgr.

admin@NX-3550-T# clear inactive-config policy

Clears inactive configurations.

The values for the policy argument are qos and acl .

The following describes the values:

qos - Clears inactive QoS configurations.

acl - Clears inactive ACL configurations.

acl qos - Clears inactive ACL configurations and inactive QoS configurations.

(Optional)
admin@NX-3550-T# show inactive-if-config log

(Optional) Displays the commands that were used to clear the inactive configurations.

Configuration Archive and Configuration Log

  • Information About Configuration Archive*
  • Configuring the Characteristics of the Configuration Archive
  • Information About Configuration Log
  • Displaying Configuration Log Entries

Configuration Archive and Configuration Log

The configuration archive is intended to provide a mechanism to store, organize, and manage an archive of the configuration files to enhance the configuration rollback capability provided by the configure replace command. Before configuration archiving was introduced, you could save copies of the running configuration using the copy running-config destination-url command, storing the replacement file either locally or remotely. However, this method lacked any automated file management. The configuration replace and configuration rollback provides the capability to automatically save copies of the running configuration to the configuration archive. These archived files serve as checkpoint configuration references and can be used by the configure replace command to revert to the previous configuration states.

The archive config command allows you to save configurations in the configuration archive using a standard location and filename prefix that is automatically appended with an incremental version number (and optional timestamp) as each consecutive file is saved. This functionality provides a means for consistent identification of saved configuration files. You can specify how many versions of the running configuration are kept in the archive. After the maximum number of files are saved in the archive, the oldest file is automatically deleted when the next, most recent file is saved. The show archive command displays information for all configuration files saved in the configuration archive.

The configuration archive, wherein the configuration files are stored and are available for use with the configure replace command, can be located on the following file systems: bootflash, FTP, and TFTP.

note

The TFTP and FTP for this feature use VRF management.

Before using the archive config command, the configuration archive must be configured. Complete the following steps to configure the characteristics of the configuration archive:

admin@NX-3550-T# config terminal

Enters the global configuration mode.

admin@NX-3550-T# archive

EEnters the archive configuration mode.

admin@NX-3550-T# path url

Specifies the location and the filename prefix for the files in the configuration archive.

  • Depending on your hardware platform, the name of your file system can be different than the one displayed in the example.

Note

If a directory is specified in the path instead of the file, the directory name must be followed by a forward slash as follows: path flash:/directory /. The forward slash is not necessary after a filename; it is necessary only when specifying a directory.

admin@NX-3550-T# maximum number

(Optional) Sets the maximum number of archive files of the running configuration to be saved in the configuration archive.

  • The number is the maximum number of the archive files of the running configuration that can be saved in the configuration archive. The range is 1 to 14. The default is 10.

Note

Before using this command, you must configure the path to specify the location and filename prefix for the files in the configuration archive.

admin@NX-3550-T# maximum number

(Optional) Sets the time increment for automatically saving an archive file of the current running configuration in the configuration archive.

  • The minutes argument specifies how often, in minutes, to automatically save an archive file of the current running configuration in the configuration archive.

Note

Before using this command, you must configure the path command to specify the location and filename prefix for the files in the configuration archive.

admin@NX-3550-T# time-period minutes

(Optional) Sets the time increment for automatically saving an archive file of the current running configuration in the configuration archive.

  • The minutes argument specifies how often, in minutes, to automatically save an archive file of the current running configuration in the configuration archive.

Note

Before using this command, you must configure the path command to specify the location and filename prefix for the files in the configuration archive.

admin@NX-3550-T# write-memory

Enables the command. It is disabled by default. Entering this command causes an archive to occur when the command copy r s is performed.

admin@NX-3550-T# archive config

Saves the current running configuration file to the configuration archive.

Note

You must configure the path before using the archive config command.

(Optional)
admin@NX-3550-T# show archive log config all

(Optional) Displays the configuration log entries for all the users.

Configuration Archive and Configuration Log

The configuration change logging tracks the changes that are made to the running configuration by using the data in the accounting log. This configuration log tracks the changes that are initiated only through the CLI. Only complete commands that result in the invocation of action routines are logged. The following types of entries are not logged:

  • Commands that result in a syntax error message
  • Partial commands that invoke the device help system

The configuration log tracks the changes that are initiated only through the CLI. For each configuration command that is executed, the following information is logged:

  • A configuration change sequence number
  • The line from which the command was executed
  • The name of the user that executed the command
  • The command that was executed

You can display the information from the configuration log by using the show archive log config all command

For each configuration command that is executed, the following information is logged:

  • The command that was executed
  • The name of the user that executed the command
  • A configuration change sequence number

You can display the information from the configuration log by using the show archive log config command.

Displaying Configuration Log Entries

To display the configuration log entries, the configuration change logging provides the show archive log config all command.

Use the following commands to clear inactive configurations

Step 1

admin@NX-3550-T# show archive log config all

Displays the configuration log entries for all users.

Example:

admin@NX-3550-T# show archive log config all

INDEX   LINE                    USER          LOGGED COMMAND
1       console0                user01       | logging console 1 
2       console0                user01       | logging monitor 2
3       console0                user02       | system default switchport shutdown  
4       console0                user02       | interface mgmt0 
5       console0                user02       |  no shutdown

Step 2

admin@NX-3550-T# show archive log config user username

Displays the configuration log entries for the specified username.

Example:

The following example displays the configuration log entries for a specified username.

admin@NX-3550-T# show archive log config user user02

INDEX   LINE                    USER          LOGGED COMMAND
3       console0                user02       | system default switchport shutdown 
4       console0                user02       | interface mgmt0 
5       console0                user02       |  no shutdown

Step 3

admin@NX-3550-T# show archive log config user username first-index start-number [last-index end-number ]

Displays the configuration log entries by the index numbers. If you specify a number for the optional last-index, all the log entries with the index numbers in the range from the value entered for the start-number through the end-number for the specified user are displayed.

Example:

The following example displays the configuration log entry numbers 4 and 5 for a user with the username, user02. The range for the first-index and last-index is 1 to 2000000000.

switch# show archive log config user user02  first-index 4 last-index 5
Last Log cleared/wrapped time is : Wed Oct 19 00:53:08 2016


INDEX   LINE                    USER          LOGGED COMMAND
4       console0                user02       | interface mgmt0 
5       console0                user02       |  no shutdown

Verifying the Device Configuration

To verify the configuration, use one of the following commands:

admin@NX-3550-T# show running-config

Displays the running configuration.

admin@NX-3550-T# show startup-config

Displays the startup configuration.

Note

If Layer 3 based feature configurations are disabled in the running-config, the show startup-config command does not display them. However, the configurations remain intact in the startup PSS, until the copy running startup command is performed.

This option masks the sensitive words in running configuration output with removed keyword.

Examples of Working with Configuration Files

This section includes examples of working with configuration files.

  • Copying Configuration Files
  • Backing Up Configuration Files
  • Rolling Back to a Previous Configuration

Copying Configuration Files

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

admin@NX-3550-T# 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:

admin@NX-3550-T# copy system:running-config bootflash:my-config

Backing Up Configuration Files

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

admin@NX-3550-T# copy startup-config bootflash:my-config

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

admin@NX-3550-T# copy 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):

admin@NX-3550-T# copy running-config bootflash:my-config

Rolling Back to a Previous Configuration

To roll back your configuration to a snapshot copy of a previously saved configuration, you need to perform the following steps:

  1. Clear the current running image with the write erase command.
  2. Restart the device with the reload command.
  3. Copy the previously saved configuration file to the running configuration with the copy configuration-file running-configuration command.
  4. Copy the running configuration to the start-up configuration with the copy running-config startup-config command.

Show and Save the Current Configuration

The configuration of the Cisco Nexus 3550-T Programmable Switch Platform is described by a running-config, which contains all settings that are currently in effect on the device.

admin@NX-3550-T# show running-config
interface ethernet1
  speed 10000
interface ethernet2
  speed 10000
switchport mode access
switchport access vlan 10
………
interface ethernet48
  speed 10000
interface vlan1
interface vlan10
  ip address 10.0.0.1/24
ip pim
ip igmp version 3
router bgp 123
  neighbor 192.168.10.2 remote-as 456
ip pim rp 192.168.10.2 224.0.0.0/4
spanning-tree priority 32768
username admin password (hidden)
hostname NX-3550-T
interface management1
  no shutdown
  ip address 192.168.220.10/24
interface management2
  no shutdown
vrf context management
  ip route 0.0.0.0/0 192.168.220.254
clock timezone UTC
aaa authentication login default local
aaa authorization exec default none

Given the considerable number of interfaces available in the Nexus 3550-T, the full output of show running-config may be more verbose than you require. You can examine the configuration of a particular interface, for example:

admin@NX-3550-T# show running-config interface ethernet1
interface ethernet1
  speed 10000
  switchport mode access
  switchport access vlan 10
ip pim rp 192.168.10.2 224.0.0.0/4
hostname NX-3550-T
ip name-server 192.168.220.248
vrf context management
  ip route 0.0.0.0/0 192.168.220.254

To show the configuration of a number of interfaces, combine this command with range selectors. For more details, see Configuring interfaces.

admin@NX-3550-T# show running-config interface ethernet1-3
interface ethernet1
  speed 10000
interface ethernet2
  speed 10000
  switchport mode access
  switchport access vlan 10
interface ethernet3
  speed 10000
  switchport mode access
  switchport access vlan 10
ip pim rp 192.168.10.2 224.0.0.0/4
hostname NX-3550-T
ip name-server 192.168.220.248
vrf context management
  ip route 0.0.0.0/0 192.168.220.254

As mentioned in the Command line interface topic, for improved readability, you can redirect the output of these commands into Unix utilities such as grep and less.

admin@NX-3550-T# show running-config | grep management -A 1
interface management1
  no shutdown
--
interface management2
  no shutdown
vrf context management
  ip route 0.0.0.0/0 192.168.220.254

To make the running-config persistent across reboots of the device, you must save it to the startup-config. To save the running-config to the startup-config, use the copy command.

admin@NX-3550-T# configure copy running-config startup-config
Saved running config to startup config

Any setting in the startup-config is applied to the device at the time of booting.

Create Custom Configurations

knsdksnc You can create custom configurations by copying existing configurations. You can use the running-config and startup-config to accomplish this:

admin@NX-3550-T# config copy running-config myconfig
Saved running config to "myconfig"

Then, apply these configurations to the running-config or startup-config.

Erase Configurations

Along with custom configurations that you created, you can erase the startup-config by using the erase startup-config command. This command reverts the Nexus 3550-T's power-up settings to the factory default settings.

Depending on how much of the configuration you want to reset, you can erase various elements of the running-config.

admin@NX-3550-T(config)# erase running-config
Usage: erase startup-config
       erase running-config [all] [management] [data-plane]
Erase configuration files
  • all resets the running-config to the factory default settings, potentially rendering the device inaccessible from the current connection.

  • management resets only those parts of the running- config related to the management of the device, not the high-speed interface configuration. For example, hostname management address, passwords, logging etc. are all covered in this reset group. This option could potentially render the device inaccessible from the current connection.

  • data-plane resets all interface configurations.

Take a Backup of the Configuration

The startup-config is stored within the Nexus 3550-T as a number of .json files, in the /mnt/persist/config/ directory. You can retrieve these files from the device by using scp or sftp for backup purposes, and put them back onto the device if necessary.

To retrieve the config files via scp, run the following command:

$ scp admin@NX-3550-T:/mnt/persist/config/*.json ./

To retrieve these files via sftp, run the following command:

$ sftp admin@NX-3550-T
admin@NX-3550-T's password:
Connected to admin@NX-3550-T.
sftp> get /mnt/persist/config/*.json