CCNA online course

Cisco IOS Configuration Files: Running Configuration, Startup Configuration, and Backup Management

Learn how Cisco IOS uses running-config and startup-config, how to save, compare, back up, restore, and erase configurations safely.

Cisco IOS is the Cisco Internetwork Operating System used by many routers and switches. The device's behavior is controlled by configuration commands that define interfaces, routing, passwords, VLANs, management access, and other features.

Two configuration files are central to IOS administration: running-config, which is active now, and startup-config, which is used during the next normal boot. Understanding the difference prevents lost changes and makes maintenance, replacement, and recovery safer.

Running Configuration and Startup Configuration

The running configuration, or running-config, is the active configuration currently held in RAM. Commands entered in configuration mode change this configuration immediately. For example, changing a hostname changes the device prompt as soon as the command is accepted.

RAM is volatile memory. Its contents are lost when the device loses power or reloads unless the configuration has been copied to a nonvolatile location.

The startup configuration, or startup-config, is the saved configuration normally stored in NVRAM. During a normal boot, IOS loads this saved configuration into RAM and uses it to create the running configuration.

Changing the running configuration does not automatically change the startup configuration. A deliberate save operation is required when changes must survive a reload.

Characteristicrunning-configstartup-config
Storage locationRAMNormally NVRAM
Active immediatelyYesNo; it is normally loaded during boot
Survives reloadNo, unless saved elsewhereYes, because it is nonvolatile
Modified by configuration commandsYesNo, not automatically
Display commandshow running-configshow startup-config
How to updateEnter configuration commandsCopy running-config to startup-config

Display the active configuration

Router# show running-config

This command displays the configuration currently in use. The output can include interface settings, routing protocols, local users, access controls, and line settings.

Display the saved configuration

Router# show startup-config

This command displays the configuration saved for the next normal boot. If no configuration has been saved, IOS may report that the startup configuration does not exist.

Saving Configuration Changes

After making intentional changes, copy the active configuration to the saved configuration:

Router# copy running-config startup-config

IOS commonly asks for confirmation of the destination filename. Press Enter to accept the suggested filename unless a different filename is specifically required. A successful operation should report that the configuration was copied.

The older equivalent command is:

Router# write memory

write memory, often shortened to write mem, is still seen in labs and older documentation. The copy running-config startup-config form clearly describes the source and destination and is the preferred teaching and operational form.

Verify the save instead of assuming it succeeded:

Router# show startup-config

For a hostname example:

Router# configure terminal
Router(config)# hostname Branch-R1
Branch-R1(config)# end
Branch-R1# show running-config | include hostname
hostname Branch-R1
Branch-R1# copy running-config startup-config
Destination filename [startup-config]? <Enter>
Branch-R1# show startup-config | include hostname
hostname Branch-R1

Comparing the Two Configurations

Display both files when investigating whether unsaved changes exist:

Router# show running-config
Router# show startup-config

Differences can reveal a new interface address, changed routing statement, modified password, or other change that has not been saved. A configuration comparison command is available on some IOS releases and platforms:

Router# show archive config differences nvram:startup-config system:running-config

Syntax and availability vary. If the command is unsupported, compare the two displayed outputs manually or use an approved external comparison tool after collecting the outputs.

Cisco IOS Configuration Storage Locations

IOS devices use several memory locations and file systems. The exact layout differs by platform, so inspect the device rather than assuming every platform has identical storage.

LocationTypical ContentsVolatile or NonvolatileWhen UsedCommon IOS Reference
RAM / running-configActive configuration and operating dataVolatileDuring normal operationsystem: or show running-config
NVRAM / startup-configSaved boot configurationNonvolatileLoaded during a normal bootnvram:
Flash memoryIOS images, backups, and other filesNonvolatileImage storage and local file storageflash:
TFTP server or other remote storageOff-device configuration backupsNonvolatile, managed externallyBackup, replacement, and recovery workflowstftp:, or supported FTP/SCP locations

Use these commands to inspect available file systems and local files:

