Managing Configuration Files

This chapter contains the following sections:

Understanding Configuration Files

Configuration files contain the Cisco IOS XE software commands used to customize the functionality of your Cisco routing device (router, access server, switch, and so on). Commands are parsed (translated and executed) by the Cisco IOS XE software when the system is booted (from the startup-config file) or when you enter commands at the CLI in a configuration mode.

Types of Configuration Files

Startup configuration files (startup-config) are used during system startup to configure the software. Running configuration files (running-config) contain the current configuration of the software. The two configuration files can be different. For example, you may want to change the configuration for a short time period rather than permanently. In this case, you would change the running configuration using the configure terminal EXEC command but not save the configuration using the copy running-config startup-config EXEC command.

To change the running configuration, use the configure terminal command. As you use the Cisco IOS XE configuration modes, commands generally are executed immediately and are saved to the running configuration file either immediately after you enter them or when you exit a configuration mode.

To change the startup configuration file, you can either save the running configuration file to the startup configuration using the copy running-config startup-config EXEC command or copy a configuration file from a file server to the startup configuration.

Location of Configuration Files

Configuration files can be stored in the following locations:

  • The running configuration is stored in RAM.

  • The startup configuration is stored in the location specified by the CONFIG_FILE environment variable.

    The CONFIG_FILE variable defaults to NVRAM and can be a file in the following file systems:

    • nvram: (NVRAM)

    • bootflash: (Internal Flash memory)

    • usbflash0: (external USB media)

Finding the Software Version

The package files for the Cisco IOS XE software can be found on the system board flash device (flash:) orone of the external devices previously mentioned.

You can use the show version privileged EXEC command to see the software version that is running on your device.


Note


Although the show version output always shows the software image running on the device, the model name shown at the end of this display is the factory configuration and does not change if you upgrade the software license.

You can also use the dir filesystem: privileged EXEC command to see the directory names of other software images that you might have stored in flash memory.

Managing and Configuring a Consolidated Package Using copy and boot Commands

To upgrade a consolidated package, copy the consolidated package to the bootflash: directory on the router. After making this copy of the consolidated package, configure the router to boot using the consolidated package file.

The following example shows the consolidated package file being copied to the bootflash: file system. The config register is then set to boot using boot system commands, and the commands instruct the router to boot using the consolidated package stored in the bootflash: file system. The new configuration is then saved using the copy running-config startup-config command, and the system is then reloaded to complete the process.

Display the contents of the bootflash directory.

Router# dir bootflash:
Directory of bootflash:/
13      drwx           278528  May 19 2022 05:20:04 +00:00  tracelogs
11      drwx             4096  May 17 2022 14:24:54 +00:00  .installer
84      drwx            20480  May 17 2022 14:22:00 +00:00  license_evlog
83      -rw-               30  May 17 2022 14:21:41 +00:00  throughput_monitor_params
12      drwx             4096  May 17 2022 14:21:39 +00:00  .prst_sync
22      -rw-              335  May 17 2022 14:20:50 +00:00  boothelper.log
14      -rwx            41040  May 17 2022 14:20:39 +00:00  mode_event_log
259     -rw-        682679541  May 17 2022 12:54:32 +00:00  ir1800-universalk9.17.07.01.SPA.bin

Copy the new image into the bootflash: directory.


Note


In order to use secure copy (scp), you must first set up an SSH configuration. See Configuring Secure Shell.
Router# copy scp: bootflash:
Address or name of remote host []? 192.168.1.2
Source username [xxxxx]?Enter
Source filename []? /auto/users/IR1800-universalk9.17.08.01.SPA.bin
Destination filename [IR1800-universalk9.17.08.01.SPA.bin]?

This is a Cisco managed device to be used only for authorized purposes.
Your use is monitored for security, asset protection, and policy compliance.
 
Password: <your-password>
Sending file modes: C0644 208904396 IR1800-universalk9.17.08.01.SPA.bin
...........
[OK - 208904396 bytes]
208904396 bytes copied in 330.453 secs (632176 bytes/sec)

Display the contents of the bootflash: directory.

Router# dir bootflash:
Directory of bootflash:/
13      drwx           278528  May 19 2022 05:20:04 +00:00  tracelogs
11      drwx             4096  May 17 2022 14:24:54 +00:00  .installer
84      drwx            20480  May 17 2022 14:22:00 +00:00  license_evlog
83      -rw-               30  May 17 2022 14:21:41 +00:00  throughput_monitor_params
12      drwx             4096  May 17 2022 14:21:39 +00:00  .prst_sync
22      -rw-              335  May 17 2022 14:20:50 +00:00  boothelper.log
14      -rwx            41040  May 17 2022 14:20:39 +00:00  mode_event_log
259     -rw-        682679541  May 17 2022 12:54:32 +00:00  ir1800-universalk9.17.07.01.SPA.bin
12      -rw-        208904396  May 17 2022 16:17:34 -07:00  ir1800-universalk9.17.08.01.SPA.bin

Configure the router to boot using the consolidated package file.

Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# boot system bootflash:ir1800-universalk9.17.08.01.SPA.bin
Router(config)# exit

Verify the configuration change.

Router# show run | include boot
boot-start-marker
boot system bootflash:IR1800-universalk9.17.08.01.SPA.bin
boot-end-marker

Copy the running configuration and save it. Then when reloading the router, it restarts with the saved configuration.

Router# copy running-config startup-config
Destination filename [startup-config]? <enter>
Building configuration...
[OK]

Router# reload
Proceed with reload? [confirm] <enter>
Dec 04 17:42:54.445 R0/0: %PMAN-5-EXITACTION: Process manager is exiting: process exit with reload

Initializing Hardware ...

Upgrading the Router Image through the WebUI

The router can also be upgraded through the Web User Interface (WebUI). Further information on using the WebUI can be found in the Web User Interface (WebUI) chapter.

After you launch the WebUI, go to the Administration tab.

Reload the router by selecting Administration > Reload.

Select your option from the choices, then click Apply.

Select Software Management under the Administration tab. Browse to the location of the new IOS XE image file on your PC.

Select Administration > Management > Backup & Restore. Copy the image file from the laptop to your router. This example uses HTTP as transport.

Save the configuration by clicking on the floppy drive icon at the top of the WebUI.