cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
52645
Views
40
Helpful
17
Replies

Undoing running configuration

cisco_lite
Level 1
Level 1

What is the safest way to undo running configuration in cisco switches and routers.

3 Accepted Solutions

Accepted Solutions

Hi,

without reloading you can use:

copy startup-config running-config

In this way you copy the content of the startup config in the running config

In order to view the content of the startup config you can use the command:

show startup-config

I hope this helps.

Best regards.

Massimiliano,

View solution in original post

One other option without reloading is to use #configure replace

View solution in original post

copy startup-config running-config is not a reliable (or sometimes effective) way to remove changes made in the running config. The copy to running config does a merge of the two config files. Where the same command exists in both configs the command from startup will replace the command in running. But if a command exists in running and not in startup then it will still exist after doing the copy from startup to running.

Perhaps an example will help to clarify the issue. Lets assume that the startup config has interface fastethernet0/0 with an IP address configured and with no ip access-group on the interface and that access list 101 does not exist in the startup config. Then assume that you make changes in the running config by configuring:

access-list 101 deny ip any any

interface fastethernet0/0

ip access-group 101 in

end

Then you realize that this is having a bad effect :(

so you do copy startup-config running-config. IOS does the copy but it will not remove access list 101 and it will not remove the ip access-group command. So you still have a bad thing.

In my experience the only effective way to be sure that changes are removed is to reload. I do not have experience with configure replace config but it sounds interesting.

HTH

Rick

HTH

Rick

View solution in original post

17 Replies 17

fjcardenas-1
Level 1
Level 1

If you don't want to save the running configuration and want to go back to the startup configuration just make a reload (#reload).

Hi,

without reloading you can use:

copy startup-config running-config

In this way you copy the content of the startup config in the running config

In order to view the content of the startup config you can use the command:

show startup-config

I hope this helps.

Best regards.

Massimiliano,

Hi,

I would be careful doing copy startup-config running-config. As far as I understand (correct me if I am wrong somebody) is that this does not replace the running with the startup config, but instead it merges the two and can produce some unexpected results if you are not careful.

I've always heard comments against doing this for this reason.

Thanks

So what would be the safest and easiest way to revert the running config changes. I am sure this is a common need due to unexpected results because of running config changes.

I suppose it depends on what you are doing. If it is just a single or few commands then usually I would just undo it by reverting what I did using the "no..." commands

If you are talking about a lot of configuration, then potentially saving and taking a copy of the configuration before and as someone else said reloading if things go wrong to revert back to the original.

As I said in my last post I am happy for someone to correct me if I am wrong about the copy start run command. But as I understand it its not always a good idea (I guess it would depend on what is in the configuration). I for one only use it if having to recover passwords etc where the running configuration is already blank (well default factory anyway)

Thanks

One other option without reloading is to use #configure replace

"Enter the copy startup-config running-config command to write the startup configuration to the running configuration. "

Reference:http://www.cisco.com/en/US/docs/switches/wan/mgx/mgx_8850/software/mgx_r3/rpm/rpm_r1.1/configuration/guide/appc.html

I hope this helps.

Best regards.

Massimiliano.

Hey mike_guy29

That's what I've heard and read... that's why I recommended the reload instead of the copy.

copy startup-config running-config is not a reliable (or sometimes effective) way to remove changes made in the running config. The copy to running config does a merge of the two config files. Where the same command exists in both configs the command from startup will replace the command in running. But if a command exists in running and not in startup then it will still exist after doing the copy from startup to running.

Perhaps an example will help to clarify the issue. Lets assume that the startup config has interface fastethernet0/0 with an IP address configured and with no ip access-group on the interface and that access list 101 does not exist in the startup config. Then assume that you make changes in the running config by configuring:

access-list 101 deny ip any any

interface fastethernet0/0

ip access-group 101 in

end

Then you realize that this is having a bad effect :(

so you do copy startup-config running-config. IOS does the copy but it will not remove access list 101 and it will not remove the ip access-group command. So you still have a bad thing.

In my experience the only effective way to be sure that changes are removed is to reload. I do not have experience with configure replace config but it sounds interesting.

HTH

Rick

HTH

Rick

Glad to hear I am not just making things up! Thanks for the extra clarification

Hi,

Thank you Rick.

Best regards.

Massimiliano.

Rick,

But reload is not always the possible choice in Production. A reload may mean downtime or unwanted failover event.

Wouldn't it be better to undo the new running-config changes until it looks just like startup-config and then do a copy run start to have all in sync.

Do you know of any reliable Cisco configuration comparision tool.

Hi,

Agreed. Reloads are not always possible. And unless the brown stuff had really hit the fan there is no real need for a reload. I would just negate what I have done using the "no..." command. However if you need to revert back everythings gone wrong and your startup config was prior to the changes then yes a reload would revert back.

So if possible undo what you have done manually with the "no..." command. If it all goes really wrong and you must roll back and cannot remember config you have put in etc then a reload would revert back (make sure you save config prior to working though!!)

However copy start run is not a good idea though. So avoid that if you can!

Hope that helps

The original question was what is the most safe way to undo config changes. I would interpret safe as meaning doing a complete removal and minimizing the opportunity for errors in the removal (not removing ALL of the changes, or removing something that was not changed). In that interpretation I still maintain that reload is the safest alternative. If you interpret the question differently then other answers may fit.

I agree that sometimes a reload will not be chosen because of the impact of the reload. And therefore different methods of recovery may be used. But the other methods, such as manually backing out config changes, or using the copy startup-config to running-config, are more subject to error and are inherently less safe than a reload.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco