Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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:

    • 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>

    Modified: 2014-06-05