> 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/15-editing-configuration-part-2.md).

# 15) Editing Configuration (Part 2)

### Pre-Work

Load the config called **wrong.addressing.cfg** using the **load\_config\_on\_nodes.py** script.

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

### Lab

As in the previous lab, the interface is incorrectly set to 10.100.2.1/24 on R1 again.

This time, fix the address **using only a single command**.

### Answer

<details>

<summary>Expand to reveal</summary>

We can change the address in one-line using the `rename` tool. This allows us to change the existing address instead of adding a second address (which would happen with the `set` command).

```
admin@R1> configure 
Entering configuration mode

[edit]
admin@R1# edit interfaces ge-0/0/0.0 family inet 

[edit interfaces ge-0/0/0 unit 0 family inet]
admin@R1# rename address 10.100.2.1/24 to address 10.1.2.1/24

[edit interfaces ge-0/0/0 unit 0 family inet]
admin@R1# show | compare 
[edit interfaces ge-0/0/0 unit 0 family inet]
+  address 10.1.2.1/24;
-  address 10.100.2.1/24;

[edit interfaces ge-0/0/0 unit 0 family inet]
admin@R1# commit 
commit complete
```

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

The `rename` tool is useful to avoid having to `delete` then `set` configuration in two steps. There are some cases where multiple values are allowed under a configuration hierarchy, for example with interface addresses. Using `rename` is essentially a way to replace the value.

</details>

### Further Reading

<https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/command/rename.html>
