Understanding Junos OS Configuration Groups
This topic provides an overview of the configuration groups feature and the inheritance model in Junos OS, and contains the following sections:
Configuration Groups Overview
The configuration groups feature in Junos OS enables you to create a group containing configuration statements and to direct the inheritance of that group’s statements in the rest of the configuration. The same group can be applied to different sections of the configuration, and different sections of one group’s configuration statements can be inherited in different places in the configuration.
Configuration groups enable you to create smaller, more logically constructed configuration files, making it easier to configure and maintain Junos OS. For example, you can group statements that are repeated in many places in the configuration, such as when configuring interfaces, and thereby limit updates to just the group.
You can also use wildcards in a configuration group to allow configuration data to be inherited by any object that matches a wildcard expression.
The configuration group mechanism is separate from the grouping mechanisms used elsewhere in the configuration, such as BGP groups. Configuration groups provide a generic mechanism that can be used throughout the configuration but that are known only to the Junos OS CLI. The individual software processes that perform the actions directed by the configuration receive the expanded form of the configuration—they have no knowledge of configuration groups.
Junos OS does not support configuring statements corresponding to third-party YANG data models, for example, OpenConfig or custom data models, under the [edit groups] hierarchy.
Configuration groups use true inheritance, which involves a dynamic, ongoing relationship between the source of the configuration data and the target of that data. Data values changed in the configuration group are automatically inherited by the target. The target does not need to contain the inherited information, although the inherited values can be overridden in the target without affecting the source from which they were inherited.
This inheritance model allows you to see only the instance-specific information without seeing the inherited details. A command pipe in configuration mode allows you to display the inherited data.
Configuring Configuration Groups
For areas of your configuration to inherit configuration statements, you must first put the statements into a configuration group and then apply that group to the levels in the configuration hierarchy that require the statements.
To configure configuration groups and inheritance, you can include the groups statement at the  hierarchy level:
Include the apply-groups [ group-names ] statement anywhere in the configuration where the configuration statements contained in a configuration group are needed.