Courseiva
SystemPrivileged EXEC

copy flash: tftp:

Copies a file from the router's flash memory to a TFTP server, used for backing up IOS images or configuration files.

Definition: copy flash: tftp: is a Cisco IOS privileged exec command. Copies a file from the router's flash memory to a TFTP server, used for backing up IOS images or configuration files.

Overview

The `copy flash: tftp:` command is a fundamental IOS tool used to transfer files from the router's flash memory to a TFTP server. This command is essential for backing up IOS images, configuration files, or other critical system files to a remote server, ensuring that a router can be restored to a known working state after a failure or upgrade. The underlying concept is the Trivial File Transfer Protocol (TFTP), a lightweight, connectionless UDP-based protocol (port 69) that provides simple file transfer without authentication or directory browsing.

TFTP is chosen over FTP or SCP in many network environments because of its simplicity and low overhead, making it ideal for bootstrapping devices or performing quick backups in controlled, trusted networks. Network engineers reach for this command when they need to preserve a current IOS image before an upgrade, archive a startup configuration, or copy a new image to multiple routers via a central TFTP server. It fits into a broader workflow of change management: before any major software upgrade, a prudent engineer backs up the existing IOS and configuration using this command.

After the upgrade, the same command can be used to restore the previous image if issues arise. Important IOS behaviors: the command operates in privileged EXEC mode (enable), and the router must have IP connectivity to the TFTP server. The command prompts for the source filename (from flash) and the destination filename on the TFTP server.

If the destination file already exists, the router will prompt for confirmation to overwrite. The transfer is buffered; the router reads the file from flash in blocks and sends them via TFTP. There is no impact on the running configuration; the command only affects stored files.

The command can also be used to copy files from flash to other destinations like FTP or RCP, but the TFTP variant is most common due to its simplicity. A key consideration is that TFTP lacks security; in production networks, engineers often prefer SCP or FTP with authentication, but TFTP remains widely used in lab and isolated management networks. Understanding this command is crucial for CCNA and CCNP candidates as it appears in troubleshooting scenarios and is a staple of router maintenance.

Syntax·Privileged EXEC
copy flash: tftp:

When to Use This Command

  • Backing up the current IOS image before upgrading to a new version
  • Transferring a configuration file to a TFTP server for archival
  • Copying a crashinfo file to a TFTP server for troubleshooting
  • Saving a backup of the startup configuration to a remote server

Parameters

ParameterSyntaxDescription
source-urlflash:filenameSpecifies the source file location in flash memory. Use the format 'flash:' followed by the filename (e.g., flash:c2960-lanbasek9-mz.150-2.SE.bin). Common mistake: omitting the colon after 'flash' or using an incorrect path if the file is in a subdirectory.
destination-urltftp://server-ip/filenameSpecifies the TFTP server IP address and the destination filename. The format is 'tftp://' followed by the server IP, a slash, and the desired filename (e.g., tftp://192.168.1.100/c2960-backup.bin). Common mistake: forgetting the trailing slash before the filename or using an unreachable IP address.

Command Examples

Backup IOS image to TFTP server

copy flash: tftp: Source filename []? c2960-lanbasek9-mz.150-2.SE11.bin Address or name of remote host []? 192.168.1.100 Destination filename [c2960-lanbasek9-mz.150-2.SE11.bin]? Writing c2960-lanbasek9-mz.150-2.SE11.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 12345678 bytes]
Source filename []? c2960-lanbasek9-mz.150-2.SE11.bin
Address or name of remote host []? 192.168.1.100
Destination filename [c2960-lanbasek9-mz.150-2.SE11.bin]? 

Writing c2960-lanbasek9-mz.150-2.SE11.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 12345678 bytes]

Prompts for source filename (the file in flash), TFTP server IP, and destination filename (default same as source). Exclamation marks indicate successful blocks transferred. 'OK' confirms completion with total bytes.

Copy startup-config to TFTP server

