- Information About Configuration Files
- Licensing Requirements for Configuration Files
- Managing Configuration Files
- Saving the Running Configuration to the Startup Configuration
- Copying a Configuration File to a Remote Server
- Downloading the Running Configuration From a Remote Server
- Downloading the Startup Configuration From a Remote Server
- Copying Configuration Files to an External Flash Memory Device
- Copying the Running Configuration From an External Flash Memory Device
- Copying the Startup Configuration From an External Flash Memory Device
- Copying Configuration Files to an Internal File System
- Rolling Back to a Previous Configuration
- Removing the Configuration for a Missing Module
- Erasing Device Configurations
- Verifying the Device Configuration
- Examples of Working With Configuration Files
- Additional References
Working with Configuration Files
This chapter describes how to work with configuration files on the Cisco NX-OS device.
This chapter includes the following sections:
•
Information About Configuration Files
•
Licensing Requirements for Configuration Files
•
Verifying the Device Configuration
•
Examples of Working With Configuration Files
Information About Configuration Files
Configuration files contain the Cisco NX-OS software commands used to configure the features on a Cisco NX-OS device. Commands are parsed (translated and executed) by the Cisco NX-OS software when the system is booted (from the startup-config file) or when you enter commands at the CLI in a configuration mode.
To change the startup configuration file, you can either save the running-configuration file to the startup configuration using the copy running-config startup-config command or copy a configuration file from a file server to the startup configuration (see the "Copying a Configuration File to a Remote Server" section).
This section includes the following topics:
Types of Configuration Files
The Cisco NX-OS software has two types of configuration files, running configuration and startup configuration. The device uses the startup configuration (startup-config) during device startup to configure the software features. The running configuration (running-config) contains the current changes that you make to the startup-configuration file. The two configuration files can be different. You may want to change the device configuration for a short time period rather than permanently. In this case, you would change the running configuration by using commands in global configuration mode but not save the changes to the startup configuration.
To change the running configuration, use the configure terminal command to enter global configuration mode. As you use the Cisco NX-OS configuration modes, commands generally are executed immediately and are saved to the running configuration file either immediately after you enter them or when you exit a configuration mode. For information about configuration modes, see Chapter 3, "Understanding the CLI."
To change the startup-configuration file, you can either save the running configuration file to the startup configuration (see the "Saving the Running Configuration to the Startup Configuration" section) or download a configuration file from a file server to the startup configuration (see the "Downloading the Startup Configuration From a Remote Server" section).
Virtualization Support
Licensing Requirements for Configuration Files
The following table shows the licensing requirements for this feature:
Managing Configuration Files
This section describes how to manage configuration files and includes the following topics:
•
Saving the Running Configuration to the Startup Configuration
•
Copying a Configuration File to a Remote Server
•
Downloading the Running Configuration From a Remote Server
•
Downloading the Startup Configuration From a Remote Server
•
Copying Configuration Files to an External Flash Memory Device
•
Copying the Running Configuration From an External Flash Memory Device
•
Copying the Startup Configuration From an External Flash Memory Device
•
Copying Configuration Files to an Internal File System
•
Rolling Back to a Previous Configuration
•
Removing the Configuration for a Missing Module
•
Erasing Device Configurations
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.
For information on saving the running configuration for all VDCs on the physical device, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 4.0.
SUMMARY STEPS
1.
show running-config
2.
copy running-startup-config
DETAILED STEPS
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 NX-OS devices.
SUMMARY STEPS
1.
copy running-config scheme://server/[url/]filename
copy startup-config scheme://server/[url/]filename
DETAILED STEPS
Downloading the Running Configuration From a Remote Server
You can configure your 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. For more information on copying files, see the "Copying Files" section on page 6-9.
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 NX-OS device has a route to the remote server. The NX-OS 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.
SUMMARY STEPS
1.
copy scheme://server/[url/]filename running-config
2.
show running-config
3.
copy running-config startup-config
4.
show startup-config
DETAILED STEPS
Downloading the Startup Configuration From a Remote Server
You can configure your 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. For more information on copying files, see the "Copying Files" section on page 6-9.
BEFORE YOU BEGIN
Ensure that the configuration file you that 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 NX-OS device has a route to the remote server. The NX-OS 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.
SUMMARY STEPS
1.
copy scheme://server/[url/]filename startup-config
2.
show startup-config
DETAILED STEPS
Copying Configuration Files to an External Flash Memory Device
You can 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.
SUMMARY STEPS
1.
dir {slot0: | usb1: | usb2:}[directory/]
2.
copy running-config {slot0: | usb1: | usb2:}[directory/]filename
copy startup-config {slot0: | usb1: | usb2:}[directory/]filename
DETAILED STEPS
Copying the Running Configuration From an External Flash Memory Device
You can configure your NX-OS device by copying configuration files created on another Cisco NX-OS device and saved to an external Flash memory device. For more information on copying files, see the "Copying Files" section on page 6-9.
BEFORE YOU BEGIN
Insert the external Flash memory device into the active supervisor module.
SUMMARY STEPS
1.
dir {slot0: | usb1: | usb2:}[directory/]
2.
copy {slot0: | usb1: | usb2:}[directory/]filename running-config
3.
show running-config
4.
copy running-config startup-config
5.
show startup-config
DETAILED STEPS
Copying the Startup Configuration From an External Flash Memory Device
You can recover the startup configuration on your NX-OS device by downloading a new startup configuration file saved on an external Flash memory device. For more information on copying files, see the "Copying Files" section on page 6-9.
BEFORE YOU BEGIN
Insert the external Flash memory device into the active supervisor module.
SUMMARY STEPS
1.
dir {slot0: | usb1: | usb2:}[directory/]
2.
copy {slot0: | usb1: | usb2:}[directory/]filename startup-config
3.
show startup-config
DETAILED STEPS
Copying Configuration Files to an Internal File System
You can copy configuration files to the internal memory as a backup for later use.
SUMMARY STEPS
1.
copy running-config [filesystem:[directory/] | directory/]filename
copy startup-config [filesystem:[directory/] | directory/]filename
DETAILED STEPS
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.
SUMMARY STEPS
1.
copy [filesystem:[directory/] | directory/]backup-filename running-config
copy [filesystem:[directory/] | directory/]backup-filename startup-config
DETAILED STEPS
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. You can only remove the configuration for a missing module from the default VDC.
Note
You can only remove the configuration for an empty slot in the chassis.
BEFORE YOU BEGIN
Ensure that you are in the default VDC.
Remove the I/O module from the chassis.
SUMMARY STEPS
1.
show hardware
2.
purge module slot running-config
3.
copy running-config startup-config
DETAILED STEPS
Erasing Device Configurations
You can erase the configuration on your device to return to the factory defaults.
You can erase the following configuration files saved in the persistent memory on the device:
•
Startup
•
Boot
•
Debug
Note
The write erase command erases the entire startup configuration, except for the following:
•
Boot variable definitions
•
The IPv4 configuration on the mgmt0 interface, including the following:
–
Address
–
Subnet mask
–
Route address in the management VRF
To remove the boot variable definitions and the IPv4 configuration on the mgmt0 interface, use the write erase boot command.
SUMMARY STEPS
1.
write erase [boot | debug]
DETAILED STEPS
Verifying the Device Configuration
To verify the device configuration, perform one of the following tasks:
|
|
|
|---|---|
show running-config |
Displays the running configuration. |
show startup-config |
Displays the startup configuration. |
Examples of Working With Configuration Files
This section includes the following topics:
•
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:
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
Backing Up Configuration Files
This example shows how to create a snapshot of the startup configuration in a predefined location on the device (binary file):
switch# copy startup-config nvram:snapshot-config
This example shows how to back up the startup configuration to the bootflash: file system (ASCII file):
switch# copy startup-config bootflash:my-config
This example shows how to back up the startup configuration to the TFTP server (ASCII file):
switch# 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):
switch# copy running-config bootflash:my-config
Rolling Back to a Previous Configuration
This example shows how to roll back to a snapshot copy of a previously saved running configuration (binary file):
switch# copy nvram:snapshot-config startup-config
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 startup-config
Additional References
For additional information related to managing configuration files, see the following sections:
Related Documents
|
|
|
|---|---|
Licensing |
Cisco Nexus 7000 Series NX-OS Licensing Guide, Release 4.0 |
Command reference |
Cisco Nexus 7000 Series NX-OS Fundamentals Command Reference, Release 4.0 |
Feedback