Router# show file systems
Router# dir flash:
Router# dir nvram:

Flash primarily stores IOS images, but it can also contain configuration backups and other files. A TFTP server is common in basic lab environments. FTP or SCP may be preferable when supported because secure transfer protects configuration contents and credentials during transmission.

Backing Up Configurations

An off-device backup protects against hardware failure, accidental erasure, failed changes, and device replacement. Back up either the active configuration or the saved configuration depending on the goal:

  • Back up running-config when you need the exact configuration currently active, including changes not yet saved.
  • Back up startup-config when you need the configuration already approved for the next boot.

To copy the active configuration to a TFTP server:

Router# copy running-config tftp:

To copy the saved configuration:

Router# copy startup-config tftp:

IOS prompts for values such as the remote host address and destination filename:

Address or name of remote host []? 192.0.2.50
Destination filename [router-confg]? Branch-R1-2026-08-16-startup.cfg

The exact prompts and default filename vary by IOS release. Use a meaningful filename containing the device name, configuration type, and date. Confirm that the device can reach the server, the TFTP service is running, the server permits writes, and any required source interface or management VRF is correct.

Verify the transfer from both sides. IOS should report a successful copy, and the server should show the expected file with a sensible size and timestamp. Do not treat a successful command prompt alone as a complete backup test; inspect the resulting file when possible.

Restoring Configurations

Restore a file to running-config when its commands should be applied immediately:

Router# copy tftp: running-config

This operation generally merges commands from the source into the existing running configuration. Merging is not the same as deleting every existing command and replacing the configuration. Old commands may remain unless the imported configuration explicitly changes or removes them.

Restore a file to startup-config when it should be the saved configuration used on the next boot:

Router# copy tftp: startup-config

This replaces the saved startup configuration at the destination. It does not automatically change the current running configuration. A reload is normally required for the newly saved configuration to become active, and that reload should occur during an approved maintenance window.

GoalSourceDestinationResultRisk or Verification Step
Save current changesrunning-configstartup-configCurrent configuration becomes persistentVerify with show startup-config
Back up configurationrunning-config or startup-configtftp: or secure remote storageCreates an off-device copyVerify server permissions and file creation
Restore for immediate useTFTP configuration filerunning-configMerges commands into active configurationCan immediately disrupt access; use console when possible
Restore for next reloadTFTP configuration filestartup-configReplaces the saved boot configurationReview file and verify before reloading
Erase saved configurationstartup-configNVRAM removalRemoves the saved boot configurationDestructive; back up first and confirm the prompt

Imported commands can change the management IP address, default gateway, VLAN, ACL, username, password, console settings, routing, or interface state. A restore that looks correct in a file can still disconnect remote administrators as soon as it is merged.

Erasing and Resetting Configuration Files

To erase the saved configuration from NVRAM, use:

Router# erase startup-config

The legacy form is:

Router# write erase

Confirm the destructive prompt carefully. Erasing startup-config alone does not remove the current running configuration. The active settings remain in RAM until the device is reloaded or otherwise reinitialized.

A normal reset sequence for a device being returned to an unconfigured state is:

  1. Make and verify an external backup if the existing configuration might be needed.
  2. Erase the startup configuration.
  3. On a switch platform that stores VLAN information separately, remove the VLAN database when a complete reset is intended.
  4. Reload the device and confirm the prompts and resulting state.
Switch# erase startup-config
Switch# delete flash:vlan.dat
Switch# reload

Only use delete flash:vlan.dat when it applies to the platform and removal of the stored VLAN information is intended. Deleting it can remove VLAN definitions that are separate from startup-config.

Boot Behavior and Configuration Recovery Concepts

During a normal boot, IOS starts, finds a valid startup configuration, and loads it into RAM as the running configuration. If no startup configuration exists, the device may start with minimal defaults and offer the setup dialog, an interactive initial-configuration process.

The configuration register is a boot control value. Among other boot-related behaviors, its setting can influence whether IOS loads startup-config. Therefore, a startup configuration can exist in NVRAM while the device is configured not to use it during boot.

