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 text or XML files. The examples in this section use the configurations in XML files.

Note: You cannot use the text file saved by using the save filename format set command to load the CLI configurations.

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:

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 Documentation