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

Loading a New Configuration File

You can create a configuration file, copy the file to the Services Router, and then load the file into the CLI. After you load the file, you can commit it to activate the configuration on the router, or you can edit the configuration interactively with the CLI and commit it at a later time.

You can also create a configuration while typing at the terminal and then load it. Loading a configuration from the terminal is generally useful when you are cutting existing portions of the configuration and pasting them elsewhere in the configuration.

To load an existing configuration file that is located on the router, use the following version of the load command:

load (merge | override | patch | replace | update) filename <relative>

To load a configuration from the terminal, use the following version of the load command:

load (merge | override | patch | replace | update) terminal <relative>

Use the load command options provided in Table 16. (The incoming configuration is the configuration in filename or the one that you type at the terminal). For more information about loading a configuration, see the JUNOS CLI User Guide.

Table 16: Load Configuration File Options

Option

Function

merge

Combines the current configuration and the incoming 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.

override

Discards the current candidate configuration and loads the incoming configuration.

patch

Changes part of the configuration with the incoming configuration and marks only those parts as changed.

relative

Allows you to use the merge, replace, and update options without specifying the full hierarchy level.

replace

Replaces portions of the configuration based on the replace: tags in the incoming configuration. The Services Router searches for the replace: tags, deletes the existing statements of the same name (if any), and replaces them with the incoming configuration. If no statement of the same name exists in the configuration, the replace operation adds it to the configuration.

If you are performing a replace operation and the incoming configuration does not contain any replace: tags, the replace operation is equivalent to a merge operation. 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.

If you are performing an override or merge operation and the incoming configuration contains replace: tags, the tags are ignored and the override or merge operation is performed.

update

Replaces only the configuration that has changed. An update operation compares the current configuration to the current candidate configuration, and loads only the changes between these configurations in the incoming configuration.

Figure 8 through Figure 10 show the results of override, replace, and merge operations.

Figure 8: Loading a Configuration with the Override Operation

Image g003573.gif

Figure 9: Loading a Configuration with the Replace Operation

Image g003575.gif

Figure 10: Loading a Configuration with the Merge Operation

Image g003574.gif


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