Overview of the Configure
Command
You (the network administrator) use the configure
command to enter CLI
configuration mode. You can also use it to gather other information, such as which other
users are currently in configuration mode.
Forms of the configure
Command
Junos OS supports three forms of the configure
command:
configure
, configure private
, and
configure exclusive
. These forms control how users edit and commit
configurations. You can use this command to coordinate the work of multiple users who
manage the network and device configuration.
Command |
Edit Access |
Commit Access |
---|---|---|
|
|
|
|
|
|
|
|
|
See Also
How to Use the configure
Command
Up to 32 users can work in configuration mode simultaneously; 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 that you and other users have made. For this reason, you must keep track of who is in configuration mode with you.
To see other users currently logged in to the same device in configuration mode:
configure
command to enter CLI configuration mode.If other users are in configuration mode, the message displayed indicates who the users are and what portion of the configuration each person is viewing or editing.
user@host> configure
Entering configuration mode
Current 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 committed
[edit]
user@host#
How to Use the configure exclusive
Command
If you enter configuration mode using the configure exclusive
command, you lock
the candidate global configuration for as long as you remain in configuration mode.
(The candidate global configuration is also known as the shared configuration or
shared configuration database.) Using the configure exclusive
command, you can 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. Also, any attempted changes by other users while the configuration is
in the locked state are discarded as soon as the other users 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 while another user is also in configuration mode and has locked the configuration, a message identifies the user. The message also identifies the portion of the configuration that the user is viewing or editing. For example, in the following example, the pid_number of the user who has locked the configuration for exclusive access is 1088:
user@host> configure
Entering configuration mode
Users currently editing the configuration:
root terminal p3 (pid 1088) on since 2018-10-30 19:47:58 EDT, idle 00:00:44
exclusive [edit interfaces so-3/0/0 unit 0 family inet]
In configure exclusive
mode, any uncommitted changes are discarded when you
exit:
user@host>configure exclusive
warning: uncommitted changes will be discarded on exit Entering configuration mode [edit] user@host#set system host-name cool
[edit] user@host#quit
The configuration has been changed but not committed warning: Auto rollback on exiting 'configure exclusive' Discard uncommitted changes? [yes,no]yes
warning: discarding uncommitted changes load complete Exiting configuration mode
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 enables you to continue editing or to commit your changes in
configure exclusive
mode.
When one user exits configure exclusive
mode while another user is in
configure private
mode, Junos OS rolls
back any uncommitted changes in the private mode session.
Another rollback can happen if you enter configuration mode with the configure
exclusive
command and issue the commit confirmed
command, but without confirming the commit within the specified interval. By not
confirming the commit within the specified interval, you trigger an automatic
rollback. After an automatic rollback occurs, the operating system removes the
exclusive lock from your session. As a result, the error message “access has been
revoked” appears. This error message appears because the session is no longer an
exclusive session. This means that the configuration is back to the default state:
anyone with access can edit the configuration, commit it, or both. To re-lock the
configuration, you must use the configure exclusive
command
again.
user@host>configure exclusive
warning: uncommitted changes will be discarded on exit Entering configuration mode [edit] user@host#commit confirmed 1
commit confirmed will be automatically rolled back in 1 minutes unless confirmed commit # commit confirmed will be rolled back in 1 minute Commit was not confirmed; automatic rollback complete. [edit] user@host#commit
error: access has been revoked. user@host#commit check
error: access has been revoked. user@host>configure exclusive
warning: uncommitted changes will be discarded on exit Entering configuration mode
If you initiate a configure exclusive
session, issue the commit
confirmed
command, and confirm the commit, your session retains the
exclusive lock. You can continue to make changes to the configuration while still in
a locked exclusive session.
user@host>configure exclusive
warning: uncommitted changes will be discarded on exit Entering configuration mode [edit] user@host#commit confirmed 1
commit confirmed will be automatically rolled back in 1 minutes unless confirmed commit complete # commit confirmed will be rolled back in 1 minute [edit] user@host#commit
commit complete
See Also
How to Work with the Correct 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 update your private candidate configuration, that
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 the configure
private
command to configure statements corresponding to
third-party YANG data models such as OpenConfig data models or custom YANG data
models.
When you issue the configure
command in a chassis cluster, it
takes you to configure private
mode.