[Contents] [Prev] [Next] [Index] [Report an Error]

# Merging the Active Configuration with Another Configuration

A merge operation is useful when you are adding a new section to an existing configuration. If the existing configuration and the incoming configuration contain conflicting statements, the statements in the incoming configuration override those in the existing configuration.

You can merge a configuration from files in XML or text format. The examples in this section use files in XML format.

You can merge all of the configuration, or the configuration at a specified hierarchy level. For information about loading a configuration at a specified hierarchy level, see Loading a Configuration at a Specified Hierarchy Level.

To combine the active configuration and the configuration in a specified file:

- In configuration mode, specify the load merge command. For example:
  `
  [edit]
  user@host# load merge newcfg.xml format xml
  `

The following example shows part of an existing configuration, the configuration in the file to be loaded, and the resulting configuration. In the resulting configuration, bold text indicates the configuration that changed.

Existing configuration:

`

<configuration>
. . .
<system>
. . .
<host-name>myhost</host-name>
<name-server>192.2.2.10</name-server>
<name-server>192.2.2.20</name-server>
<domain-search>mydomain.juniper.net</domain-search>
<domain-search>juniper.net</domain -search>
. . .
</system>
. . .
</configuration>

`

Configuration in the file to be loaded:

`

<configuration>
. . .
<system>
. . .
<host-name>myhost</host-name>
<name-server>192.2.2.30</name-server>
<domain-search>newdomain.juniper.net
</domain-search>
. . .
</system>
. . .
</configuration>

`

Resulting configuration:

`

<configuration>
. . .
<system>
. . .
<host-name>myhost</host-name>
<name-server>192.2.2.10</name-server>
<name-server>192.2.2.20</name-server>
<name-server>192.2.2.30</name-server>
<domain-search>mydomain.juniper.net</domain-search>
<domain-search>juniper.net</domain-search>
<domain-search>newdomain.juniper.net</domain-search>
. . .
</system>
. . .
</configuration>

`

#### Related Topics

- Replacing the Current Configuration with the Default SRC Configuration
- Adding a Configuration Through Configuration Mode Commands
- Reverting to a Previous SRC Configuration

[Contents] [Prev] [Next] [Index] [Report an Error]