Skip to content
Guide: IOS maintenanceSwitch
CCNA learning path

Guide

IOS maintenance: password recovery, configuration register, backups, image restore and secure file transfer

Learn the IOS and IOS XE maintenance workflows for recovering access, protecting configurations, restoring software, and transferring files.

5 parts · 27 practice questions

Password recovery

On classic Cisco IOS routers, the configuration register controls boot behavior. The common recovery value 0x2142 makes IOS boot without loading the NVRAM startup-config into running-config. It does not erase the saved file. The normal register value is usually 0x2102; check the specific platform because defaults and procedures vary.

Common recovery value
0x2142
Normal register value
0x2102

After gaining privileged access, copy startup-config into running-config to restore the saved settings, then change the enable secret. Merging the saved configuration can leave interfaces administratively shut down; enter the interface and use no shutdown on each interface that should operate. Exit interface configuration mode before setting the register back to 0x2102, save the recovered running configuration to startup-config, and only then reload. Saving before restoring the register preserves the new credential and recovered settings.

Some Catalyst models, including Catalyst 3650, use the Mode button during startup to enter password recovery. The procedure is model-specific and may bypass or rename the saved configuration file; it is not a universal factory reset and does not inherently download IOS. Follow the exact switch model procedure and preserve configuration files.

IOS XE
Router# copy startup-config running-config
Router(config)# enable secret <new-secret>
Router(config)# interface <interface-id>
Router(config-if)# no shutdown
Router(config-if)# end
Router(config)# config-register 0x2102
Router# copy running-config startup-config
Router# show version
Practice this part:CCNA: Password Recovery (5)
References (3)

Configuration-register troubleshooting

On classic Cisco IOS routers, use show version to inspect the configuration register and its next-reload value. The register is a 16-bit value; bit 6 (0x0040) controls whether startup-config is ignored, so 0x2142 skips loading the NVRAM configuration but does not erase it. Cisco documents 0x2102 as the factory default for the cited router platform and as the default on most platforms, but check the specific hardware. Catalyst 9000 switches running IOS XE use different commands for equivalent boot behavior; config-register is ineffective there. For these switches, system ignore startupconfig switch {all|<1-8>} controls startup-config bypass.

Register size
16-bit value
Bit controlling startup-config ignore
bit 6 (0x0040)
Startup-config bypass value
0x2142
Factory default
0x2102

On classic IOS routers, when IOS is running, set the next boot value from global configuration with config-register 0x2102. The ROMMON confreg command is for the ROM monitor when IOS is unavailable. If a reload asks whether to save modified configuration while running-config is blank because startup-config was skipped, answer no: yes would overwrite the preserved startup-config with the blank configuration. A configured value may appear as the current value with the new value in parentheses until reload. Catalyst 9000 switches running IOS XE do not use config-register; use their documented equivalent boot commands instead.

If the startup-config is missing but a valid file such as live-config remains in flash, inspect it with more first. Copying that file to running-config applies its commands as a merge: incoming matching settings take precedence, while settings absent from the file can remain. Save the result to startup-config so it survives reboot.

IOS XE
Router# show version
Router(config)# config-register 0x2102
Router# reload
System configuration has been modified. Save? [yes/no]: no
Router# more flash:live-config
Router# copy flash: running-config
Source filename? live-config
Router# write memory
References (3)

Back up configurations and manage IOS images

The copy command reads source first and writes destination second. Therefore copy startup-config tftp: sends the saved NVRAM configuration to a TFTP server. Copying a server file into running-config applies the commands as a merge, as if entered at the CLI: incoming commands take precedence where they match, but unrelated existing settings can remain. Copying a server file to startup-config replaces that saved file, and reloading applies the replacement. Review the file first and confirm the intended device will boot it.

