Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Disabling Inheritance of a Junos OS Configuration Group

To disable inheritance of a configuration group at any level except the top level of the hierarchy, include the apply-groups-except statement:

apply-groups-except [ group-names ];

This statement is useful when you use the apply-group statement at a specific hierarchy level but also want to override the values inherited from the configuration group for a specific parameter.

Example: Disabling Inheritance on Interface so-1/1/0

In the following example, the apply-groups statement is applied globally at the interfaces level. The apply-groups-except statement is also applied at interface so-1/1/0 so that it uses the default values for the hold-time and link-mode statements.

[edit]
groups { # "groups" is a top-level statementglobal { # User-defined group nameinterfaces {<*> {hold-time down 640;link-mode full-duplex;}}}}
apply-groups global;
interfaces {so-1/1/0 {apply-groups-except global;  # Disables inheritance from group "global"# so-1/1/0 uses default value for “hold-time”# and "link-mode" }}

For information about applying a configuration group, see Applying a Junos Configuration Group.

Configuration groups can add some confusion regarding the actual values used by the router, because configuration data can be inherited from configuration groups. To view the actual values used by the router, use the display inheritance command after the pipe ( | ) in a show command. This command displays the inherited statements at the level at which they are inherited and the group from which they have been inherited.

[edit]user@host# show | display inheritance
snmp {location "West of Nowhere";#### 'My Engineering Group' was inherited from group 'basic'##contact "My Engineering Group";#### 'BasicAccess' was inherited from group 'basic'##community BasicAccess {#### 'read-only' was inherited from group 'basic'##authorization read-only;}}

To display the expanded configuration (the configuration, including the inherited statements) without the ## lines, use the except command after the pipe in a show command:

[edit]user@host# show | display inheritance | except ##
snmp {location "West of Nowhere";contact "My Engineering Group";community BasicAccess {authorization read-only;}}

Note: Using the display inheritance | except ## option removes all the lines with ##. Therefore, you might also not be able to view information about passwords and other important data where ## is used. To view the complete configuration details with all the information without just the comments marked with ##, use the no-comments option with the display inheritance command:

[edit]user@host# show | display inheritance no-comments
snmp {location "West of Nowhere";contact "My Engineering Group";community BasicAccess {authorization read-only;}}

Published: 2013-02-22