I'm confused on what command to use on a cisco switch where if the power is unplugged from the switch, I lose the configuration I saved and it reverts back to the previous config. I've been researching through commands like write memory and copy running-config startup-config but they both state that it overwrites the start up config file meaning it's permanent? Is this correct? I want to test my new config when there's power but be able to revert back to the old config if I pull the power. What's the command for that?

2 Answers 2


Just do not save your configuration. If you make changes, but do not write them to the startup configuration, then restarting the device through reload or power loss, you will lose the changes.

  • Would the changes be applied to the switch even if it's not saved?
    – John
    Commented Apr 29, 2021 at 22:57
  • Yes, changes made to a Cisco device take effect immediately, changing the running configuration, but they are not saved to the startup configuration unless you specifically do that.
    – Ron Maupin
    Commented Apr 29, 2021 at 22:59
  • Im trying to regenerate an rsa key for SSH but after I generate the key and look at the results through show crypto key mypubkey rsa it shows that nothing has changed.
    – John
    Commented Apr 30, 2021 at 18:31
  • The crypto stuff needs to be zeroized before you put new in. The device ships with crypto, and it will auto generate if you delete it and restart. There are some specific steps you need to follow to replace the crypto as it will regenerate.
    – Ron Maupin
    Commented Apr 30, 2021 at 18:34
  • Thanks, My new question is at networkengineering.stackexchange.com/questions/73712/…
    – John
    Commented Apr 30, 2021 at 19:00

wr mem and copy run start both replace the startup configuration. If you don't want to replace the startup config, (obviously) don't save to the startup config. copy run somwhere-else. There are many options for "somewhere-else".

The running configuration is what you're changing with conf t. Those changes do not persist if you don't take steps to save them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.