copy flash: tftp: Source filename []? startup-config Address or name of remote host []? 10.0.0.1 Destination filename [startup-config]? router1-startup-config Writing startup-config...!! [OK - 2145 bytes]
Source filename []? startup-config
Address or name of remote host []? 10.0.0.1
Destination filename [startup-config]? router1-startup-config

Writing startup-config...!!
[OK - 2145 bytes]

Specifies 'startup-config' as source (a file in flash). Destination renamed to 'router1-startup-config'. Two exclamation marks indicate quick transfer. Output shows file size (2145 bytes).

Understanding the Output

The output begins with prompts for source filename, TFTP server IP, and destination filename. After entering the information, the transfer starts. Exclamation marks (!) indicate successful data block transfers; each typically represents 512 bytes.

If the transfer fails, you may see 'Timeout' or 'Error' messages. The final line shows '[OK - <bytes>]' on success, or 'FAILED' on failure. Watch for 'Permission denied' if the TFTP server lacks write permissions, or 'File not found' if the source file doesn't exist in flash.

Configuration Scenarios

Backup IOS Image Before Upgrade

A network engineer needs to upgrade the IOS on a Cisco 4321 router from version 16.9 to 16.12. To ensure a fallback option, the current IOS image must be copied to a TFTP server before the upgrade.

Topology

R1(Gi0/0/0)---192.168.1.0/24---TFTP Server (192.168.1.100)

Steps

  1. 1.Step 1: Verify connectivity to the TFTP server: Router# ping 192.168.1.100
  2. 2.Step 2: Verify the current IOS image filename: Router# show flash | include .bin
  3. 3.Step 3: Copy the IOS image to the TFTP server: Router# copy flash:isr4300-universalk9.16.09.03.SPA.bin tftp://192.168.1.100/
  4. 4.Step 4: Confirm the destination filename when prompted (press Enter to accept default or type a new name).
  5. 5.Step 5: Verify the transfer completed successfully: Router# show flash | include .bin (check file size) and check TFTP server for the file.
Configuration
! No configuration changes needed; command is executed in privileged EXEC mode.
Router# copy flash:isr4300-universalk9.16.09.03.SPA.bin tftp://192.168.1.100/
Destination filename [isr4300-universalk9.16.09.03.SPA.bin]? 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<output omitted>
[OK - 123456789 bytes]

Verify: Router# show flash: displays the file list; the original file should still be present. On the TFTP server, verify the file exists with the expected size.

Watch out: Ensure the TFTP server is running and reachable. If the server uses a different port (default 69), the command will fail. Also, ensure there is enough disk space on the TFTP server.

Backup Startup Configuration to TFTP

After making critical configuration changes on a router, the engineer wants to back up the startup configuration to a TFTP server for disaster recovery.

Topology

R1(Gi0/0)---10.10.10.0/24---TFTP Server (10.10.10.5)

Steps

  1. 1.Step 1: Ensure the startup configuration is saved: Router# copy running-config startup-config
  2. 2.Step 2: Verify connectivity to TFTP server: Router# ping 10.10.10.5
  3. 3.Step 3: Copy the startup configuration: Router# copy startup-config tftp://10.10.10.5/
  4. 4.Step 4: When prompted, enter the destination filename (e.g., R1-startup-config).
  5. 5.Step 5: Verify the file on the TFTP server and optionally restore it later using 'copy tftp: startup-config'.
Configuration
! No configuration changes needed.
Router# copy startup-config tftp://10.10.10.5/
Address or name of remote host [10.10.10.5]? 
Destination filename [router-confg]? R1-startup-config
!!
[OK - 1234 bytes]

Verify: Router# show startup-config (still present). On the TFTP server, check for the file R1-startup-config.

Watch out: The startup-config file is stored in NVRAM; if the router is rebooted before the backup, the configuration may be lost. Always save the running-config first. Also, ensure the TFTP server has write permissions.

Troubleshooting with This Command

