Configuring VLAN Dynamic Profiles
Creating dynamic single-tag VLANs or stacked (dual-tag) VLANs requires the use of dynamic profiles. The dynamic profile automatically references the VLAN interface and creates the interface unit and the necessary VLAN IDs for each new single-tag VLAN or stacked VLAN.
![]() | Note: VLAN dynamic profiles do not support user-defined variables. Use only Junos VLAN predefined variables when configuring VLAN dynamic profiles. See Dynamic Variables Overview for information about dynamic variables. |
- Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Standard TPID Values
- Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Any TPID Values
- Configuring a Stacked VLAN Dynamic Profile
- Configuring a VLAN Dynamic Profile That Associates VLAN Interfaces with Separate Routing Instances
Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Standard TPID Values
You can configure a VLAN dynamic profile to create single-tag VLANs that accept only standard TPID values (a TPID value of 0x8100) by using use the vlan-id statement and the $junos-vlan-id variable.
![]() | Note: This procedure configures a dynamic profile that accepts only TPID values of 0x8100. To configure a VLAN dynamic profile for creating VLANs using any TPID values, see Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Any TPID Values. |
Before you begin:
- Configure the dynamic profile.
To configure a dynamic VLAN profile:
- Ensure that the VLAN dynamic profile uses the $junos-interface-ifd-name variable for the dynamic interface and the $junos-interface-unit variable for the interface unit.
- (Optional) To support dynamic demux interfaces,
enable them using the demux-source statement.
- For IPv4 demux interfaces, specify inet as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet
- For IPv6 demux interfaces, specify inet6 as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet6
- For IPv4 demux interfaces, specify inet as the
source type.
- (Optional) To configure the router to respond to
any ARP request, specify the proxy-arp statement.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set proxy-arp
- Specify that you want to use dynamic
VLAN IDs in the dynamic profile.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set vlan-id $junos-vlan-id
When the dynamic profile is instantiated, the variable is dynamically replaced with a VLAN ID within the VLAN range specified at the [interfaces] hierarchy level.
- Define the unit family type.
- For IPv4 interfaces, specify the inet family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet
- For IPv6 interfaces, specify the inet6 family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet6
- For IPv4 interfaces, specify the inet family
type.
- (Optional) Enable IP and MAC address validation
for dynamic demux interfaces in a dynamic profile.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set mac-validate strict
- Specify the unnumbered address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set unnumbered-address (Dynamic Profiles) lo.0
- Specify the preferred source address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set preferred-source-address 192.0.16.1
Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Any TPID Values
You can configure a VLAN dynamic profile to create single-tag VLANs that accept any TPID values by configuring the vlan-tags statement and the $junos-vlan-id variable.
![]() | Note: For procedures to configure a VLAN dynamic profile for creating single-tag VLANs that use only standard TPID values (a TPID value of 0x8100), see Configuring a VLAN Dynamic Profile for Creating Single-Tag VLANs Using Standard TPID Values. |
Before you begin:
- Configure the dynamic profile.
To configure a dynamic VLAN profile:
- Ensure that the VLAN dynamic profile uses the $junos-interface-ifd-name variable for the dynamic interface and the $junos-interface-unit variable for the interface unit.
- (Optional) To support dynamic demux interfaces,
enable them using the demux-source statement.
- For IPv4 demux interfaces, specify inet as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet
- For IPv6 demux interfaces, specify inet6 as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet6
- For IPv4 demux interfaces, specify inet as the
source type.
- (Optional) To configure the router to respond to
any ARP request, specify the proxy-arp statement.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set proxy-arp
- Specify that you want to use dynamic
VLAN IDs in the dynamic profile.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set vlan-tags outer $junos-vlan-id
The variable is dynamically replaced with both the TPID value and a VLAN ID within the VLAN range specified at the [interfaces] hierarchy level.
- Define the unit family type.
- For IPv4 interfaces, specify the inet family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet
- For IPv6 interfaces, specify the inet6 family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet6
- For IPv4 interfaces, specify the inet family
type.
- (Optional) Enable IP and MAC address validation
for dynamic demux interfaces in a dynamic profile.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set mac-validate strict
- Specify the unnumbered address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set unnumbered-address (Dynamic Profiles) lo.0
- Specify the preferred source address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set preferred-source-address 192.0.16.1
Configuring a Stacked VLAN Dynamic Profile
You can configure a dynamic profile for creating stacked 802.1Q VLANs.
Before you begin:
- Configure the dynamic profile.
To configure a stacked VLAN dynamic profile:
- Ensure that the VLAN dynamic profile uses the $junos-interface-ifd-name variable for the dynamic interface and the $junos-interface-unit variable for the interface unit.
- (Optional) To support dynamic demux interfaces,
enable them using the demux-source statement.
- For IPv4 demux interfaces, specify inet as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet
- For IPv6 demux interfaces, specify inet6 as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet6
- For IPv4 demux interfaces, specify inet as the
source type.
- (Optional) To configure the router to respond to
any ARP request, specify the proxy-arp statement.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set proxy-arp
- Specify the outer VLAN ID variable.[edit dynamic-profiles STACKED-VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set vlan-tags outer $junos-stacked-vlan-id
The variable is dynamically replaced with an outer VLAN ID within the VLAN range specified at the [interfaces] hierarchy level.
- Specify the inner VLAN ID variable.[edit dynamic-profiles STACKED-VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set vlan-tags inner $junos-vlan-id
The variable is dynamically replaced with an inner VLAN ID within the VLAN range specified at the [interfaces] hierarchy level.
- Define the unit family type.
- For IPv4 interfaces, specify the inet family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet
- For IPv6 interfaces, specify the inet6 family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet6
- For IPv4 interfaces, specify the inet family
type.
- (Optional) Enable IP and MAC address validation
for dynamic demux interfaces in a dynamic profile.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set mac-validate strict
- Specify the unnumbered address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set unnumbered-address (Dynamic Profiles) lo.0
- Specify the preferred source address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set preferred-source-address 192.0.16.1
Configuring a VLAN Dynamic Profile That Associates VLAN Interfaces with Separate Routing Instances
You can configure a VLAN dynamic profile that dynamically creates underlying VLAN interfaces and associates these interfaces with dynamically-created routing instances. The VLAN interface is created in the default logical system (LS) for a specific routing instance as defined by VSA 26–1 (LSRI-Name) on the AAA server (for example, RADIUS server).
To configure a dynamic VLAN profile using routing instances:
- Name the profile.[edit]user@host# edit dynamic-profiles VLAN_PROFILE_RI
- Specify that you want to dynamically
create routing instances on the default logical system.[edit dynamic-profiles VLAN_PROFILE_RI]user@host# edit routing-instances $junos-routing-instance
- Define the routing instance interface statement with the internal $junos-interface-name variable
used by the router to match the interface name of the receiving interface.[edit dynamic-profiles VLAN_PROFILE_RI routing-instances “$junos-routing-instance”]user@host# set interface $junos-interface-name
- Define the dynamic profile interfaces statement with the internal $junos-interface-ifd-name variable.[edit dynamic-profiles VLAN_PROFILE_RI]user@host# edit interfaces $junos-interface-ifd-name
- Define the unit statement with
the internal $junos-interface-unit variable used by the router
to generate a unit value for the interface.[edit dynamic-profiles VLAN_PROFILE_RI interfaces "$junos-interface-ifd-name"]user@host# edit unit $junos-interface-unit
- To support dynamic demux interfaces,
enable them using the demux-source statement.
- For IPv4 demux interfaces, specify inet as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet
- For IPv6 demux interfaces, specify inet6 as the
source type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set demux-source inet6
- For IPv4 demux interfaces, specify inet as the
source type.
- (Optional) To configure the router to respond to
any ARP request, specify the proxy-arp statement.[edit dynamic-profiles VLAN_PROFILE_RI interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set proxy-arp
- Specify that you want to use dynamic
VLAN IDs in the dynamic profile.[edit dynamic-profiles VLAN_PROFILE_RI interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set vlan-id $junos-vlan-id
The variable is dynamically replaced with both the TPID value and a VLAN ID within the VLAN range specified at the [interfaces] hierarchy level.
- Define the unit family type.
- For IPv4 interfaces, specify the inet family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet
- For IPv6 interfaces, specify the inet6 family
type.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit"]user@host# set family inet6
- For IPv4 interfaces, specify the inet family
type.
- (Optional) Enable IP and MAC address validation
for dynamic demux interfaces in a dynamic profile.[edit dynamic-profiles VLAN_PROFILE_RI interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set mac-validate strict
- Specify the unnumbered address to dynamically
create loopback interfaces.[edit dynamic-profiles VLAN_PROFILE_RI interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set unnumbered-address (Dynamic Profiles) $junos-loopback-interface
- (Optional) Specify the preferred source
address.[edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name" unit "$junos-interface-unit" family inet]user@host# set preferred-source-address 192.0.16.1

