Dynamic Variables Overview
Variables constitute the dynamic component of a dynamic profile. You use variables in dynamic profiles as placeholders for dynamically obtained or dynamically generated information that the dynamic profiles use to configure subscriber interfaces.
How Dynamic Variables Work
Dynamic variables are data placeholders that you define and place in dynamic profiles. When a particular event occurs on an interface (for example, a DHCP client accesses the interface), the dynamic profiles obtain data to fill these placeholders from one of three possible sources—the interface receiving an incoming client data packet, an externally configured server (for example, RADIUS), an internal default value associated with each user-configurable variable.
For your convenience, JUNOS Software provides several predefined variables that you can use within a dynamic profile. Most of these variables relate to interface-specific data obtained directly from the interface that receives an incoming client data packets (for example, interface name, interface unit value, and so on). When a client accesses the interface, the router software extracts the necessary interface data, propagates this data to the dynamic profile, and then uses the dynamic profile to configure the interface for the accessing client.
You define user-defined variables for individual dynamic profiles at the [dynamic-profiles profile-name variables] hierarchy level. At this hierarchy level, you create an association between a variable call value (for example, $junos-igmp-version) that appears in the body of the dynamic profile and data associated with that call value that is managed in an externally configured server (for example, a RADIUS VSA managed on a RADIUS server) or defined as a default value in the variables stanza. When an event occurs on an interface to trigger the instantiation of a dynamic profile for the interface, the JUNOS Software obtains values for each variable from an external server (for example, from RADIUS authentication and authorization VSAs) during the subscriber authentication process or from the default value if the external server is not available or does not contain a value for the variable to use. At run time, the variables are replaced by these actual values and are used to configure the subscriber interface.
![]() | Note: Most variables have a default value already configured in the JUNOS Software. The purpose of these defaults is to ensure that the dynamic profile contains a valid value if one is not created and assigned during dynamic profile configuration. However, we strongly recommend that you specifically define variables instead and not rely on the existence of an internal JUNOS default. |