Before transferring a new IOS image, inspect flash storage and available capacity with show flash (or the platform's documented dir command). A successful file copy alone does not ensure the device will boot that image. Configure the platform-appropriate boot system target and save boot settings. Catalyst IOS XE install-mode devices commonly boot packages.conf, so use the upgrade procedure for that model and mode rather than assuming a standalone image filename.

For FTP, ip ftp username and ip ftp password set default credentials for copy operations. Credentials can instead be supplied in the copy URL, and IOS may attempt anonymous FTP when no username is configured. The remote account must exist on the server when using account credentials. TFTP does not use FTP credentials.

IOS XE
Router# copy startup-config tftp:
Router# copy tftp: running-config
Router# copy tftp: startup-config
Router# show flash
Router(config)# boot system flash:<image-filename>
Router# copy running-config startup-config
Router(config)# ip ftp username <server-user>
Router(config)# ip ftp password <server-password>
Router# copy ftp: flash:
References (3)

Restore IOS images from ROMMON

On Cisco 850 and 870 routers, when IOS cannot boot, the ROMMON tftpdnld command downloads an image from TFTP to flash for disaster recovery. Cisco warns this procedure erases all existing flash data before downloading. Its variables and effects are platform-specific, so verify the exact model instructions before using it.

Before running it, set all required, case-sensitive ROMMON variables: IP_ADDRESS for the router's temporary address, IP_SUBNET_MASK for its subnet, DEFAULT_GATEWAY for routing off subnet, TFTP_SERVER for the server address, and TFTP_FILE for the exact image filename. Check spelling, filename case, addressing, server reachability and the platform's supported physical recovery port. Then run tftpdnld and confirm only after checking the displayed values and warning.

After the download completes, reset the router. Confirm IOS starts normally, check the running image and configuration, and test reachability to expected hosts such as the TFTP server and neighboring devices with ping. A prompt returning to ROMMON means IOS did not boot successfully; check the downloaded file, boot selection and platform recovery instructions.

IOS XE
rommon> IP_ADDRESS=<router-ip>
rommon> IP_SUBNET_MASK=<subnet-mask>
rommon> DEFAULT_GATEWAY=<gateway-ip>
rommon> TFTP_SERVER=<server-ip>
rommon> TFTP_FILE=<exact-image-filename>
rommon> set
rommon> tftpdnld
rommon> reset
Router# show version
Router# ping <expected-host>
References (2)

Secure file transfer and image integrity

SCP uses SSH to authenticate and encrypt the file-transfer session. Cisco IOS XE documentation lists TCP port 22 as the default SCP port, though it can be changed. SFTP is a distinct file-transfer protocol introduced with SSHv2. Support varies by platform and release. For example, Catalyst 9400 IOS XE 17.18 supports SFTP client functionality but not an SFTP server, while Catalyst Embedded Wireless Controller fixes its SFTP image-download port at 22. Cisco warns that TFTP provides no confidentiality or integrity protection. FTP is unencrypted and sends data and credentials in plaintext. Do not send configurations containing secrets over untrusted TFTP or FTP networks.

Default SCP port
TCP port 22
SFTP introduction
SSHv2
SFTP image-download port
22

IOS can copy a running configuration to an SCP server using a scp:// URL. For example, the URL identifies the remote account, server address and destination filename; IOS prompts for the password when it is not supplied. To make an IOS device an SCP server, enable SSH and SCP, and configure AAA authentication and exec authorization so it can authenticate users and determine whether they may access an EXEC session.

For the default RSA key workflow, configure a hostname and an IP domain name before crypto key generate rsa. A named key pair is an exception to that prerequisite. Select SSH version 2 with ip ssh version 2 where supported. To check a downloaded image, calculate its MD5 hash with verify /md5 and compare it with Cisco's published value for that exact image. A mismatch means the file may be corrupt or the expected value may be wrong; resolve the mismatch before booting it.

IOS XE
Router# copy running-config scp://[email protected]/r1-config.txt
Router(config)# hostname router1
Router(config)# ip domain-name example.com
Router(config)# crypto key generate rsa
Router(config)# ip ssh version 2
Router(config)# ip scp server enable
Router# verify /md5 flash:image.bin <published-md5>
References (9)

Check your understanding

IOS maintenance: password recovery, configuration register, backups, image restore and secure file transfer

All 5 sections · no timer

Unlimited retries

Questions from every section are combined into one assessment. Answer them all correctly to complete the article.

Your completion saves in this browser. Sign in to sync it to your account.