Exit (command)

Created by Yuriy Andamasov, Modified on Thu, 18 Jan at 6:21 PM by Srividya Anantapatnaikuni

Article review date2024-01-18
Validated for VyOS versions
1.2.5, 1.3.5, 1.4.0, 1.5.x

The exit command exits the current configuration mode. If the current configuration level isn't the top-most, then the configuration level is put back to the top-most level. If the configuration level is at the top-most level, then it exits the configuration mode and returns to operational mode. The exit command cannot be used if uncommitted changes exists in the configuration file. To exit with uncommitted changes, you either need to use the exit discard command or you need to commit   the changes before exiting. The exit command doesn't save the configuration, only the save command does. A warning will be given when exiting with unsaved changes. Using the exit command in operational mode will logout the session.

Syntax

Exiting from a configuration level:

[edit interfaces ethernet eth0]
vyos@vyos-rtr# exit
[edit]
vyos@vyos-rtr#

Exiting from configuration mode:

[edit]
vyos@vyos-rtr# exit
exit
vyos@vyos-rtr:~$

Exiting from operational mode:

vyos@vyos-rtr:~$ exit
logout

Error message when trying to exit with uncommitted changes:

vyos@vyos-rtr# exit
Cannot exit: configuration modified.
Use 'exit discard' to discard the changes and exit.
[edit]
vyos@vyos-rtr#

Warning message when exiting with unsaved changes:

[edit]
vyos@vyos-rtr# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos-rtr:~$

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article