> 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/10-configuration-modes-part-1.md).

# 10) Configuration Modes (Part 1)

### Pre-Work

If you made any changes, you can quickly revert the lab using the **load\_config\_on\_nodes.py** script.

```
python3 load_config_on_nodes.py --lab_dir three-routers --config_filename basic.addressing.cfg
```

### Lab

Connect to R1, and create a new user again:

```
configure
admin@R1# set system login user new-user authentication plain-text-password   
New password:
Retype new password:

[edit]
admin@R1# set system login user new-user class super-user                      

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

Open a second window to R1, this time logging in as the **new-user**.

```
clab@clab:~/jncia-junos-labs$ ssh new-user@10.200.255.2
(new-user@10.200.255.2) Password:
--- JUNOS 25.4R1.12 Kernel 64-bit  JNPR-15.0-20251024.861cae5_buil
new-user@R1> 
```

Connect to R1, and enter configuration mode. However, do so in a way that prevents the **new-user** from making any changes while you are working on the config.

### Answer

<details>

<summary>Expand to reveal</summary>

We must use `configure exclusive` to prevent any other users from making changes to the shared config file while we are working on it.

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

[edit]
admin@R1# 
```

\
The **new-user** will be able to enter config mode, but will not be able to issue any `set` commands:

```
new-user@R1> configure 
Entering configuration mode
Users currently editing the configuration:
  admin terminal pts/0 (pid 19719) on since 2026-07-09 15:34:25 UTC, idle 00:00:39
      exclusive [edit]

[edit]
new-user@R1# set system host-name XYZ 
error: configuration database locked by:
  admin terminal pts/0 (pid 19719) on since 2026-07-09 15:34:25 UTC, idle 00:01:01
      exclusive [edit]

[edit]
new-user@R1# show | compare 

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

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

The `configure exclusive` mode locks out the candidate configuration, preventing any other users from making changes.

\
Also note that with `configure exclusive` mode, changes will be discarded upon exit. You do not have to explicit `rollback` like you do in regular `configure` mode.

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

[edit]
admin@R1# exit 
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
Exiting configuration mode

admin@R1> configure 
Entering configuration mode

[edit]
admin@R1# show | compare 

[edit]
admin@R1# 
```

</details>