When using `copy flash: tftp:`, healthy output shows a series of exclamation marks (!) indicating successful packet transfers, followed by a message like '[OK - <bytes>]'. Problem indicators include timeout messages, 'Error opening tftp://...' (server unreachable or file permission issues), or 'Invalid input detected' (syntax error). Focus on the TFTP server reachability and the source filename.

Common symptoms: 'Timeout' suggests the server is not responding; check IP connectivity and firewall rules (UDP port 69). 'File not found' means the source filename in flash is incorrect; use `show flash:` to list files. 'Permission denied' indicates the TFTP server lacks write access to the target directory.

A diagnostic flow: 1) Ping the TFTP server from the router. 2) Verify the source file exists with `show flash:`. 3) Check the TFTP server logs. 4) Try a simpler file (e.g., a small config) to isolate issues. 5) If using a Windows TFTP server, ensure the service is running and the directory is shared. Correlate with `debug ip tftp` to see packet exchanges (use with caution in production). If the transfer starts but fails midway, check for network congestion or flash corruption.

The command's output can be combined with `show file systems` to verify flash space. In scenarios where TFTP fails, consider using FTP or SCP as alternatives. For CCNA/CCNP, understanding these troubleshooting steps is critical for lab and exam scenarios.

CCNA Exam Tips

1.

CCNA 200-301: The 'copy flash: tftp:' command is used to back up IOS images; remember that the TFTP server must be reachable and have write permissions.

2.

CCNA 200-301: You must be in privileged EXEC mode (enable) to use this command; user EXEC mode will not work.

3.

CCNA 200-301: The source file must exist in flash; use 'dir flash:' to verify before copying.

4.

CCNA 200-301: If the destination filename is omitted, it defaults to the source filename; this can overwrite an existing file on the TFTP server.

Common Mistakes

Mistake 1: Forgetting to specify the correct source filename — the command will prompt, but if you mistype, it will fail with 'File not found'.

Mistake 2: Using an unreachable TFTP server IP — the copy will timeout after several retries, wasting time.

Mistake 3: Not ensuring the TFTP server has write permissions — the transfer will start but fail with 'Error opening file' or 'Permission denied'.

copy flash: tftp: vs archive log config

These two commands are often compared because they both contribute to configuration management: 'copy flash: tftp:' backs up configuration or IOS files to an external server, while 'archive log config' logs configuration changes locally for auditing. They serve complementary roles in ensuring network reliability and accountability.

Aspectcopy flash: tftp:archive log config
ScopeSingle file transfer operationGlobal configuration logging framework
Configuration modePrivileged EXEC#Global Configuration (config)#
PersistenceNot saved; one-time executionPersistent; stored in running-config
EffectCopies file from flash to TFTP serverEnables logging of all configuration changes
Typical useBacking up IOS image or startup-config to TFTPAuditing config changes for troubleshooting/security

Use copy flash: tftp: when you need to back up an IOS image or configuration file to an external TFTP server for recovery or distribution.

Use archive log config when you need to track and audit configuration changes made to the device over time.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the command syntax is identical, but the flash file system may be named 'flash0:' or 'flash1:' on dual-slot platforms. Use `show file systems` to confirm. On NX-OS (e.g., Nexus switches), the equivalent command is `copy bootflash: tftp:` or `copy <source> tftp:`.

The syntax is similar: `copy bootflash:filename tftp://server/filename`. NX-OS also supports `copy running-config tftp:` for configuration backup. On ASA firewalls, the command is `copy flash: tftp:` but the flash is often referred to as 'disk0:' or 'disk1:'.

The ASA uses a different file system structure; use `show file system` to list available devices. In IOS-XR (e.g., ASR 9000), the command is `copy harddisk: tftp:` or `copy compactflash: tftp:`. IOS-XR requires the source to be a file system like 'harddisk:' or 'compactflash:'.

The command behavior is similar but prompts for source and destination. Across versions, IOS 12.x and 15.x behave identically for this command; IOS 16.x (IOS-XE) adds support for HTTPS and SCP but TFTP remains unchanged. Always verify the file system name with `show file systems` before using the command.

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions