Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Configure Command Overview

 

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. For more information, see the following topics:

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 configure the software. See Table 1.

Table 1: Forms of the configure Command

Command

Edit Access

Commit Access

configure

  • No one can lock the configuration. All users can make configuration changes.

    When you enter configuration mode, the CLI displays the following information:

    • A list of other users editing the configuration.

    • Hierarchy levels the users are viewing or editing.

    • Whether the configuration has been changed, but not committed.

    • When multiple users enter conflicting configurations, the most recent change to be entered takes precedence.

  • No one can lock the configuration. All users can commit all changes to the configuration.

  • If you and another user make changes and the other user commits changes, your changes are committed as well.

configure exclusive

  • One user locks the configuration and makes changes without interference from other users.

  • Other users can enter and exit configuration mode, but they cannot commit the configuration.

  • If you enter configuration mode while another user has locked the configuration (with the configure exclusive command), the CLI displays the user and the hierarchy level the user is viewing or editing.

  • If you enter configuration mode while another user has locked the configuration, you can forcibly log out that user with the request system logout operational mode command. For details, see the CLI Explorer.

configure private

  • Multiple users can edit the configuration at the same time.

  • Each user has a private candidate configuration to edit independently of other users.

  • When multiple users enter conflicting configurations, the first commit operation takes precedence over subsequent commit operations.

  • When you commit the configuration, the router verifies that the operational (running) configuration has not been modified by another user before accepting your private candidate configuration as the new operational configuration.

  • If the configuration has been modified by another user, you can merge the modifications into your private candidate configuration and attempt to commit again.

Using the configure Command

You can use the configure command to not only enter the CLI configuration mode but also to gather other information, such as other users currently in configuration mode.

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 on who if anyone 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 configuration mode.

    If there are other users, the message displayed indicates who the users are and what portion of the configuration the each person is viewing or editing.

Notice also that If, when you enter configuration mode, the configuration contains changes that have not been committed, another message is displayed:

This tells you that another user has already made changes to the configuration.

Using the configure exclusive Command

If you enter configuration mode with 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 commit the configuration.

If another user has locked the configuration, and you need to forcibly log the person out, enter the operational mode command request system logout pid pid_number.

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:

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 your uncommitted changes and rolls backs your configuration. The no option allows you to continue editing or to commit your changes in configure exclusive mode.

When a user exits from configure exclusive mode while another user is in configure private mode, Junos OS will roll back any uncommitted changes.

If you enter the configuration mode with the configure exclusive command, and issue commit confirmed, but do not confirm the commit, auto rollback happens. Once auto rollback happens, the management daemon (MGD) 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 more an exclusive session.

If the you initiate a configure exclusive session, issue commit confirmed and confirm the commit, the exclusive lock is retained in your 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. For example:

Note

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:

Note

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.