Swap running configuration files in a Router
This will completely replace the existing running config with another config file... not merge the existing running config and another config, but do a full swap Very useful when you perform a password recovery by ignoring the router's saved configuration, or if you just want to replace the whole config without fear of merging a running and a saved config together. Also great for when you have a lab device and maybe have several different configs, depending on the work you want to do.
First locate the config file you want to load onto the router... in this case, we did a password recovery and want to load the saved config back onto the router.
Router#dir all-filesystems
.....
Directory of nvram:/
32769 -rw- 13828 <no date> startup-config
32770 ---- 5505 <no date> private-config
32771 -rw- 13828 <no date> underlying-config
1 ---- 172 <no date> persistent-data
2 -rw- 1292 <no date> ISR4331-3x1GE_0_0_0
4 -rw- 1320 <no date> PVDM4-32_0_4_0
6 -rw- 17 <no date> ecfm_ieee_mib
7 -rw- 559 <no date> IOS-Self-Sig#1.cer
8 -rw- 0 <no date> ifIndex-table
33554432 bytes total (33526855 bytes free)
Router#
Now type "configure replace" with the file source you want to use... it could be one of several local files, a file on a USB, or a file on a ftp / tftp share...
in this case, it is on the local NVRAM.
Router#configure replace nvram:/startup-config
You'll receive a warning and be asked if you are sure you want to proceed:
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]: yes
You'll then see some logging messages and be greeted with the hostname prompt that was loaded from the new config:
LAB-4331-BILLINGS#
That's it. Whatever existing running-config was on the router is now gone, and the loaded config is ready to go.
If you have several config files for lab work, or different phases of a project, you can easily swap back and forth through them provided the device has access to those files or they are loaded onto the device itself.
This will completely replace the existing running config with another config file... not merge the existing running config and another config, but do a full swap Very useful when you perform a password recovery by ignoring the router's saved configuration, or if you just want to replace the whole config without fear of merging a running and a saved config together. Also great for when you have a lab device and maybe have several different configs, depending on the work you want to do.
First locate the config file you want to load onto the router... in this case, we did a password recovery and want to load the saved config back onto the router.
Router#dir all-filesystems
.....
Directory of nvram:/
32769 -rw- 13828 <no date> startup-config
32770 ---- 5505 <no date> private-config
32771 -rw- 13828 <no date> underlying-config
1 ---- 172 <no date> persistent-data
2 -rw- 1292 <no date> ISR4331-3x1GE_0_0_0
4 -rw- 1320 <no date> PVDM4-32_0_4_0
6 -rw- 17 <no date> ecfm_ieee_mib
7 -rw- 559 <no date> IOS-Self-Sig#1.cer
8 -rw- 0 <no date> ifIndex-table
33554432 bytes total (33526855 bytes free)
Router#
Now type "configure replace" with the file source you want to use... it could be one of several local files, a file on a USB, or a file on a ftp / tftp share...
in this case, it is on the local NVRAM.
Router#configure replace nvram:/startup-config
You'll receive a warning and be asked if you are sure you want to proceed:
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]: yes
You'll then see some logging messages and be greeted with the hostname prompt that was loaded from the new config:
LAB-4331-BILLINGS#
That's it. Whatever existing running-config was on the router is now gone, and the loaded config is ready to go.
If you have several config files for lab work, or different phases of a project, you can easily swap back and forth through them provided the device has access to those files or they are loaded onto the device itself.