![]() |
Cisco IOS Configuration Fundamentals Command Reference
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C commands
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contents
C commands cdTo change the default directory or file system, use the cd command in user EXEC or privileged EXEC mode. Command DefaultThe initial default file system is flash:. For platforms that do not have a physical device named flash:, the keyword flash: is aliased to the default Flash device. For the Supervisor Engine, the initial default file system is disk0 : If you do not specify a directory on a file system, the default is the root directory on that file system. Command History
Usage GuidelinesThe valid values for filesystem :are as follows:
For all EXEC commands that have an optional filesystemargument, the system uses the file system specified by the cd command when you omit the optional filesystemargument. For example, the dircommand, which displays a list of files on a file system, contains an optional filesystemargument. When you omit this argument, the system lists the files on the file system specified by the cd command. If you do not specify a directory on a file system, the default is the root directory on that file system. ExamplesIn the following example, the cd command is used to set the default file system to the Flash memory card inserted in slot 0: Router# pwd bootflash:/ Router# cd slot0: Router# pwd slot0:/ Cisco 7600 SeriesThis example sets the default file system to the Flash PC card that is inserted in disk 0: Router# cd disk0: Router# pwd disk0:/ Related Commands
clear archive log configTo purge the configuration logging database entries, use the clear archive log configcommand in privileged EXEC mode. Syntax Description
Command History
Usage GuidelinesWhen the clear archive log configcommand is entered, only the entries in the configuration logging database file are deleted. The file itself is not deleted; it will be used in the future to log new entries as they occur. clear catalyst6000 traffic-meterclear configuration lockTo clear the lock on the running configuration file, use the clear configuration lockcommand in privileged EXEC mode. Command History
ExamplesThe following is sample output from the clear configuration lockcommand when the running configuration file is not locked by the configure replace command:
Router# clear configuration lock
Parser Config not locked.
The following is sample output from the clear configuration lockcommand when the running configuration file is locked by the configure replace command: Router# clear configuration lock Process <3> is holding the EXCLUSIVE lock ! Do you want to clear the lock?[confirm] y The following example shows how to use the clear configuration lock command to display the owner or process ID of the lock and prompt the user for confirmation: Router# clear configuration lock Process <46> is holding the EXCLUSIVE lock. Do you want to clear the lock?[confirm] y After the lock is cleared, a message will be sent to the terminal if the owner of the lock is a TTY user: Router(config)# The configuration lock was cleared by user <steve> from terminal <5> Related Commands
clear diagnostic event-logTo clear the diagnostic event logs for a specific module or event type, use the clear diagnostic event-logcommand in privileged EXEC mode.
clear
diagnostic
event-log
{event-type {error | info | warning} | module {num | slot subslot | all}}
Usage GuidelinesThe clear diagnostic event-log command clears all the events for all the modules. The clear diagnostic event-log module num command clears events only for a specific module. The clear diagnostic event-log event-typecommand clears only specific event types such as error, informative, or warning events. ExamplesThis example shows how to clear error event logs:
Router# clear diagnostic event-log event-type error
This example shows how to clear event logs on module 3:
Router# clear diagnostic event-log module 3
This example shows how to clear error event logs on all the modules:
Router# clear diagnostic event-log module all
clear ip http client cacheTo remove information from the HTTP client cache, use the clear ip http client cache command in privileged EXEC mode. Syntax Description
Usage GuidelinesUse this command to clear entries from the HTTP client cache pool: all the entries, all the entries owned by a specific session, or only the entry associated with a specific request from an HTTP server. ExamplesThe following example clears all entries in the HTTP client cache:
Router# clear ip http client cache all
The following example removes HTTP client cache entries that belong to the HTTP Client File System (CFS) application:
Router# clear ip http client cache session HTTP CFS
The following example removes HTTP client cache entries at the location http://myrouter.cisco.com/flash:/:
Router# clear ip http client cache url http://myrouter.cisco.com/flash:/
clear loggingUsage GuidelinesThe clear logging persistent command is used to remove stored audit records. This action can be performed by the audit administrator only. The clear logging persistentcommand clears only log files stored in the directory but does not remove the directory itself. If no log URL is not specified for logging, this command clears files from the location as specified in the logging persistent command. ExamplesIn the following example, the logging buffer is cleared:
Router# clear logging
Clear logging buffer [confirm]
The following example shows how to clear persistent logging files: Router# clear logging persistent Delete persistent logging files from bootflash:/audit_log ? [confirm] Router# dir bootflash:/audit_log Directory of bootflash:/audit_log/ No files in directory The following example shows how to clear persistent logging files from a specific directory: Router# clear logging persistent url harddisk:/log-persistant Delete persistent logging files from harddisk:/log-persistent ? [confirm] Router# dir harddisk:/log-persistant Directory of harddisk:////log-persistent/ No files in directory clear logging systemTo clear event records stored in the System Event Archive (SEA) log file sea_log.dat, use the clear logging system command in user EXEC mode. Command History
Usage GuidelinesSEA is supported on switches that have a Supervisor Engine 32 or Supervisor Engine 720 with a compact flash adapter and a Compact Flash card (WS-CF-UPG= for Supervisor Engine 720). Cisco Universal Broadband Router 10012 The SEA feature is used to address debug trace and system console constraints. SEA is a logging feature that allows the modules in the system to report major and critical events to the route processor (RP). The events occurring on the line card or jacket card are also sent to the RP using Inter-Process Communication (IPC) capability. Use the clear logging system command to clear the event records stored in the SEA log file.
clear logging xmlTo clear the contents of the XML system message logging (syslog) buffer, use the clear logging xml command in User EXEC or Priviledged EXEC mode.. Command History
Usage GuidelinesThis command clears the contents of the XML-formatted logging buffer, but does not clear the contents of the standard logging buffer. The system will prompt you to confirm the action before clearing the buffer. clear memory low-water-markTo clear the low-water-mark memory, use the clear memory low-water-markcommand in privilegedEXEC mode. Command History
Usage GuidelinesThis command clears all processor threshold values and the input/output memory threshold values, if any. clear mls statisticsTo reset the Multilayer Switching (MLS) statistics counters, use the clear mls statistics command in privileged EXEC mode. Usage GuidelinesThis command replaces the clear mls stats command, which was introduced on the Supervisor Engine 720 in Cisco IOS Release 12.2(17a)SX, and on the Supervisor Engine 2 in Cisco IOS Release 12.2(17d)SXB. clear parser cacheTo clear the parse cache entries and hit/miss statistics stored for the Parser Cache feature, use the clear parser cachecommand in privileged EXEC mode. Usage GuidelinesThe Parser Cache feature optimizes the parsing (translation and execution) of Cisco IOS software configuration command lines by remembering how to parse recently encountered command lines, decreasing the time required to process large configuration files. The clear parser cache command will free the system memory used by the Parser Cache feature and will erase the hit/miss statistics stored for the output of the show parser statistics EXEC command. This command is only effective when the Parser Cache feature is enabled. ExamplesThe following example shows the clearing of the parser cache: Router# show parser statistics Last configuration file parsed:Number of Commands:1484, Time:820 ms Parser cache:enabled, 1460 hits, 26 misses Router# clear parser cache Router# show parser statistics Last configuration file parsed:Number of Commands:1484, Time:820 ms Parser cache:enabled, 0 hits, 1 misses clear parser statisticsTo clear the parser performance statistics, use the clear parser statisticscommand in privileged EXEC mode. Usage GuidelinesThe clear parser statistics command will free the system memory used for recording parser performance statistics stored for the output of the show parser statistics EXEC command.. ExamplesThe following example shows the clearing parser statistics: Router# show parser statistics Last configuration file parsed: Number of Commands: 1, Time: 31 ms Parser cache: enabled, 129 hits, 46 misses Active startup time: 0 Standby startup time: 186 Copy to running-config time:0 Bulksync time:0 Top 10 slowest command: Function Time (ms) Command 0xE71F90 7 shutdown 0x1235280 11 no ip address 0x1235280 11 no ip address 0x1235280 11 no ip address 0x1235280 11 no ip address 0x1235280 12 no ip address 0x1235280 12 no ip address 0x1235280 12 no ip address 0x1235280 12 no ip address 0xD6C940 6170 show run Parser last bootup cache hits: Bootup hits:125 Bootup misses:43 Bootup clear parser cache:0 Router# clear parser statistics func=E01730, duration=0 cmd= clear parser statistics Router# show parser statistics Last configuration file parsed: Number of Commands: 0, Time: 0 ms Parser cache: enabled, 130 hits, 47 misses Active startup time: 0 Standby startup time: 0 Copy to running-config time:0 Bulksync time:0 Top 10 slowest command: Function Time (ms) Command Parser last bootup cache hits: Bootup hits:0 Bootup misses:0 Bootup clear parser cache:0 clear platform netintclear processes interrupt maskTo clear interrupt mask details for all processes in the interrupt mask buffer, use the clear processes interrupt mask detailcommand in privileged EXEC mode. Usage GuidelinesSee the documentation of the scheduler interrupt mask commands (listed in the Related Commands table) for further details on process interrupt mask profiling. ExamplesThe following example demonstrates how to the clear interrupt mask statistics from system memory for all processes:
Router# clear processes interrupt mask detail
Related Commands
clear scp accountingTo clear the Switch-Module Configuration Protocol (SCP) accounting information, use the clear scp accountingcommand in privilegedEXEC mode. Command History
clear tcpSyntax Description
Usage GuidelinesThe clear tcp command is particularly useful for clearing hung TCP connections. The clear tcp line line-numbercommand terminates the TCP connection on the specified tty line. Additionally, all TCP sessions initiated from that tty line are terminated. The clear tcp local hostname port remote hostname portcommand terminates the specific TCP connection identified by the host name and port pair of the local and remote router. The clear tcp tcb address command terminates the specific TCP connection identified by the TCB address. ExamplesThe following example clears a TCP connection using its tty line number. The show tcp command displays the line number (tty2) that is used in the clear tcp command. Router# show tcp tty2, virtual tty from host router20.cisco.com Connection state is ESTAB, I/O status: 1, unread input bytes: 0 Local host: 171.69.233.7, Local port: 23 Foreign host: 171.69.61.75, Foreign port: 1058 Enqueued packets for retransmit: 0, input: 0, saved: 0 Event Timers (current time is 0x36144): Timer Starts Wakeups Next Retrans 4 0 0x0 TimeWait 0 0 0x0 AckHold 7 4 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 0 0 0x0 iss: 4151109680 snduna: 4151109752 sndnxt: 4151109752 sndwnd: 24576 irs: 1249472001 rcvnxt: 1249472032 rcvwnd: 4258 delrcvwnd: 30 SRTT: 710 ms, RTTO: 4442 ms, RTV: 1511 ms, KRTT: 0 ms minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 300 ms Router# clear tcp line 2 [confirm] [OK] The following example clears a TCP connection by specifying its local router host name and port and its remote router host name and port. The show tcp brief command displays the local (Local Address) and remote (Foreign Address) host names and ports to use in the clear tcp command. Router# show tcp brief TCB Local Address Foreign Address (state) 60A34E9C router1.cisco.com.23 router20.cisco.1055 ESTAB Router# clear tcp local router1 23 remote router20 1055 [confirm] [OK] The following example clears a TCP connection using its TCB address. The show tcp brief command displays the TCB address to use in the clear tcp command. Router# show tcp brief TCB Local Address Foreign Address (state) 60B75E48 router1.cisco.com.23 router20.cisco.1054 ESTAB Router# clear tcp tcb 60B75E48 [confirm] [OK] clear vlan countersTo clear the software-cached counter values to start from zero again for a specified VLAN or all existing VLANs, use the clear vlan counters command in privileged EXEC mode. Usage GuidelinesIf you do not specify a vlan-id; the software-cached counter values for all existing VLANs are cleared. clockTo configure the port clocking mode for the 1000BASE-T transceivers, use the clock command in interface configuration mode. To return to the default settings,use the no form of this command. Usage GuidelinesThis command is supported on the 1000BASE-T transceivers only. If the clock mode of the near end of a link does not match the clock mode of the far end, the line protocol does not come up. The active and passive clock status is determined during the auto negotiation process before the transmission link is established. The clock command supports the following configurations:
Enter the show running-config interface command to display the current clock mode. Enter the show interfaces command to display the clock mode that is negotiated by the firmware. clock initialize nvramTo restart the system clock from the last known system clock value, use the clock initialize nvramcommand in global configuration mode. To disable the restart of the system clock from the last known system clock value, use the no form of this command. Command DefaultBy default, the system clock is set to restart from the last known system clock value for platforms that have no hardware calendar. config-registerTo change the configuration register settings, use the config-register command in global configuration mode. Command DefaultRefer to the documentation for your platform for the default configuration register value. For many newer platforms, the default is 0x2102, which causes the router to boot from Flash memory and the Break key to be ignored. Usage GuidelinesThis command applies only to platforms that use a software configuration register. The lowest four bits of the configuration register (bits 3, 2, 1, and 0) form the boot field. The boot field determines if the router boots manually, from ROM, or from Flash or the network. To change the boot field value and leave all other bits set to their default values, follow these guidelines:
For more information about the configuration register bit settings and default filenames, refer to the appropriate router hardware installation guide. ExamplesIn the following example, the configuration register is set to boot the system image from Flash memory: config-register 0x2102 Related Commands
configure check syntaxCommand History
configuration mode exclusive (Deprecated as of the 15.0S and T releases. It's still available on the M train.)To enable single-user (exclusive) access functionality for the Cisco IOS command-line interface (CLI), use the configuration mode exclusive command in global configuration mode. To disable the single-user access (configuration locking) feature, use the no form of this command.
configuration
mode
exclusive
{auto | manual}
[expire seconds]
[lock-show]
[interleave]
[terminate]
[config-wait seconds]
[retry-wait seconds]
no
configuration
mode
exclusive
Syntax DescriptionCommand History
Usage Guidelines
The configuration mode exclusive command enables the exclusive configuration lock feature. The exclusive configuration lock allows single-user access to configuration modes using single-user configuration mode. While the device configuration is locked, no other users can enter configuration commands. Users accessing the device using the state-full, session-based transports (telnet, Secure Shell (SSH) are able to enter single-user configuration mode. The user enters single-user configuration mode by acquiring the exclusive configuration lock using the configure terminal lock privileged EXEC mode command. The configuration lock is released when the user exits configuration mode by using the end or exit command, or by pressing Ctrl-Z. While a user is in single-user configuration mode, no other users can configure the device. Users accessing Command Line Interface (CLI) options through stateless protocols (that is, the HTTP web-based user interface) cannot access single-user configuration mode. (However, an Application Programming Interface (API) allows the stateless transports to lock the configuration mode, complete its operations, and release the lock.) ExamplesThe following example shows how to configure the configuration file for single-user autoconfiguration mode by using the configuration mode exclusive auto command. Use the configuration terminal command to enter global configuration mode and lock the configuration mode exclusively. After the Cisco IOS configuration mode is locked exclusively, you can verify this configuration by entering the show configuration lockcommand. Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# configuration mode exclusive auto Router(config)# end Router# show running-configuration | include config Building configuration... Current configuration : 2296 bytes configuration mode exclusive auto <========== auto policy Router# configure terminal ? <======== lock option not displayed when in auto policy Router# configure terminal <======= acquires the lock The configuration mode is locked exclusively. The lock is cleared after you exit from configuration mode by entering the end or exitcommand. Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)# show configuration lock Parser Configure Lock --------------------- Owner PID : 3 User : unknown TTY : 0 Type : EXCLUSIVE State : LOCKED Class : EXPOSED Count : 1 Pending Requests : 0 User debug info : configure terminal Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 6 Lock Expiration timer (in Sec) : 593 Router(config)# Router(config)# end <========= releases the lock Router# Router# show configuration lock Parser Configure Lock --------------------- Owner PID : -1 User : unknown TTY : -1 Type : NO LOCK State : FREE Class : unknown Count : 0 Pending Requests : 0 User debug info : Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 0 Lock Expiration timer (in Sec) : 0 The following example shows how to enable the exclusive locking feature in manual mode by using the configuration mode exclusive manual command. Once you have configured manual exclusive mode, you can lock the configuration mode by using the configure terminal lock command. In this mode, the configure terminal command does not automatically lock the parser configuration mode. The lock is cleared after you exit from configuration mode by entering the end or exit command. Router# configure terminal Configuration mode locked exclusively. The lock will be cleared once you exit out of configuration mode using end/exit Enter configuration commands, one per line. End with CNTL/Z. Router(config)# configuration mode exclusive manual Router(config)# end Router# Router# show running-configuration | include configuration Building configuration... Current configuration : 2298 bytes configuration mode exclusive manual <==== 'manual' policy Router# show configuration lock Parser Configure Lock --------------------- Owner PID : -1 User : unknown TTY : -1 Type : NO LOCK State : FREE Class : unknown Count : 0 Pending Requests : 0 User debug info : Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 0 Lock Expiration timer (in Sec) : 0 Router# Router# configure terminal ? lock Lock configuration mode <========= 'lock' option displayed in 'manual' policy Router# configure terminal <============ 'configure terminal' won't acquire lock automatically Enter configuration commands, one per line. End with CNTL/Z. Router(config)# show configuration lock Parser Configure Lock --------------------- Owner PID : -1 User : unknown TTY : -1 Type : NO LOCK State : FREE Class : unknown Count : 0 Pending Requests : 0 User debug info : Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 0 Lock Expiration timer (in Sec) : 0 Router(config)# end Router# show configuration lock Parser Configure Lock --------------------- Owner PID : -1 User : unknown TTY : -1 Type : NO LOCK State : FREE Class : unknown Count : 0 Pending Requests : 0 User debug info : Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 0 Lock Expiration timer (in Sec) : 0 Router# Router# configure Router# configure terminal Router# configure terminal ? lock Lock configuration mode <======= 'lock' option displayed when in 'manual' policy Router# configure terminal lock Router# configure terminal lock <============ acquires exclusive configuration lock Configuration mode is locked exclusively. The lock is cleared after you exit from configuration mode by entering the end or exit command. Enter configuration commands, one per line. End with CNTL/Z. Router(config)# show configuration lock Parser Configure Lock --------------------- Owner PID : 3 User : unknown TTY : 0 Type : EXCLUSIVE State : LOCKED Class : EXPOSED Count : 1 Pending Requests : 0 User debug info : configure terminal lock Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 5 Lock Expiration timer (in Sec) : 594 Router(config)# end <================ 'end' releases exclusive configuration lock Router# show configuration lock Parser Configure Lock --------------------- Owner PID : -1 User : unknown TTY : -1 Type : NO LOCK State : FREE Class : unknown Count : 0 Pending Requests : 0 User debug info : Session idle state : TRUE No of exec cmds getting executed : 0 No of exec cmds blocked : 0 Config wait for show completion : FALSE Remote ip address : Unknown Lock active time (in Sec) : 0 Lock Expiration timer (in Sec) : 0 Router# configure confirmTo confirm replacement of the current running configuration with a saved Cisco IOS configuration file, use the configure confirm command in privileged EXEC mode. Command History
Usage GuidelinesThe configure confirm command is used only if the time seconds keyword and argument of the configure replace command are specified. If the configure confirm command is not entered within the specified time limit, the configuration replace operation is automatically reversed (in other words, the current running configuration file is restored to the configuration state that existed prior to entering the configure replace command). ExamplesThe following example shows the use of the configure replace command with the time seconds keyword and argument. You must enter the configure confirm command within the specified time limit to confirm replacement of the current running configuration file: Router# configure replace nvram:startup-config time 120 This will apply all necessary additions and deletions to replace the current running configuration with the contents of the specified configuration file, which is assumed to be a complete configuration, not a partial configuration. Enter Y if you are sure you want to proceed. ? [no]: Y Total number of passes: 1 Rollback Done Router# configure confirm Related Commands
configure memoryTo configure the system from the system memory, use the configure memory command in privileged EXEC mode. Command History
Usage GuidelinesOn all platforms except Class A Flash file system platforms, this command executes the commands located in the configuration file in NVRAM (the "startup configuration file"). On Class A Flash file system platforms, if you specify the configure memory command, the router executes the commands pointed to by the CONFIG_FILE environment variable. The CONFIG_FILE environment variable specifies the location of the configuration file that the router uses to configure itself during initialization. The file can be located in NVRAM or any of the Flash file systems supported by the platform. When the CONFIG_FILE environment variable specifies NVRAM, the router executes the NVRAM configuration only if it is an entire configuration, not a distilled version. A distilled configuration is one that does not contain access lists. To view the contents of the CONFIG_FILE environment variable, use the show bootvar EXEC command. To modify the CONFIG_FILE environment variable, use the boot config command and then save your changes by issuing the copy system:running-config nvram:startup-config command. ExamplesIn the following example, a router is configured from the configuration file in the memory location pointed to by the CONFIG_FILE environment variable:
Router# configure memory
Related Commands
configure networkThe configure network command was replaced by the copy{rcp| tftp} running-config command in Cisco IOS Release 11.0. To maintain backward compatibility, the configure network command continues to function in Cisco IOS Release 12.2(11)T for most systems, but support for this command may be removed in a future release. The copy{rcp| tftp} running-config command was replaced by the copy {ftp: | rcp: | tftp:}[filename] system: running-config command in Cisco IOS Release 12.1. The copy {ftp: | rcp: | tftp:}[filename] system: running-config command specifies that a configuration file should be copied from a FTP, rcp, or TFTP source to the running configuration. See the description of the copy command in this chapter for more information. configure replaceTo replace the current running configuration with a saved Cisco IOS configuration file, use the configure replace command in privileged EXEC mode. configure replace target-url [nolock] list force ignorecase [revert trigger [error] [timer minutes] | time minutes]
Syntax Description
Command History
Usage GuidelinesWhen configuring more than one keyword option, the following rules apply:
If the current running configuration is replaced with a saved Cisco IOS configuration file that contains commands unaccepted by the Cisco IOS software parser, an error message is displayed listing the commands that were unaccepted. The total number of passes performed in the configuration replace operation is also displayed. In Cisco IOS Release 12.2(25)S, a locking feature for the configuration replace operation was introduced. When the configure replace command is enabled, the Cisco IOS running configuration file is locked by default for the duration of the configuration replace operation. This locking mechanism prevents other users from changing the running configuration while the replace operation is taking place, which might otherwise cause the replace operation to terminate unsuccessfully. You can disable the locking of the running configuration using the configure replace nolock command. The running configuration lock is automatically cleared at the end of the configuration replace operation. It is not expected that you should need to clear the lock manually during the replace operation, but as a protection against any unforeseen circumstances, you can manually clear the lock using the clear configuration lock command. You can also display any locks that may be currently applied to the running configuration using the show configuration lock command. Replacing the Current Running Configuration with a Saved Cisco IOS Configuration FileThe following example shows how to replace the current running configuration with a saved Cisco IOS configuration file named disk0:myconfig. Note that the configure replace command interactively prompts you to confirm the operation.
Router# configure replace disk0:myconfig
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: Y
Total number of passes: 1
Rollback Done
In the following example, the list keyword is specified to display the command lines that were applied during the configuration replace operation:
Router# configure replace disk0:myconfig list
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: Y
!Pass 1
!List of Commands:
no snmp-server community public ro
snmp-server community mystring ro
end
Total number of passes: 1
Rollback Done
Reverting to the Startup Configuration FileThe following example shows how to revert to the Cisco IOS startup configuration file. This example also shows the use of the optional force keyword to override the interactive user prompt.
Router# configure replace nvram:startup-config force
Total number of passes: 1
Rollback Done
Performing a Configuration Replace Operation with the configure confirm CommandThe following example shows the use of the configure replace command with the time seconds keyword and argument. You must enter the configure confirm command within the specified time limit to confirm replacement of the current running configuration file. If the configure confirm command is not entered within the specified time limit, the configuration replace operation is automatically reversed (in other words, the current running configuration file is restored to the configuration state that existed prior to entering the configure replace command). Router# configure replace nvram:startup-config time 120 This will apply all necessary additions and deletions to replace the current running configuration with the contents of the specified configuration file, which is assumed to be a complete configuration, not a partial configuration. Enter Y if you are sure you want to proceed. ? [no]: Y Total number of passes: 1 Rollback Done Router# configure confirm Performing a Configuration Rollback OperationThe following example shows how to make changes to the current running configuration and then roll back the changes. As part of the configuration rollback operation, you must save the current running configuration before making changes to the file. In this example, the archive config command is used to save the current running configuration. Note that the generated output of the configure replace command indicates that only one pass was performed to complete the rollback operation.
You first save the current running configuration in the configuration archive as follows:
Router# archive config
You then enter configuration changes as shown in the following example: Router# configure terminal Router(config)# user netops2 password rain Router(config)# user netops3 password snow Router(config)# exit After making changes to the running configuration file, you might want to roll back these changes and revert to the configuration that existed before the changes were made. The show archive command is used to verify the version of the configuration to be used as a target file. The configure replace command is then used to revert to the target configuration file as shown in the following example: Router# show archive There are currently 1 archive configurations saved. The next archive file will be named disk0:myconfig-2 Archive # Name 0 1 disk0:myconfig-1 <- Most Recent 2 3 4 5 6 7 8 9 10 Router# configure replace disk0:myconfig-1 Total number of passes: 1 Rollback Done Related Commands
configure revertTo cancel the timed rollback and trigger the rollback immediately, or to reset parameters for the timed rollback, use the configure revertcommand in privileged EXEC mode. Syntax Description
Command History
Usage GuidelinesIn order to use the configure revert command to configure a timed rollback, the Configuration Archive functionality must be enable first. The Configuration Archive APIs are used to store the current configuration before applying any changes or rolling back to the previous configuration. In case of multi-user environments, only the user who enabled the timed rollback functionality will have the permission to perform the following operations:
ExamplesThe following example shows how to cancel the timed rollback and revert to the saved configuration immediately: Rourter(config)# archive Router(config-archive)# path disk0:abc Router# configure revert now Related Commands
configure terminal
configure
terminal
Cisco IOS Releases 12.3(14)T and Subsequent Releases:
configure
terminal
[lock]
Cisco IOS Releases 12.2(33)SRC and Subsequent Releases:
configure
terminal
[revert {timer minutes | idle minutes}]
Syntax Description
Command History
Usage GuidelinesUse this command to enter global configuration mode. Note that commands in this mode are written to the running configuration file as soon as you enter them (using the Enter key/Carriage Return). After you enter the configure terminalcommand, the system prompt changes from <router-name># to <router-name>(config)# , indicating that the router is in global configuration mode. To leave global configuration mode and return to privileged EXEC mode, type exit or press Ctrl-Z. To view the changes to the configuration you have made, use the more system:running-config command or show running-config command in user EXEC or privileged EXEC mode. Configuration Locking The first user to enter the configure terminal lockcommand acquires the configuration lock (exclusive configuration mode). ExamplesThe following example shows how to enter global configuration mode and lock the Cisco IOS software in exclusive mode:
Router(config)# configure terminal lock
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Related Commands
confregTo change the configuration register settings while in ROM monitor mode, use the confreg command in ROM monitor mode. Usage GuidelinesNot all versions in the ROM monitor support this command. Refer to your platform documentation for more information on ROM monitor mode. If you use this command without specifying the configuration register value, the router prompts for each bit of the configuration register. The lowest four bits of the configuration register (bits 3, 2, 1, and 0) form the boot field. The boot field determines if the router boots manually, from ROM, or from Flash or the network. To change the boot field value and leave all other bits set to their default values, follow these guidelines:
For more information about the configuration register bit settings and default filenames, refer to the appropriate router hardware installation guide. ExamplesIn the following example, the configuration register is set to boot the system image from Flash memory: confreg 0x210F In the following example, no configuration value is entered, so the system prompts for each bit in the register: rommon 7 > confreg Configuration Summary enabled are: console baud: 9600 boot: the ROM Monitor do you wish to change the configuration? y/n [n]: y enable "diagnostic mode"? y/n [n]: y enable "use net in IP bcast address"? y/n [n]: enable "load rom after netboot fails"? y/n [n]: enable "use all zero broadcast"? y/n [n]: enable "break/abort has effect"? y/n [n]: enable "ignore system config info"? y/n [n]: change console baud rate? y/n [n]: y enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400 [0]: 0 change the boot characteristics? y/n [n]: y enter to boot: 0 = ROM Monitor 1 = the boot helper image 2-15 = boot system [0]: 0 Configuration Summary enabled are: diagnostic mode console baud: 9600 boot: the ROM Monitor do you wish to change the configuration? y/n [n]: You must reset or power cycle for new config to take effect. rommon 8> continue (ROM monitor)Command History
Usage GuidelinesUse this command to return to EXEC mode from ROM monitor mode, to use the system image instead of reloading. On older platforms, the angle bracket (< >) indicates that the router is in ROM monitor mode. On newer platforms, rommon number> is the default ROM monitor prompt. Typically, the router is in ROM monitor mode when you manually load a system image or perform diagnostic tests. Otherwise, the router will most likely never be in this mode.
copyTo copy any file from a source to a destination, use the copy command in privileged EXEC or diagnostic mode. Syntax Description
The exact format of the source and destination URLs varies according to the file or directory location. You may enter either an alias keyword for a particular file or a filename that follows the standard Cisco IOS file system syntax (filesystem :[/filepath ][/filename ]). The table below shows two keyword shortcuts to URLs.
The following tables list URL prefix keywords by file system type. The available file systems will vary by platform. If you do not specify a URL prefix keyword, the router looks for a file in the current directory. The table below lists URL prefix keywords for Special (opaque) file systems.
The table belows lists URL prefix keywords for remote file systems.
The table below lists URL prefix keywords for local writable storage file systems.
Command History
Usage GuidelinesThe fundamental function of the copy command is to allow you to copy a file (such as a system image or configuration file) from one location to another location. The source and destination for the file is specified using a Cisco IOS File System URL, which allows you to specify any supported local or remote file location. The file system being used (such as a local memory source, or a remote server) dictates the syntax used in the command. You can enter on the command line all necessary source- and destination-URL information and the username and password to use, or you can enter the copy command and have the router prompt you for any missing information. For local file systems, two commonly used aliases exist for the system:running-config and nvram:startup-config files; these aliases are running-config and startup-config, respectively.
The entire copying process may take several minutes and differs from protocol to protocol and from network to network. The colon is required after the file system URL prefix keywords (such as flash). In some cases, file system prefixes that did not require colons in earlier software releases are allowed for backwards compatibility, but use of the colon is recommended. In the URL syntax for ftp:, http:, https:, rcp:, scp: and tftp:, the location is either an IP address or a host name. The filename is specified relative to the directory used for file transfers. The following sections contain usage guidelines for the following topics: Understanding Invalid Combinations of Source and Destination Some invalid combinations of source and destination exist. Specifically, you cannot copy:
Understanding Character Descriptions The table below describes the characters that you may see during processing of the copycommand.
Understanding Partitions You cannot copy an image or configuration file to a flash partition from which you are currently running. For example, if partition 1 is running the current system image, copy the configuration file or image to partition 2. Otherwise, the copy operation will fail. You can identify the available flash partitions by entering the show file system EXECcommand. Using rcp The rcp requires a client to send a remote username upon each rcp request to a server. When you copy a configuration file or image between the router and a server using rcp, the Cisco IOS software sends the first valid username it encounters in the following sequence:
For the rcp copy request to process, an account must be defined on the network server for the remote username. If the network administrator of the destination server did not establish an account for the remote username, this command will not run. If the server has a directory structure, the configuration file or image is written to or copied from the directory associated with the remote username on the server. For example, if the system image resides in the home directory of a user on the server, specify that username as the remote username. If you are writing to the server, the rcp server must be properly configured to accept the rcp write request from the user on the router. For UNIX systems, add an entry to the .rhosts file for the remote user on the rcp server. Suppose the router contains the following configuration lines: hostname Rtr1 ip rcmd remote-username User0 If the router IP address translates to Router1.company.com, then the .rhosts file for User0 on the rcp server should contain the following line: Router1.company.com Rtr1 Refer to the documentation for your rcp server for more details. If you are using a personal computer as a file server, the computer must support the remote shell protocol (rsh). Using FTP The FTP protocol requires a client to send a username and password with each FTP request to a remote FTP server. Use the ip ftp username and ip ftp password global configuration commands to specify a default username and password for all copy operations to or from an FTP server. Include the username in the copy command syntax if you want to specify a username for that copy operation only. When you copy a file from the router to a server using FTP, the Cisco IOS software sends the first valid username that it encounters in the following sequence:
The router sends the first valid password in the following list:
The username and password must be associated with an account on the FTP server. If you are writing to the server, the FTP server must be properly configured to accept the FTP write request from the user on the router.
If the server has a directory structure, the configuration file or image is written to or copied from the directory associated with the username on the server. For example, if the system image resides in the home directory of a user on the server, specify that username as the remote username. Refer to the documentation for your FTP server for details on setting up the server. Using HTTP or HTTPS Copying a file to or from a remote HTTP or HTTPS server, to or from a local file system, is performed using the embedded Secure HTTP client that is integrated in Cisco IOS software. The HTTP client is enabled by default. Downloading files from a remote HTTP or HTTPS server is performed using the HTTP client integrated in Cisco IOS software. If a username and password are not specified in the copy command syntax, the system uses the default HTTP client username and password, if configured. When you copy a file from a remote HTTP or HTTPS server, the Cisco IOS software sends the first valid username that it encounters in the following sequence:
The router sends the first valid password in the following list:
Storing Images on Servers Use the copy flash: destination-urlcommand (for example, copy flash: tftp:) to copy a system image or boot image from flash memory to a network server. You can use the copy of the image as a backup copy. Also, you can also use the image backup file to verify that the image in flash memory is the same as that in the original file. Copying from a Server to Flash Memory Use the copy destination-url flash: command (for example, copy tftp: flash:) to copy an image from a server to flash memory. On Class B file system platforms, the system provides an option to erase existing flash memory before writing onto it.
Verifying Images When copying a new image to your router, you should confirm that the image was not corrupted during the copy process. You can verify the integrity of the image in any of the following ways:
Copying a Configuration File from a Server to the Running Configuration Use the copy {ftp: | rcp: | scp: | tftp: running-configcommand to load a configuration file from a network server to the running configuration of the router. (Note that running-config is the alias for the system:running-config keyword.) The configuration will be added to the running configuration as if the commands were typed in the command-line interface (CLI). Thus, the resulting configuration file will be a combination of the previous running configuration and the loaded configuration file, with the loaded configuration file having precedence. You can copy either a host configuration file or a network configuration file. Accept the default value of host to copy and load a host configuration file containing commands that apply to one network server in particular. Enter network to copy and load a network configuration file containing commands that apply to all network servers on a network. Copying a Configuration File from a Server to the Startup Configuration Use the copy {ftp: | rcp: | scp: | tftp:} nvram:startup-configcommand to copy a configuration file from a network server to the router startup configuration. These commands replace the startup configuration file with the copied configuration file. Storing the Running or Startup Configuration on a Server Use the copy system:running-config {ftp: | rcp: | scp: | tftp:} command to copy the current configuration file to a network server using FTP, rcp, scp, or TFTP. Use the copy nvram:startup-config {ftp: | rcp: | scp: | tftp:} command to copy the startup configuration file to a network server. The configuration file copy can serve as a backup copy. Saving the Running Configuration to the Startup Configuration Use the copy system:running-config nvram:startup-config command to copy the running configuration to the startup configuration.
If you issue the copy system:running-config nvram:startup-configcommand from a bootstrap system image, a warning will instruct you to indicate whether you want your previous NVRAM configuration to be overwritten and configuration commands to be lost. This warning does not appear if NVRAM contains an invalid configuration or if the previous configuration in NVRAM was generated by a bootstrap system image. On all platforms except Class A file system platforms, the copy system:running-config nvram:startup-config command copies the currently running configuration to NVRAM. On the Class A flash file system platforms, the copy system:running-config nvram:startup-config command copies the currently running configuration to the location specified by the CONFIG_FILE environment variable. This variable specifies the device and configuration file used for initialization. When the CONFIG_FILE environment variable points to NVRAM or when this variable does not exist (such as at first-time startup), the software writes the current configuration to NVRAM. If the current configuration is too large for NVRAM, the software displays a message and stops executing the command. When the CONFIG_FILE environment variable specifies a valid device other than nvram: (that is, flash:, bootflash:, slot0:, or slot1:), the software writes the current configuration to the specified device and filename, and stores a distilled version of the configuration in NVRAM. A distilled version is one that does not contain access list information. If NVRAM already contains a copy of a complete configuration, the router prompts you to confirm the copy. Using CONFIG_FILE, BOOT, and BOOTLDR Environment Variables For the Class A flash file system platforms, specifications are as follows:
To view the contents of environment variables, use the show bootvar EXEC command. To modify the CONFIG_FILE environment variable, use the boot config global configuration command. To modify the BOOTLDR environment variable, use the boot bootldr global configuration command. To modify the BOOT environment variable, use the boot system global configuration command. To save your modifications, use the copy system:running-config nvram:startup-configcommand. When the destination of a copy command is specified by the CONFIG_FILE or BOOTLDR environment variable, the router prompts you for confirmation before proceeding with the copy. When the destination is the only valid image in the BOOT environment variable, the router also prompts you for confirmation before proceeding with the copy. Using the Copy Command with the Dual RSP Feature The Dual RSP feature allows you to install two Route Switch Processor (RSP) cards in a single router on the Cisco 7507 and Cisco 7513 platforms. On a Cisco 7507 or Cisco 7513 router configured for Dual RSPs, if you copy a file to nvram:startup-configuration with automatic synchronization disabled, the system prompts whether you also want to copy the file to the slave startup configuration. The default answer is yes. If automatic synchronization is enabled, the system automatically copies the file to the slave startup configuration each time you use a copy command with nvram:startup-configuration as the destination. Using the copy command with the ASR1000 Series Routers The copy command is available in both privileged EXEC and diagnostic mode on the Cisco ASR1000 series routers. Because the copycommand is available in diagnostic mode, it can be used to copy all types of files between directories and remote locations even in the event of an IOS failure. Verifying the Integrity of the Image Before It Is Copied ExampleThe following example shows how to specify image verification before copying an image:
Router# copy /verify tftp://10.1.1.1/cisco/c7200-js-mz disk0:
Destination filename [c7200-js-mz]?
Accessing tftp://10.1.1.1/cisco/c7200-js-mz...
Loading cisco/c7200-js-mz from 10.1.1.1 (via FastEthernet0/0):!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 19879944 bytes]
19879944 bytes copied in 108.632 secs (183003 bytes/sec)
Verifying file integrity of disk0:/c7200-js-mz ...................................................
...................................................................................................
...................................................................................................
.......................................Done!
Embedded Hash MD5 :CFA258948C4ECE52085DCF428A426DCD
Computed Hash MD5 :CFA258948C4ECE52085DCF428A426DCD
CCO Hash MD5 :44A7B9BDDD9638128C35528466318183
Signature Verified
Copying an Image from a Server to Flash Memory ExamplesThe following examples use a copy rcp:, copy tftp:, or copy ftp: command to copy an image file from a server to flash memory: Copying an Image from a Server to Flash Memory ExampleThe following example copies a system image named file1 from the remote rcp server with an IP address of 172.16.101.101 to flash memory. On Class B file system platforms, the Cisco IOS software allows you to first erase the contents of flash memory to ensure that enough flash memory is available to accommodate the system image. Router# copy rcp://netadmin@172.16.101.101/file1 flash:file1 Destination file name [file1]? Accessing file 'file1' on 172.16.101.101... Loading file1 from 172.16.101.101 (via Ethernet0): ! [OK] Erase flash device before writing? [confirm] Flash contains files. Are you sure you want to erase? [confirm] Copy 'file1' from server as 'file1' into Flash WITH erase? [yes/no] yes Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...erased Loading file1 from 172.16.101.101 (via Ethernet0): ! [OK - 984/8388608 bytes] Verifying checksum... OK (0x14B3) Flash copy took 0:00:01 [hh:mm:ss] Copying an Image from a Server to a Flash Memory Using Flash Load Helper ExampleThe following example copies a system image into a partition of flash memory. The system will prompt for a partition number only if there are two or more read/write partitions or one read-only and one read/write partition and dual flash bank support in boot ROMs. If the partition entered is not valid, the process terminates. You can enter a partition number, a question mark (?) for a directory display of all partitions, or a question mark and a number (? number) for directory display of a particular partition. The default is the first read/write partition. In this case, the partition is read-only and has dual flash bank support in boot ROM, so the system uses flash Load Helper. Router# copy tftp: flash: System flash partition information: Partition Size Used Free Bank-Size State Copy-Mode 1 4096K 2048K 2048K 2048K Read Only RXBOOT-FLH 2 4096K 2048K 2048K 2048K Read/Write Direct [Type ?<no> for partition directory; ? for full directory; q to abort] Which partition? [default = 2] **** NOTICE **** Flash load helper v1.0 This process will accept the copy options and then terminate the current system image to use the ROM based image for the copy. Routing functionality will not be available during that time. If you are logged in via telnet, this connection will terminate. Users with console access can see the results of the copy operation. ---- ******** ---- Proceed? [confirm] System flash directory, partition 1: File Length Name/status 1 3459720 master/igs-bfpx.100-4.3 [3459784 bytes used, 734520 available, 4194304 total] Address or name of remote host [255.255.255.255]? 172.16.1.1 Source file name? master/igs-bfpx-100.4.3 Destination file name [default = source name]? Loading master/igs-bfpx.100-4.3 from 172.16.1.111: ! Erase flash device before writing? [confirm] Flash contains files. Are you sure? [confirm] Copy 'master/igs-bfpx.100-4.3' from TFTP server as 'master/igs-bfpx.100-4.3' into Flash WITH erase? [yes/no] yes Copying an Image from a Server to a Flash Memory Card Partition ExampleThe following example copies the file c3600-i-mz from the rcp server at IP address 172.23.1.129 to the flash memory card in slot 0 of a Cisco 3600 series router, which has only one partition. As the operation progresses, the Cisco IOS software prompts you to erase the files on the flash memory PC card to accommodate the incoming file. This entire operation takes 18 seconds to perform, as indicated at the end of the example. Router# copy rcp: slot0: PCMCIA Slot0 flash Partition Size Used Free Bank-Size State Copy Mode 1 4096K 3068K 1027K 4096K Read/Write Direct 2 4096K 1671K 2424K 4096K Read/Write Direct 3 4096K 0K 4095K 4096K Read/Write Direct 4 4096K 3825K 270K 4096K Read/Write Direct [Type ?<no> for partition directory; ? for full directory; q to abort] Which partition? [default = 1] PCMCIA Slot0 flash directory, partition 1: File Length Name/status 1 3142288 c3600-j-mz.test [3142352 bytes used, 1051952 available, 4194304 total] Address or name of remote host [172.23.1.129]? Source file name? /tftpboot/images/c3600-i-mz Destination file name [/tftpboot/images/c3600-i-mz]? Accessing file '/tftpboot/images/c3600-i-mz' on 172.23.1.129... Connected to 172.23.1.129 Loading 1711088 byte file c3600-i-mz: ! [OK] Erase flash device before writing? [confirm] Flash contains files. Are you sure you want to erase? [confirm] Copy '/tftpboot/images/c3600-i-mz' from server as '/tftpboot/images/c3600-i-mz' into Flash WITH erase? [yes/no] yes Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased Connected to 172.23.1.129 Loading 1711088 byte file c3600-i-mz: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Verifying checksum... OK (0xF89A) Flash device copy took 00:00:18 [hh:mm:ss] Saving a Copy of an Image on a Server ExamplesThe following examples use copy commands to copy image files to a server for storage: Copy an Image from Flash Memory to an rcp Server ExampleThe following example copies a system image from flash Memory to an rcp server using the default remote username. Because the rcp server address and filename are not included in the command, the router prompts for it. Router# copy flash: rcp: IP address of remote host [255.255.255.255]? 172.16.13.110 Name of file to copy? gsxx writing gsxx - copy complete Copy an Image from Flash Memory to an SSH Server Using scp ExampleThe following example shows how to use scp to copy a system image from flash memory to a server that supports SSH:
Router# copy flash:c4500-ik2s-mz.scp scp://user1@host1/
Address or name of remote host [host1]?
Destination username [user1]?
Destination filename [c4500-ik2s-mz.scp]?
Writing c4500-ik2s-mz.scp
Password:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Before you can use the server-side functionality, SSH, authentication, and authorization must be properly configured so the router can determine whether a user is at the right privilege level. The scp server-side functionality is configured with the ip scp server enable command. Copy an Image from a Partition of Flash Memory to a Server ExampleThe following example copies an image from a particular partition of flash memory to an rcp server using a remote username of netadmin1. The system will prompt if there are two or more partitions. If the partition entered is not valid, the process terminates. You have the option to enter a partition number, a question mark (?) for a directory display of all partitions, or a question mark and a number (? number) for a directory display of a particular partition. The default is the first partition. Router# configure terminal Router# ip rcmd remote-username netadmin1 Router# end Router# copy flash: rcp: System flash partition information: Partition Size Used Free Bank-Size State Copy-Mode 1 4096K 2048K 2048K 2048K Read Only RXBOOT-FLH 2 4096K 2048K 2048K 2048K Read/Write Direct [Type ?<number> for partition directory; ? for full directory; q to abort] Which partition? [1] 2 System flash directory, partition 2: File Length Name/status 1 3459720 master/igs-bfpx.100-4.3 [3459784 bytes used, 734520 available, 4194304 total] Address or name of remote host [ABC.CISCO.COM]? Source file name? master/igs-bfpx.100-4.3 Destination file name [master/igs-bfpx.100-4.3]? Verifying checksum for 'master/igs-bfpx.100-4.3' (file # 1)... OK Copy 'master/igs-bfpx.100-4.3' from Flash to server as 'master/igs-bfpx.100-4.3'? [yes/no] yes !!!!... Upload to server done Flash copy took 0:00:00 [hh:mm:ss] Copying an Image from a Flash Memory File System to an FTP Server ExampleThe following example copies the file c3600-i-mz from partition 1 of the flash memory card in slot 0 to an FTP server at IP address 172.23.1.129: Router# show slot0: partition 1 PCMCIA Slot0 flash directory, partition 1: File Length Name/status 1 1711088 c3600-i-mz [1711152 bytes used, 2483152 available, 4194304 total] Router# copy slot0:1:c3600-i-mz ftp://myuser:mypass@172.23.1.129/c3600-i-mz Verifying checksum for '/tftpboot/cisco_rules/c3600-i-mz' (file # 1)... OK Copy '/tftpboot/cisco_rules/c3600-i-mz' from Flash to server as 'c3700-i-mz'? [yes/no] yes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Upload to server done Flash device copy took 00:00:23 [hh:mm:ss] Copying an Image from Boot Flash Memory to a TFTP Server ExampleThe following example copies an image from boot flash memory to a TFTP server: Router# copy bootflash:file1 tftp://192.168.117.23/file1 Verifying checksum for 'file1' (file # 1)... OK Copy 'file1' from Flash to server as 'file1'? [yes/no]y !!!!... Upload to server done Flash copy took 0:00:00 [hh:mm:ss] Copying a Configuration File from a Server to the Running Configuration ExampleThe following example copies and runs a configuration filename host1-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101: Router# copy rcp://netadmin1@172.16.101.101/host1-confg system:running-config Configure using host1-confg from 172.16.101.101? [confirm] Connected to 172.16.101.101 Loading 1112 byte file host1-confg:![OK] Router# %SYS-5-CONFIG: Configured from host1-config by rcp from 172.16.101.101 Copying a Configuration File from a Server to the Startup Configuration ExampleThe following example copies a configuration file host2-confg from a remote FTP server to the startup configuration. The IP address is 172.16.101.101, the remote username is netadmin1, and the remote password is ftppass. Router# copy ftp://netadmin1:ftppass@172.16.101.101/host2-confg nvram:startup-config Configure using rtr2-confg from 172.16.101.101?[confirm] Connected to 172.16.101.101 Loading 1112 byte file rtr2-confg:![OK] [OK] Router# %SYS-5-CONFIG_NV:Non-volatile store configured from rtr2-config by FTP from 172.16.101.101 Copying the Running Configuration to a Server ExampleThe following example specifies a remote username of netadmin1. Then it copies the running configuration file named rtr2-confg to the netadmin1 directory on the remote host with an IP address of 172.16.101.101. Router# configure terminal Router(config)# ip rcmd remote-username netadmin1 Router(config)# end Router# copy system:running-config rcp: Remote host[]? 172.16.101.101 Name of configuration file to write [Rtr2-confg]? Write file rtr2-confg on host 172.16.101.101?[confirm] Building configuration...[OK] Connected to 172.16.101.101 Copying the Startup Configuration to a Server ExampleThe following example copies the startup configuration to a TFTP server: Router# copy nvram:startup-config tftp: Remote host[]? 172.16.101.101 Name of configuration file to write [rtr2-confg]? <cr> Write file rtr2-confg on host 172.16.101.101?[confirm] <cr> ![OK] Saving the Current Running Configuration ExampleThe following example copies the running configuration to the startup configuration. On a Class A flash file system platform, this command copies the running configuration to the startup configuration specified by the CONFIG_FILE variable. copy system:running-config nvram:startup-config The following example shows the warning that the system provides if you try to save configuration information from bootstrap into the system:
Router(boot)# copy system:running-config nvram:startup-config
Warning: Attempting to overwrite an NVRAM configuration written
by a full system image. This bootstrap software does not support
the full configuration command set. If you perform this command now,
some configuration commands may be lost.
Overwrite the previous NVRAM configuration?[confirm]
Enter no to escape writing the configuration information to memory. Moving Configuration Files to Other Locations ExamplesOn some routers, you can store copies of configuration files on a flash memory device. Five examples follow: Copying the Startup Configuration to a Flash Memory Device ExampleThe following example copies the startup configuration file (specified by the CONFIG_FILE environment variable) to a flash memory card inserted in slot 0:
Router# copy nvram:startup-config slot0:router-confg
Copying the Running Configuration to a Flash Memory Device ExampleThe following example copies the running configuration from the router to the flash memory PC card in slot 0:
Router# copy system:running-config slot0:berlin-cfg
Building configuration...
5267 bytes copied in 0.720 secs
Copying to the Running Configuration from a Flash Memory Device ExampleThe following example copies the file named ios-upgrade-1 from the flash memory card in slot 0 to the running configuration: Router# copy slot0:4:ios-upgrade-1 system:running-config Copy 'ios-upgrade-1 ' from flash device as 'running-config' ? [yes/no] yes Copying to the Startup Configuration from a Flash Memory Device ExampleThe following example copies the router-image file from the flash memory to the startup configuration:
Router# copy flash:router-image nvram:startup-config
Copying a Configuration File from one Flash Device to Another ExampleThe following example copies the file running-config from the first partition in internal flash memory to the flash memory PC card in slot 1. The checksum of the file is verified, and its copying time of 30 seconds is displayed. Router# copy flash: slot1: System flash Partition Size Used Free Bank-Size State Copy Mode 1 4096K 3070K 1025K 4096K Read/Write Direct 2 16384K 1671K 14712K 8192K Read/Write Direct [Type ?<no> for partition directory; ? for full directory; q to abort] Which partition? [default = 1] System flash directory, partition 1: File Length Name/status 1 3142748 dirt/images/mars-test/c3600-j-mz.latest 2 850 running-config [3143728 bytes used, 1050576 available, 4194304 total] PCMCIA Slot1 flash directory: File Length Name/status 1 1711088 dirt/images/c3600-i-mz 2 850 running-config [1712068 bytes used, 2482236 available, 4194304 total] Source file name? running-config Destination file name [running-config]? Verifying checksum for 'running-config' (file # 2)... OK Erase flash device before writing? [confirm] Flash contains files. Are you sure you want to erase? [confirm] Copy 'running-config' from flash: device as 'running-config' into slot1: device WITH erase? [yes/no] yes Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased ! [OK - 850/4194304 bytes] Flash device copy took 00:00:30 [hh:mm:ss] Verifying checksum... OK (0x16) Copying a File from a Remote Web Server ExamplesIn the following example, the file config1 is copied from a remote server to flash memory using HTTP: Router# copy http:// www.example.com:8080/configs/config1 flash:config1 In the following example, a default username and password for HTTP Client communications is configured, and then the file sample.scr is copied from a secure HTTP server using HTTPS: Router# configure terminal Router(config)# ip http client username joeuser Router(config)# ip http client password letmein Router(config)# end Router# copy https://www.example_secure.com/scripts/sample.scr flash: In the following example, an HTTP proxy server is specified before using the copy http:// command: Router# configure terminal Router(config)# ip http client proxy-server edge2 proxy-port 29 Router(config)# end Router# copy http:// www.example.com/configs/config3 flash:/configs/config3 Copying an Image from the Master RSP Card to the Slave RSP Card ExampleThe following example copies the router-image file from the flash memory card inserted in slot 1 of the master RSP card to slot 0 of the slave RSP card in the same router:
Router# copy slot1:router-image slaveslot0:
Related Commands
copy erase flashThe copy erase flash command has been replaced by the erase flash:command. See the description of the erase command for more information. O n some platforms, use can use the copy /erase source-url flash: syntax to erase the local Flash file system before copying a new file into Flash. See the desciption of the copy command for details on this option. copy logging systemTo copy archived system events to a destination file system, use the copy logging systemcommand in privileged EXEC mode. To stop copying the archived system events, use the no form of the command. Usage GuidelinesSystem Event Archive (SEA) is supported on switches that have a Supervisor Engine 32 or Supervisor Engine 720 with a compact flash adapter and a Compact Flash card (WS-CF-UPG= for Supervisor Engine 720). Cisco Universal Broadband Router 10012 The System Event Archive (SEA) feature is used to address the debug trace and system console constraints. Use the copy logging systemcommand to copy the major and critical events stored in the sea_log.dat file, to the destination file system.
The following example shows how to copy the SEA to the file system of disk0:
Router# copy logging system disk0:
Destination filename [sea_log.dat]?
The following example shows how to copy the SEA using the remote file copy function (rcp): Router# copy logging system rcp: Address or name of remote host []? 192.0.2.1 Destination username [Router]? username1 Destination filename [sea_log.dat]? /auto/tftpboot-users/username1/sea_log.dat copy xmodemTo copy a Cisco IOS image from a local or remote computer (such as a PC, Macintosh, or UNIX workstation) to Flash memory on a Cisco 3600 series router using the Xmodem protocol, use the copy xmodem: command in EXEC mode. Usage GuidelinesThis command is a form of the copy command. The copy xmodem: and copy xmodem commands are identical. See the description of the copy command for more information. Copying a file using FTP, rcp, or TFTP is much faster than copying a file using Xmodem. Use the copy xmodem: command only if you do not have access to an FTP, TFTP, or rcp server. This copy operation is performed through the console or AUX port. The AUX port, which supports hardware flow control, is recommended. No output is displayed on the port over which the transfer is occurring. You can use the logging buffered command to log all router messages sent to the console port during the file transfer. copy ymodemTo copy a Cisco IOS image from a local or remote computer (such as a PC, Macintosh, or UNIX workstation) to Flash memory on a Cisco 3600 series router using the Ymodem protocol, use the copy ymodem: command in EXEC mode. Usage GuidelinesThe copy ymodem: and copy ymodem commands are identical. See the description of the copycommand for more information. Copying a file using FTP, rcp, or TFTP is much faster than copying a file using Ymodem. Use the copy ymodem: command only if you do not have access to an FTP, rcp, or TFTP server. This copy operation is performed through the console or AUX port. The AUX port, which supports hardware flow control, is recommended. No output is displayed on the port over which the transfer is occurring. You can use the logging buffered command to log all router messages sent to the console port during the file transfer. copy noverifyTo disable the automatic image verification for the current copy operation, use the copy /noverifycommand. Usage GuidelinesThe exact format of the source and destination URLs varies according to the file or directory location. You may enter either an alias keyword for a particular file or an alias keyword for a file system type (not a file within a type).
The table below shows two keyword shortcuts to URLs.
The following tables list aliases by file system type. If you do not specify an alias, the system looks for a file in the current directory. The table below lists the URL prefix aliases for special (opaque) file systems.
The table below lists the URL prefix aliases for network file systems.
The table below lists the URL prefix aliases for local writable storage file systems.
You can enter on the command line all necessary source- and destination-URL information and the username and password to use, or you can enter the copy command and have the switch prompt you for any missing information. If you enter information, choose one of the following three options: running-config, startup-config, or a file system alias (see the tables above). The location of a file system dictates the format of the source or destination URL. The colon is required after the alias. However, earlier commands that do not require a colon remain supported but are unavailable in context-sensitive help. The entire copying process may take several minutes and differs from protocol to protocol and from network to network. In the alias syntax for ftp:, rcp:, and tftp:, the location is either an IP address or a hostname. The filename is specified for the directory that is used for file transfers. Enter the file verify autocommand to set up verification globally. © 2011 Cisco Systems, Inc. All rights reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|