Configure Command Overview
The configure command is used to enter the CLI configuration mode. It can also be used to gather other information, such as other users currently in configuration mode.
Forms of the configure Command
The Junos OS supports three forms of the configure command: configure, configure private, and configure exclusive. These forms control how users edit and commit configurations and can be useful when multiple users are managing the network and device configuration.
Table 1: Forms of the configure Command
Using the configure Command
Up to 32 users can be in configuration mode simultaneously, and they all can make changes to the configuration at the same time. When you commit changes to the configuration, you may be committing a combination of changes you and other users have made. For this reason, you will want to keep track of who is in configuration mode with you.
To see other users currently logged onto the same device in configuration mode:
- Use the configure command to enter the CLI
If there are other users, the message displayed indicates who the users are and what portion of the configuration each person is viewing or editing.user@host> configureEntering configuration modeCurrent configuration users:root terminal p3 (pid 1088) on since 2018-05-13 01:03:27 EDT[edit interfaces so-3/0/0 unit 0 family inet]The configuration has been changed but not committeduser@host#
Using the configure exclusive Command
If you enter configuration mode using the configure exclusive command, you lock the candidate global configuration (also known as the shared configuration or shared configuration database) for as long as you remain in configuration mode, allowing you to make changes without interference from other users. Other users can enter and exit configuration mode, but they cannot make any permanent changes to the configuration. This additionally means any attempted changes by other users while the configuration is in the locked state will always be discarded as soon as they exit configuration mode.
If another user has locked the configuration, and you need to forcibly log them out, use the operational mode command request system logout pid pid_number. You can locate the pid_number in the notification you receive upon entering configuration mode when someone else has locked it for exclusive access.
If you enter configuration mode and another user is also in configuration mode and has locked the configuration, a message identifies the user and the portion of the configuration that the user is viewing or editing. For example, in this is case, the pid_number of the user who has locked the configuration for exclusive access is 1088.
In configure exclusive mode, any uncommitted changes are discarded when you exit:
When you use the yes option to exit configure exclusive mode, Junos OS discards any uncommitted changes and rolls backs the configuration to its previously committed state. The no option allows you to continue editing or to commit your changes in configure exclusive mode.
When one user exits from configure exclusive mode while another user is in configure private mode, Junos OS will roll back any uncommitted changes in the private mode session.
If you enter configuration mode with the configure exclusive command, and issue commit confirmed, but do not actually confirm the commit within the specified interval, an automatic rollback is triggered. Once automatic rollback occurs, Junos OS removes the exclusive lock from your session and as a result, the error message “access has been revoked” is displayed. This is because the session is no longer an exclusive session. What this means for you is that the configuration is back to the default state where anyone with access can edit and/or commit it. To re-lock the configuration, you need to use the configure exclusive command again.
If you initiate a configure exclusive session, issue commit confirmed and confirm the commit, the exclusive lock is retained in your session. You can continue to make changes to the configuration while still in a locked exclusive session.
Updating the configure private Configuration
When you are in configure private mode, you must work with a copy of the most recently committed shared configuration. If the global configuration changes, you can issue the update command to update your private candidate configuration. When you do this, your private candidate configuration contains a copy of the most recently committed configuration with your private changes merged in.
Merge conflicts can occur when you issue the update command.
You can also issue the rollback command to discard your private candidate configuration changes and obtain the most recently committed configuration.
Junos OS does not support using configure private mode to configure statements corresponding to third-party YANG data models, for example, OpenConfig or custom YANG data models.