CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

When you configure a Cisco Catalyst or enterprise switch running Cisco IOS or IOS-XE, your commands take effect immediately in volatile dynamic RAM (DRAM). This live operational state is designated as the running configuration. Because DRAM requires continuous power to retain data, any uncommitted modifications will be permanently erased if the switch reboots or experiences a power outage. To make your settings permanent, you must commit them to non-volatile RAM (NVRAM), where the startup configuration is stored.

Safeguarding configuration files is one of the most critical routines in network administration. Beyond simply writing changes to local hardware, a resilient workflow incorporates off-box disaster recovery backups, automated versioning, and an understanding of how the switch references boot instructions. The following guide covers everything you need to permanently save, compare, export, automate, and troubleshoot Cisco switch configurations.


Step-by-Step Guide: Saving the Running Configuration to NVRAM

Committing changes from volatile memory to persistent storage takes only a few seconds from the command-line interface (CLI). Follow these sequential steps to verify and write your changes safely.

Step 1: Enter Privileged EXEC Mode

To view or save configurations, you must operate in Privileged EXEC mode (indicated by the # prompt). If your terminal displays user EXEC mode (>), elevate your privilege level:

Switch> enable
Switch#

Step 2: Review Unsaved Changes

Before committing changes, ensure that you have not introduced syntax errors or unintended parameters into the active session:

Switch# show running-config

On switches supporting the configuration archive feature, you can quickly review only the uncommitted changes between RAM and NVRAM:

Switch# show archive config differences

Step 3: Execute the Save Command

The standard, authoritative Cisco command to write changes to persistent storage is copy running-config startup-config:

Switch# copy running-config startup-config

Step 4: Confirm Destination Filename

After entering the command, Cisco IOS prompts you for the destination filename. The default target, startup-config, is enclosed in square brackets:

Destination filename [startup-config]? 

Press Enter to accept the default destination. Cisco IOS will process the request and display a confirmation message:

Building configuration...
[OK]
Switch#

Step 5: Verify the Saved Configuration

Confirm that the startup configuration in NVRAM matches your expectations:

Switch# show startup-config

Once you see the [OK] prompt, your active settings are written to NVRAM and will persist across reboots.


Command Comparison: write memory vs. copy running-config startup-config

Network engineers frequently debate whether to use the classic write memory (commonly abbreviated as wr or wr mem) or the standard copy running-config startup-config (copy run start). While both commands write active settings to NVRAM on standard Cisco switches, they originate from different eras of Cisco IOS architecture.

Evaluation Criterioncopy running-config startup-configwrite memory (wr / wr mem)
Command Syntaxcopy running-config startup-configwrite memory
Common Abbreviationscopy run start, cop r stwr, wr mem, w
Interactive PromptPrompts for confirmation: [startup-config]?Executes immediately without confirmation prompt
Cisco Deprecation StatusStandard, active Cisco IOS/IOS-XE file management syntaxOfficially deprecated in Cisco IOS documentation; retained for backward compatibility
Cisco Exam Standard (CCNA/CCNP)Required on all official certification examsOften marked incorrect or unrecognized in exam simulation environments
Cisco NX-OS Support (Data Center)Native support across all Nexus platformsUnsupported natively; requires a custom CLI alias (cli alias name wr copy run start)
Cisco IOS-XR Support (Service Provider)Unsupported (uses two-stage commit model)Unsupported
Underlying ArchitectureGeneral-purpose file transfer mechanism (copy <source> <destination>)Specific monolithic routine dedicated solely to committing RAM to NVRAM

Key Operational Takeaways

  1. Safety vs. Speed: write memory requires fewer keystrokes and executes immediately, making it a favorite for seasoned engineers during fast-paced maintenance windows. Conversely, copy run start forces a confirmation step that prevents accidental overwrites when working across different file destinations.
  2. Platform Consistency: Modern Cisco operating systems favor uniform file-system primitives. Learning copy running-config startup-config prepares you for enterprise Catalyst switches (IOS/IOS-XE), Nexus data center switches (NX-OS), and custom file-system copy operations.

Off-Device Backups: Exporting Configuration to TFTP, FTP, and USB

Saving to NVRAM protects your configuration against planned reloads and power cuts, but it does not protect against catastrophic hardware failures, lightning strikes, or chassis replacement scenarios. A resilient disaster recovery plan requires off-device backups.

Step 1: Verify Network Connectivity or Physical Storage

Before initiating an external copy, ensure your switch can communicate with the backup host or that your physical drive is mounted:

  • For TFTP/FTP/SCP: Ping the remote server IP from the switch CLI (ping 192.168.10.50).
  • For USB Storage: Check that the flash drive is recognized:
    text
    Switch# dir usbflash0:

Step 2: Export Configuration to a TFTP Server

TFTP remains the most common lightweight transfer protocol for network equipment. Run the copy command specifying tftp: as the destination:

Switch# copy running-config tftp:
Address or name of remote host []? 192.168.10.50
Destination filename [switch-confg]? CoreSwitch-Backup-2026.cfg
!!
[OK - 12485 bytes]
12485 bytes copied in 0.284 secs (43961 bytes/sec)

Each exclamation mark (!) signifies a successful block transmission across the network.

Step 3: Export Configuration to an External USB Drive

Modern Cisco Catalyst switches include front-panel USB ports. You can copy configurations directly to a formatted FAT32 USB drive:

Switch# copy running-config usbflash0:CoreSwitch-Backup-2026.cfg

Press Enter when prompted to confirm the destination filename. Run dir usbflash0: to verify that the file size matches your configuration.

Step 4: Export Configuration via Secure Copy Protocol (SCP) or FTP

For environments requiring encrypted transit or strict user authentication, target an SCP or FTP server:

Switch# copy running-config scp://admin@192.168.10.60/backups/CoreSwitch.cfg

Enter the remote user password when prompted to complete the transfer.


Automated Configuration Backups: Cisco IOS Archive Template

Manual backups are often forgotten during routine configuration adjustments. Cisco IOS includes an internal archive utility that can automatically export versioned backups to a remote server or local flash every time a network engineer saves the configuration.

Ready-to-Use Archive Configuration Template

Apply the following template in Global Configuration mode to establish automated version control:

! =========================================================
! CISCO IOS / IOS-XE AUTOMATIC BACKUP CONFIGURATION TEMPLATE
! =========================================================
configure terminal
!
archive
 path <STORAGE_TARGET>/$h-config
 write-memory
 time-period <BACKUP_INTERVAL_MINUTES>
 maximum <VERSION_RETENTION_COUNT>
!
end

Production Example (TFTP with Rolling Backups)

In this practical scenario, the switch automatically archives its configuration to a centralized TFTP server on every write memory or copy run start, retains the last 10 historical revisions, and performs a scheduled backup every 24 hours (1,440 minutes):

configure terminal
archive
 path tftp://192.168.10.50/cisco-backups/$h-config
 write-memory
 time-period 1440
 maximum 10
end

Parameter Reference

  • path: Defines the backup destination URI (supports tftp:, ftp:, scp:, flash:, or usbflash0:). The $h variable dynamically substitutes the switch hostname, and a trailing hyphen automatically appends sequential version numbers (e.g., CoreSwitch-config-1, CoreSwitch-config-2).
  • write-memory: Triggers an automatic backup push whenever an administrator runs copy running-config startup-config or write memory.
  • time-period: Sets a recurring scheduled backup interval in minutes, independent of manual save events.
  • maximum: Specifies the number of configuration versions to preserve (between 1 and 14). When the limit is reached, the oldest version is overwritten.

You can inspect the generated backup log at any time with:

Switch# show archive

Troubleshooting: What to Do When a Cisco Switch Loses Configuration After Reload

If a Cisco switch repeatedly boots into the default factory state or displays the System Configuration Dialog after a reload—despite running copy run start—the system is failing to read NVRAM during its boot sequence. Follow this troubleshooting progression to resolve the issue.

Step 1: Inspect the Configuration Register

The most common cause of configuration loss is a misconfigured configuration register. In password-recovery scenarios, the register is often set to 0x2142, which instructs the bootloader to ignore NVRAM startup settings entirely.

Check the active register value at the bottom of the show version output:

Switch# show version
...
Configuration register is 0x2142
  • 0x2102: Normal operating mode (reads NVRAM startup configuration on boot).
  • 0x2142: Bypass mode (ignores NVRAM startup configuration on boot).

Step 2: Restore the Register to Production Default

If the register is set to 0x2142, revert it to standard operation in Global Configuration mode:

Switch# configure terminal
Switch(config)# config-register 0x2102
Switch(config)# end

Run show version again. The final line should indicate that the change will take effect on the next reboot:

Configuration register is 0x2142 (will be 0x2102 at next reload)

Step 3: Resolve Catalyst IOS-XE ROMMON Variables

Modern Cisco Catalyst switches (such as the Catalyst 3650, 3850, and 9000 series running Cisco IOS-XE) do not always use standard software configuration registers. Instead, they rely on ROMMON boot variables.

Check your switch boot settings:

Switch# show boot

If the output indicates that the switch is ignoring startup configuration, run:

Switch# configure terminal
Switch(config)# no system ignore startupconfig
Switch(config)# end

If you are dropped into the ROMMON bootloader prompt (switch:) during a manual reboot, verify and clear the bypass variable directly:

switch: unset SWITCH_IGNORE_STARTUP_CFG
switch: set
switch: boot

Step 4: Validate NVRAM Filesystem Integrity

If the configuration register is correct (0x2102) but settings still disappear, inspect the health of the physical NVRAM filesystem:

Switch# dir nvram:

If the switch reports memory read/write errors, allocation faults, or fails to list startup-config, the NVRAM flash sector or motherboard battery may be degraded. Attempt to reformat the configuration memory (if supported by your platform) or back up the switch configuration off-device immediately and open a TAC hardware replacement case.


Managing Configuration Files: Cisco Official Command Reference and Architecture

To design robust management workflows, network engineers must understand the underlying storage architecture defined in Cisco Systems authoritative documentation.

Memory Hierarchy: RAM vs. NVRAM

  • system:running-config: Located in dynamic RAM. Represents the volatile operating state currently running in system memory. Manipulated by active CLI input, dynamic routing updates, and automated scripts.
  • nvram:startup-config: Located in non-volatile flash memory. Represents the static configuration loaded into RAM when the switch completes Power-On Self-Test (POST).

Formal Syntax Specification: copy

The primary Cisco command for configuration management adheres to the standardized file transfer format:

copy <source-url> <destination-url>

Syntax Arguments

  • source-url: Location of the source file or running system state. Common arguments include running-config, startup-config, flash:<filename>, tftp:<URL>, and usbflash0:<filename>.
  • destination-url: Target location for the copied file. Common arguments include startup-config, running-config, tftp:<URL>, or local flash volumes.

Operational Notes on Merging

Copying an external configuration into startup-config completely overwrites the existing NVRAM file. However, executing copy <source> running-config does not overwrite active settings; it executes an in-place merge, applying new lines and overwriting matching parameters while leaving unmentioned running settings active.

Cisco Authoritative Documentation Sources

For formal command syntax dictionaries, security hardening baselines, and storage management parameters, refer to:

  • Cisco Systems, Inc. — Cisco IOS Configuration Fundamentals Configuration Guide
  • Cisco Systems, Inc. — System Management Configuration Guide, Cisco Catalyst 9000 Series Switches
  • Cisco Systems, Inc. — Cisco IOS Configuration Fundamentals Command Reference

Mastering configuration management on Cisco switches requires moving beyond simple ad-hoc commands to a complete data-preservation strategy. Always commit your active changes to NVRAM using copy running-config startup-config after testing your changes. Reinforce your local saves by maintaining off-device copies on TFTP servers or encrypted storage, automate versioning using the IOS archive facility, and ensure your configuration register remains set to 0x2102 so that critical infrastructure reboots smoothly and predictably.

Please follow and like us:
Last modified: October 31, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.