Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?




Hierarchy Level

All hierarchy levels


Use custom syntax in your configuration, which is expanded into standard Junos OS configuration statements during the commit process using the instructions defined in the corresponding commit script macro.

Macros work by locating apply-macro statements that you include in the candidate configuration and using the values specified in the apply-macro statement as parameters to a set of instructions (the macro) defined in a commit script. The commit script alters your configuration from one that contains custom syntax into a full configuration containing standard Junos OS statements.

In effect, your custom configuration syntax serves a dual purpose. The syntax allows you to simplify your configuration tasks, and it provides data (or hooks) that are used by commit script macros.

You can include the apply-macro statement at any level of the configuration hierarchy. You can include multiple apply-macro statements at each level of the configuration hierarchy; however, each must have a unique name.



Name of the apply-macro statement.


One or more parameters. Parameters can be any text you want to include in your configuration.


A value that corresponds to the parameter name. Parameter values can be any text you want to include in your configuration.

Required Privilege Level

configure—To enter configuration mode; other required privilege levels depend on where the statement is located in the configuration hierarchy.

Release Information

Statement introduced in Junos OS Release 7.4.