Difference between revisions of "Exit (command)"
Latest revision as of 03:04, 28 March 2017
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.
Exiting from a configuration level:
[edit interfaces ethernet eth0] vyos@vyos# exit  vyos@vyos#
Exiting from configuration mode:
 vyos@vyos# exit exit vyos@vyos:~$
Exiting from operational mode:
vyos@vyos:~$ exit logout
Error message when trying to exit with uncommitted changes:
vyos@vyos# exit Cannot exit: configuration modified. Use 'exit discard' to discard the changes and exit.  vyos@vyos#
Warning message when exiting with unsaved changes:
 vyos@vyos# exit Warning: configuration changes have not been saved. exit vyos@vyos:~$