Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

How to revert config on router startup?

Hello,
Is there a way to run "copy flash:original.conf startup-config" after 5 minutes after rebooting the router?
I tried to use kron but it doesn't work with commands that require interaction.
What I'm trying to achieve is to copy new config to startup-config and reboot the router (this is a remote router with no IT staff on site) - if for some reason new config doesn't work and I can't get into the router, let's say in 5 minutes it would execute "copy flash:original.conf startup-config" to load original config that I saved to flash and reboot the router. We will need to do this on about 30 remote routers. Our environment is IOS 15.3(1)T on 1941w with ipbasek9 and securityk9 licenses.
Thank you for any suggestions.

3 REPLIES
Cisco Employee

You can use EEM for this:

You can use EEM for this:

 

event manager applet boot-orig

 event timer countdown time 300

 action 1.0 cli command "enable"

 action 2.0 cli command "copy flash:original.conf start" pattern "confirm"

 action 3.0 cli command "y"

 action 4.0 reload

Hall of Fame Super Gold

Doesn't make any sense.   Why

Doesn't make any sense.  

 

Why copy the configuration file to startup and reboot the router?  Why not just copy the configuration file to the running-config and then saving the configuration.  This way, you don't need to reboot the router.

Cisco Employee

Copying to startup is a

Copying to startup is a rather common thing when bootstrapping.  The running config may be "dirty" and copying to it always results in a merge.  This isn't always what you want.  If you copy to startup and reload, you are guaranteed the config loaded into the device is what you want.

151
Views
0
Helpful
3
Replies
CreatePlease to create content