Using the configure replace Command

Document

Jun 17, 2015 12:49 AM
Jul 3rd, 2009

Jeremy Cioara, AdTEC Networks, Phoenix, Arizona, USA.

I'm sure you know about the "copy running-config startup-config" command used to save your configuration. However, not too many people know about the command to restore your configuration back to the startup configuration after the router is running. No, the "copy start run" command won't do it. That just merges the startup configuration with the running configuration.

Since IOS 12.3(7)T, a new command has been implemented into the IOS: the "configure replace" command. This command will allow you to truly replace the running configuration with the startup configuration, just as if you had rebooted the router.

There are many variations of this command, but my favorite is the "configure replace nvram:startup-config list" command. This will replace your current running configuration with the startup-config file located in NVRAM and list the commands that were removed/changed.

This command is actually a part of a much broader feature known as Configuration Replace and Configuration Rollback. You can learn more about this feature at: http://www.cisco.com/en/US/docs/ios/12_3t/12_3t7/feature/guide/gtrollbk.html

To receive the latest information on Cisco online tools, certifications, support documentation, insights from Cisco experts and peers, and upcoming events, check out the Cisco Technical Services Newsletter today.

pedrojroig Sun, 12/23/2012 - 08:24

Hi Jeremy,

I've just come across this post of yours and I would like to ask you something about his command:

What I am trying to do is to reload a "base" configuration for every shift, so I would need to automatically load a specific config file in a periodic basis. The thing is I can't use the startup-config, as someone can issue a "write" command by mistake, so the next one would get a corrupt config file.
I know the command 'reload in X', which reloads the IOS and the startup-config in a specific time interval. But what I want is to load a specific config file (either being in nvram or flash or otherwise).

As a bonus, I would also like to get to load that specific "base" config file just at the beginning of the shift, thus giving freedom to the user to modify or even erase his startup-config during his shift, because at the beginning of the next shift the router will be loaded with the "base" config file.
I hope that could be feasible. Do you know any way to do it?
Kind Regards,

John Patrick Lopez Wed, 06/17/2015 - 00:49

You can use copy running-config flash:backup.cfg to avoid using the startup-config which is at the nvram. In terms of the interval, you can use EEM from what I know but I haven't tried that though. I think you can also use kron command and use configure replace flash:backup.cfg force as the command because kron can do things at specific interval or time. I used kron command before to save the configuration of the switch at specific interval using write command.

Actions

This Document

Related Content