Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
Quick question. If I inadvertently make some changes to the config and I want to discard those changes, do I just exit configuration mode? When I exit configuration mode with the changes be discarded from the candidate configuration? Or are there additional steps that need to be taken?
Thanks in advance.
Do this _before_ exiting config mode
And then exit.
thanks for the reply, here is the output of a show|compare rollback 0
root@switch# show | compare rollback 0
Yes - that is correct - rollback 0 replaces the "candidate" config (the one you are editing) with the active config (same as the boot config). You can also do rollback "n" where n = a prior active config. JUNOS stores up to 50 prior configs (6 on some platforms)
perfect, thanks. i appreciate the insight.
The sort answer to your question is yes, exiting config before committing will discard the candidate config. The answers given below are the cleaner way to achieve what you are asking though.
Not necessarily - depending what configuration mode you are already in.
If you are in "normal" config mode your uncommitted changes are RETAINED - a rollback 0 will remove the configs in the candidate file
If you are in "exclusive" mode, uncommitted changes are always discarded if you log out
If you are in "private" mode, again your uncommitted changes are discarded if you log out. Remember if you want to COMMIT your changes in this mode you have to be at the TOP hierarchical level