Cisco IOS Startup and Running Configuration Files
Learn how Cisco IOS running-config and startup-config differ, where they are stored, how to inspect them, and how to save changes before a reboot.
Why Cisco IOS Uses Configuration Files
Cisco IOS is the operating system used by many Cisco routers and switches. A configuration file is a collection of IOS commands that defines how the device operates. Configuration commands can set a hostname, interface IP addresses, routing-related settings, passwords, descriptions, and many other behaviors.
IOS uses two important configurations:
- running-config: the active configuration currently being used by the device.
- startup-config: the saved configuration that IOS uses when the device starts.
Commands entered in global configuration mode, interface configuration mode, or another configuration mode take effect in the active configuration immediately. However, taking effect now does not automatically mean that a command has been saved for the next boot.
Running Configuration
The running configuration, commonly called running-config, is the current active configuration used by IOS. It is held in RAM, or random-access memory.
RAM is volatile memory. Its contents are lost when the device reloads, reboots, or loses power. Therefore, a command can be working correctly now while still being lost later if it has not been copied to startup-config.
Viewing running-config
From privileged EXEC mode, identified commonly by a # prompt, use:
Router# show running-configIOS also accepts the common abbreviated form:
Router# show runThe output can include the hostname, passwords, interface sections, IP addresses, routing settings, and other active commands. On real devices, the output may be long. Terminal paging, sections, and filters can help you inspect only the relevant part, but show running-config remains the primary command for viewing the active configuration.
Startup Configuration
The startup configuration, commonly called startup-config, is the saved configuration that IOS reads during device startup. It is stored in NVRAM, or nonvolatile random-access memory.
NVRAM retains its contents without power. A saved startup configuration therefore remains available after a reload or power failure.
Viewing startup-config
From privileged EXEC mode, use:
Router# show startup-configA new device or a device whose startup configuration has been erased may not have a startup-config. In that case, IOS starts without the expected saved user configuration and may present initial setup behavior.
How the Two Configurations Relate
During boot, IOS reads startup-config from NVRAM and loads its commands into RAM. This produces the initial running-config used by the device.
- The device boots.
- IOS reads startup-config from NVRAM.
- The saved commands are loaded into RAM as the initial running-config.
- An administrator enters new commands or changes existing commands.
- Those changes affect running-config immediately.
- The changes remain only in RAM until an administrator saves them.
Because of this process, startup-config and running-config can differ. Saving copies the current running-config into startup-config and replaces the previous saved configuration with the current one.
Startup Configuration vs. Running Configuration
Saving Configuration Changes
After testing a change and confirming that it is correct, save the active configuration with:
Router# copy running-config startup-configIn this command, running-config is the source, and startup-config is the destination. IOS copies the current contents of RAM to the startup configuration in NVRAM. Depending on the IOS platform, the device may ask you to confirm the destination filename.
A typical interaction looks like this:
Router# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]The traditional equivalent is:
Router# write memoryThe commonly used abbreviation is:
Router# wrUse the save command after changes have been tested and before a planned reload or shutdown. Saving makes the current configuration available at the next boot, but it does not replace the need to verify that the active configuration actually works.
Configuration Lifecycle
Verification Workflow
Use a repeatable workflow whenever you configure a router or switch:
- Make the configuration change.
- Inspect the active result with
show running-config. - Check operational state with a suitable verification command such as
show ip interface brief. - Inspect the saved file with
show startup-config. - Compare the relevant sections. If a command appears in running-config but not startup-config, it has not been saved.
- After testing, save with
copy running-config startup-config. - Inspect startup-config again to confirm that the intended command is present.
The command show ip interface brief provides a quick view of interface names, assigned IP addresses, and interface status. It helps confirm the active operational state, while the two configuration commands show whether the configuration is present in RAM and NVRAM.
Common IOS Commands for Configuration Files
Example: Configure an IP Address Without Saving
This example demonstrates how a command can work immediately while remaining absent from the saved configuration. The interface name is an example; the correct name varies by device.
Router# configure terminal
Router(config)# interface FastEthernet0/0
Router(config-if)# ip address 192.0.2.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# endThe interface address now affects running-config. Verify the active state:
Router# show ip interface briefLook for the interface and its address, such as 192.0.2.1. Then inspect both files:
Router# show running-config
Router# show startup-configThe interface section and address should appear in running-config. If the change was not previously saved, the corresponding commands will not appear in startup-config. This proves that the interface can be configured and active now without being prepared for the next boot.
What Happens During Reload or Power Loss?
The reload command restarts the Cisco IOS device:
Router# reloadWhen the device reloads, RAM is cleared. IOS then reads startup-config from NVRAM and rebuilds the initial running-config from that saved file.
If an interface IP address existed only in running-config, the address disappears after reboot because the RAM copy was lost and no matching command was available in startup-config. If the address was saved first, IOS loads it again during startup.
Unsaved Change
- Configure an IP address.
- Confirm it with
show ip interface brief. - Reload without saving.
- After startup, check
show ip interface briefandshow running-config. - The address is absent if it was not in startup-config.
Saved Change
- Configure or modify the interface.
- Verify the active result.
- Run
copy running-config startup-config. - Confirm the command with
show startup-config. - Reload the device.
- Use
show ip interface briefandshow running-configto confirm that the setting returned.
Example: Detect and Resolve a Configuration Mismatch
Make a small change, such as a hostname or interface description:
Router# configure terminal
Router(config)# hostname Branch-Router
Branch-Router(config)# interface FastEthernet0/0
Branch-Router(config-if)# description LAN connection
Branch-Router(config-if)# endInspect both files separately:
Branch-Router# show running-config
Branch-Router# show startup-configIdentify commands present only in running-config. In this example, the hostname or description may be missing from startup-config. Once the active configuration is confirmed to be correct, save it:
Branch-Router# copy running-config startup-configRun show startup-config again and verify that the intended commands now appear in the saved file.
Troubleshooting Configuration Persistence
An Interface IP Address Is Missing After Reboot
Likely cause: The address was added to running-config but was never copied to startup-config.
Verify:
- Run
show running-config. - Run
show startup-config. - Check the interface with
show ip interface brief.
Resolve: Reapply the intended interface configuration, verify it in running-config, and save it with copy running-config startup-config.
Recent Changes Appear Only in Running-config
Likely cause: The active configuration has not been saved since the changes were made.
Resolve: After confirming that the active configuration is correct, run:
Router# copy running-config startup-configThe Device Starts With Defaults or Initial Setup
Likely cause: There is no valid startup-config in NVRAM, or the intended configuration was not saved.
Verify: Run show startup-config and inspect show running-config.
Resolve: Configure the required settings, verify them, and save the verified running configuration to startup-config.
A Saved Command Does Not Produce the Expected Result Immediately
Saving controls persistence at boot; it does not guarantee that a command is valid or that an interface is operational. Check show running-config for the command and use show ip interface brief to inspect interface addressing and status. Correct the active configuration or interface state, verify operation, and then save the final configuration.
Exam-Relevant Notes
- running-config is in RAM.
- startup-config is in NVRAM.
- RAM is volatile; unsaved changes disappear after reload or power loss.
- NVRAM is nonvolatile; saved startup configuration persists without power.
show running-configdisplays the active configuration.show startup-configdisplays the saved boot configuration.copy running-config startup-configsaves current changes.write memoryand, on supported platforms,wrare traditional save commands.- A command taking effect immediately does not prove that it has been saved.
Summary
IOS loads startup-config from NVRAM into RAM when the device boots. The resulting running-config controls the device immediately. New configuration commands modify running-config first, so the active and saved files can differ. Use show running-config to inspect current behavior, show startup-config to inspect boot persistence, and copy running-config startup-config to save verified changes before a reload or shutdown.