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


Loading an SRC Configuration

You can use the load commands to perform the following tasks:

Replacing the Current Configuration with the Default SRC Configuration

To restore the full default SRC configuration:

This command removes the active configuration and replaces it with the basic, default SRC configuration.

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:

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>

Replacing the Configuration

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

To replace all of the active configuration with a full configuration in a specified file:

When you use the load override command and commit the configuration, all system processes reparse the configuration.

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>
        <name-server>192.2.2.40</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.30</name-server>
        <name-server>192.2.2.40</name-server>
        <domain-search>newdomain.juniper.net</domain-search>
    . . .
        </system>
    . . .
</configuration>

Replacing Parts of the Configuration

A replace operation searches for replace attributes in the specified file, deletes the existing statements of the same name, if any, and replaces them with the incoming configuration. If there is no existing statement of the same name, the replace operation adds to the configuration the statements marked with the replace attribute. You can also use create, delete, and merge attributes in the file.

If you are performing a replace operation and the file you specify does not contain any replace attributes, the replace operation is effectively equivalent to a merge operation. This type of operation might be useful if you are running automated scripts and cannot know in advance whether the scripts need to perform a replace or a merge operation. The scripts can use the replace operation to cover either case.

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

You can replace 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 replace portions of a configuration:

  1. Make sure that the incoming configuration file has replace attributes in place for each part of the configuration to be replaced.

See Example: Using Attributes When Editing an XML Configuration File.

  1. In configuration mode, specify the load replace command. For example:

user@host# load replace newcfg.xml format xml

The following example shows part of the 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.

For an example of a file snippet that shows how to replace a number a values within a hierarchy, see Example: Using Attributes When Editing an XML Configuration File.

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 operation="replace">192.2.2.10</name-server>
        <name-server>192.2.2.30
        </name-server>
        <domain-search>mydomain.juniper.net</domain-search>
        <domain-search>mydomain.juniper.net
        </domain-search>
        <domain-search>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.30</name-server>
        <domain-search>mydomain.juniper.net</domain-search>
        <domain-search>juniper.net</domain -search>
        . . .
    </system>
    . . .
</configuration>

Adding a Configuration Through Configuration Mode Commands

When you use the load set command, it executes the configuration instructions line by line as they are stored in a file. The instructions can contain any configuration mode command, such as set, edit, exit, and top.

To load a configuration that contains configuration mode commands:

  1. Create a text file that includes set and other configuration mode commands. For example:
  2. edit system login class name newclass permissions system
    
    delete system login class name newclass permissions interface
    
    set system login class name newclass permissions configure
    
    
    
  3. In configuration mode, use the load set command.
  4. user@host# load set newcfg2.txt
    
    
    

Loading a Configuration at a Specified Hierarchy Level

The load merge, load replace, and load set commands let you load the configuration at a specified hierarchy level by using the relative option.

To load a configuration at a hierarchy level:

  1. In configuration mode, move to the hierarchy level at which you want to load a configuration.
  2. At the hierarchy level, enter a load merge, load replace, or load set command. For example:
  3. [edit system login class name newclass]
    
    user@host# load merge mynewcfg.xml relative format xml
    

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