Overview of Creating Custom Configuration Syntax with Commit Script Macros
Using commit script macros, you can create a custom configuration language based on simplified syntax that is relevant to your network design. This means you can use your own aliases for frequently used configuration statements.
Commit scripts generally impose restrictions on the Junos OS configuration and automatically correct configuration mistakes when they occur (as discussed in Overview of Generating Persistent or Transient Configuration Changes Using Commit Scripts). However, macros are useful for an entirely different reason. Commit scripts that contain macros do not generally correct configuration mistakes, nor do they necessarily restrict configuration. Instead, they provide a way to simplify and speed configuration tasks, thereby preventing mistakes from occurring at all.
For a detailed example of how macros can save time and effort, see Example: Automatically Configuring Logical Interfaces and IP Addresses.