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.
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.
To change the startup-configuration file, you can either save the running configuration file to the startup configuration or download a configuration file from a file server to the startup configuration.
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.
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.
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 Cisco NX-OS device has a route to the remote server. The Cisco 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.
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.
Step 2
show running-config
Example:
switch# show running-config
(Optional)
Displays the running configuration.
Step 3
copy running-config startup-config
Example:
switch# copy running-config startup-config
(Optional)
Copies the running configuration to the startup configuration.
Downloading 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.
Caution
This 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 Cisco NX-OS device has a route to the remote server. The Cisco 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.
switch# 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
switch#
Reloads the Cisco NX-OS device.
Note
Do not use the setup utility to configure the device.
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.
Step 4
copy running-config startup-config
Example:
switch# copy running-config
startup-config
Saves the running configuration file to the startup configuration file.
Copying the Running Configuration From an External Flash Memory
Device
You can configure your Cisco NX-OS device by copying configuration
files created on another Cisco NX-OS device and saved to an external flash
memory device.
Before You Begin
Insert the external flash memory device into the active supervisor
module.
SUMMARY STEPS
1.
(Optional) dir {slot0: |
usb1:
|
usb2:}[directory/]
Copying the Startup Configuration From an External Flash Memory
Device
You can recover the startup configuration on your Cisco NX-OS device
by downloading a new startup configuration file saved on an external flash
memory device.
Before You Begin
Insert the external flash memory device into the active supervisor
module.
SUMMARY STEPS
1.
(Optional) dir {slot0: |
usb1: |
usb2:}[directory/]
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.write erase
2.reload
3.copyconfiguration_filerunning-configuration
4.copy running-config startup-config
DETAILED STEPS
Command or Action
Purpose
Step 1
write erase
Example:
switch# write erase
Clears the current configuration of the switch.
Step 2
reload
Example:
switch# reload
Restarts the device. You will be prompted to provide a kickstart and system image file for the device to boot and run.
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: