Supported Platforms
Related Documentation
- ACX, EX, J, M, MX, PTX, T Series
- Understanding the Junos Configuration Groups
- Creating a Junos Configuration Group
- EX, M, MX, PTX, T Series
- Applying a Junos Configuration Group
- M, MX, T Series
- Using Conditions to Apply Configuration Groups Overview
Example: Configuring Conditions for Applying Configuration Groups
This example shows how to configure conditions under which a specified configuration group is to be applied.
Requirements
No special configuration beyond device initialization is required before you configure this example.
Overview
You can configure your group configuration data at the [edit groups group-name] hierarchy level, then use the when statement to have the group applied based on conditions including: type of chassis, model, or routing-engine, virtual chassis member, cluster node, and start and optional end time of day or date.
If you specify multiple conditions in a single configuration group, all conditions must be met before the configuration group is applied.
You can specify the start time or the time duration for the configuration group to be applied. If only the start time is specified, the configuration group is applied at the specified time and it remains in effect until the time is changed. If the end time is specified, then on each day, the applied configuration group is started and stopped at the specified times.
This example sets conditions in a configuration group, test1, such that this group is applied only when all of the following conditions are met: the router is a model MX240 router with chassis type LCC0, with a Routing Engine operating as RE0, is member0 of the virtual chassis on node0, and the configuration group will only be in effect from 9:00 a.m. until 5:00 p.m. each day. The configuration data has not yet been added to the test1 group in this example.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure conditions for configuration group test1:
- Set the condition that identifies the model MX240 router.[edit groups test1 when]user@host# set model mx240
- Set the condition that identifies the chassis type as
LCC0.[edit groups test1 when]user@host# set chassis lcc0
- Set the condition that identifies the Routing Engine operating
as RE0.[edit groups test1 when]user@host# set routing-engine re0
- Set the condition that identifies the virtual chassis member0.[edit groups test1 when]user@host# set member member0
- Set the condition that identifies the cluster node0.[edit groups test1 when]user@host# set node node0
- Set the condition that applies the group only between
the hours of 9:00 a.m. and 5:00 p.m. daily.[edit groups test1 when]user@host# set time 9 to 5
Note: The syntax for specifying the time is: time <start-time> [to <end-time>] using the time format yyyy-mm-dd.hh:mm, hh:mm, or hh.
- Commit the configuration.
Results
From configuration mode, confirm your configuration by entering the show groups command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Verification
Confirm that the configuration is working properly.
Checking Group Inheritance with Conditional Data
Purpose
Verify that conditional data from a configuration group is inherited when applied.
Action
The show | display inheritance operational command can be issued with the when data to display the conditional inheritance. Using this example, you could issue one of these commands to determine that the conditional data was inherited:
Related Documentation
- ACX, EX, J, M, MX, PTX, T Series
- Understanding the Junos Configuration Groups
- Creating a Junos Configuration Group
- EX, M, MX, PTX, T Series
- Applying a Junos Configuration Group
- M, MX, T Series
- Using Conditions to Apply Configuration Groups Overview
Published: 2013-02-22
Supported Platforms
Related Documentation
- ACX, EX, J, M, MX, PTX, T Series
- Understanding the Junos Configuration Groups
- Creating a Junos Configuration Group
- EX, M, MX, PTX, T Series
- Applying a Junos Configuration Group
- M, MX, T Series
- Using Conditions to Apply Configuration Groups Overview