Password-recovery and configuration-recovery procedures may temporarily bypass or alter the handling of startup-config. The exact process depends on the hardware platform, IOS version, console access, and recovery policy. Do not assume that one platform's recovery sequence applies universally.

Operational Examples

Preserve a hostname change after reboot

  1. Enter global configuration mode and change the hostname.
  2. Use show running-config or a filtered display to verify the active change.
  3. Copy running-config to startup-config.
  4. Use show startup-config to verify that the hostname is saved.

Identify unsaved changes before maintenance

  1. Display both running-config and startup-config.
  2. Use the archive difference command if the platform supports it.
  3. Review whether every difference is intentional.
  4. Save only after confirming the intended state, then proceed with the reload.

Back up a router to TFTP

  1. Confirm IP reachability with a ping to the TFTP server.
  2. Choose running-config for the current active state or startup-config for the saved state.
  3. Use a meaningful destination filename.
  4. Confirm successful transfer in IOS and verify the file on the server.
Router# ping 192.0.2.50
Router# copy startup-config tftp:
Address or name of remote host []? 192.0.2.50
Destination filename [router-confg]? Branch-R1-approved.cfg

Restore a replacement device

  1. Review the known-good file and confirm that platform-specific interface names and features match the replacement.
  2. Copy it to startup-config when the configuration should take effect after the next boot.
  3. Reload during a planned maintenance window.
  4. Verify interfaces, management access, VLANs, routing, and security settings after boot.

Prepare a switch for lab reuse

  1. Back up the existing configuration if it may be needed.
  2. Erase startup-config.
  3. Check whether a separate VLAN database must be removed.
  4. Reload and confirm that the device enters initial configuration behavior or otherwise has the expected default state.

Troubleshooting Configuration Problems

Changes disappear after a reload

  • Likely cause: The changes were made only to running-config.
  • Check: Run show startup-config before reloading.
  • Action: Run copy running-config startup-config and verify the result.
  • Additional possibility: Boot-related settings may cause the device to ignore startup-config. Check the configuration register and platform boot messages.

Startup-config does not exist

  • No configuration may have been saved yet, or startup-config may have been erased.
  • Use show running-config to determine whether a usable active configuration exists.
  • Save it with copy running-config startup-config.
  • If saving fails, inspect show file systems, NVRAM status, and platform messages.

A TFTP backup or restore fails

  • Ping the TFTP server from the device.
  • Verify the server address, routing, interface status, VLAN membership, and management VRF.
  • Confirm that the TFTP service is running and permits the required read or write operation.
  • Check firewall rules and the requested filename or server path.
  • Verify the resulting file and its contents on the server.

Restoring a file removes remote management access

  • The imported configuration may change the management address, gateway, VLAN, ACL, username, password, or line settings.
  • Use console access for restoration work whenever possible.
  • Review the file before applying it and keep a known recovery method available.
  • When immediate merging is unsafe, copy the file to startup-config and reload during a controlled window.

Old VLANs remain after startup-config is erased

  • Some switches store VLAN information separately, commonly in flash:vlan.dat.
  • Inspect flash storage and remove the VLAN database only when a full reset is intended.
  • Reload and verify the VLAN state.

Configuration Management Best Practices

  • Save intentional changes promptly, especially before a planned reload.
  • Use show running-config, show startup-config, and supported comparison commands to verify state.
  • Create an external backup before upgrades, major changes, hardware replacement, and resets.
  • Use filenames that identify the device, configuration type, and backup date.
  • Retain backups outside the device and protect them with appropriate permissions.
  • Prefer secure file transfer such as SCP when supported; TFTP sends files without strong security protections.
  • Review a configuration before restoring it and plan for possible management-access changes.
  • After a restore or reload, verify interfaces, VLANs, routing, authentication, and management connectivity.

For broader context, review the computer networking fundamentals, IOS password configuration, and NTP configuration lessons.