> For the complete documentation index, see [llms.txt](https://jncia-workbook.gitbook.io/workbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jncia-workbook.gitbook.io/workbook/junos-basics/11-configuration-modes-part-2.md).

# 11) Configuration Modes (Part 2)

### Lab

Your **new-user** should still be configured from *part 1*.&#x20;

Connect to R1 and enter a configuration mode that allows for parallel work, but does not cause another user's configuration to be committed when you issue the `commit` command.

To test this out, set the hostname to `NEW-HOSTNAME` using the **admin** user and set the name-server to `1.2.3.4` using the **new-user** user.

### Answer

<details>

<summary>Expand to reveal</summary>

We must use `configure private`. This gives each user their own private candidate configuration file.<br>

We can test this out by staging two changes from each user:

```
admin@R1> configure private 
warning: uncommitted changes will be discarded on exit
Entering configuration mode

[edit]
admin@R1# set system host-name NEW-HOSTNAME 

[edit]
admin@R1# 

```

```
new-user@R1> configure private 
warning: uncommitted changes will be discarded on exit
Entering configuration mode
Users currently editing the configuration:
  admin terminal pts/0 (pid 19719) on since 2026-07-09 15:41:37 UTC
      private [edit]

[edit]
new-user@R1# set system name-server 1.2.3.4 

[edit]
new-user@R1# 
```

\
At this point, each user has changes staged, but nothing committed.

```
[edit]
admin@R1# show | compare 
[edit system]
-  host-name R1;
+  host-name NEW-HOSTNAME;

[edit]
admin@R1# 
```

```
[edit]
new-user@R1# show | compare 
[edit system]
+  name-server {
+      1.2.3.4;
+  }

[edit]
new-user@R1# 
```

\
If we commit from the **admin** session, the change will be reflected on the **new-user** session.

```
[edit]
admin@R1# commit 
commit complete

[edit]
admin@NEW-HOSTNAME# 
```

```
[edit]
new-user@R1# 

[edit]
new-user@NEW-HOSTNAME# 
```

\
For this reason, two users cannot edit the same portion of the hierarchy at the same time. (Explained more below).

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

The `configure private` mode can be hard to understand, because there are a few things that are done to ensure two separate users can make changes at the same time, committing only their own changes, and while also preventing any overlap.

\
When you enter `configure private` mode, you are not editing a shared candidate config file. Instead, you create your own independent candidate config.&#x20;

\
Multiple users can edit the config at the same time, but only separate pieces of config. They cannot have conflicting changes.

\
Also, with `configure private` mode, we must commit from the top of the config. Additionally, you cannot use `commit confirm` in private mode. I believe these restrictions have to do with how Junos is internally managing the private candidate config files, to prevent discrepancies, but I cannot find any sources to confirm this.

\
This is what you will see if you try to commit from somewhere down in the hierarchy (not from the top):

```
[edit]
new-user@NEW-HOSTNAME# edit system 

[edit system]
new-user@NEW-HOSTNAME# set name-server 1.2.3.4 

[edit system]
new-user@NEW-HOSTNAME# show | compare 
[edit system]
+ name-server {
+     1.2.3.4;
+ }

[edit system]
new-user@NEW-HOSTNAME# commit 
error: can only commit from top of private configuration    <-----------

[edit system]
new-user@NEW-HOSTNAME# 
```

\
If you try to commit a change that conflicts with a change another user has committed before you, your commit will be blocked. For example, we set a new hostname from both **admin** and **new-user**, but do not commit:

```
[edit]
admin@R1# set system host-name NEW1  

[edit]
admin@R1# show | compare 
[edit system]
-  host-name R1;
+  host-name NEW1;

[edit]
admin@R1# 
```

```
[edit]
new-user@R1# set system host-name NEW2 

[edit]
new-user@R1# show | compare 
[edit system]
-  host-name R1;
+  host-name NEW2;

[edit]
new-user@R1# 
```

\
We commit from **admin**:

```
[edit]
admin@R1# commit 
commit complete

[edit]
admin@NEW1# 
```

\
If we now try to commit from **new-user**, we get an error:

```
[edit]
new-user@R1# commit 
[edit system host-name]
  'host-name NEW1'
    warning: statement does not match patch: 'NEW1' != 'R1'

[edit]
new-user@NEW1# show | compare 
[edit system]
-  host-name NEW1;
+  host-name NEW2;

[edit]
new-user@NEW1# 
```

\
We can also use the `update` command in `configure private` mode. This will pull in any recent changes that have been committed by other users since we entered the configuration mode. If the new-user uses `update` first, they can then commit their new hostname.

</details>

### Summary of Config Modes

<details>

<summary>Expand to reveal</summary>

| Mode                | Must commit from top | Changes discarded upon exit | Use case                               |
| ------------------- | -------------------- | --------------------------- | -------------------------------------- |
| configure           | No                   | No                          | Shared candidate config                |
| configure exclusive | No                   | Yes                         | Locked candidate config                |
| configure private   | Yes                  | Yes                         | Independent, per-user candidate config |

</details>

### Further Reading

<https://www.youtube.com/watch?v=q57NVIs95sM>

<https://www.juniper.net/documentation/us/en/software/junos/cli/topics/topic-map/junos-configuration-commit.html>

<https://supportportal.juniper.net/s/article/Junos-How-can-multiple-users-edit-different-parts-of-a-configuration-simultaneously>
