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.
![]() |
Caution: 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. |
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.
![]() |
Caution: 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:
To configure a dynamic VLAN profile:
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set demux-source inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set proxy-arp
- [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.
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set family inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set mac-validate strict
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set unnumbered-address lo.0
- [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
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:
To configure a dynamic VLAN profile:
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set demux-source inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set proxy-arp
- [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.
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set family inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set mac-validate strict
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set unnumbered-address lo.0
- [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
You can configure a dynamic profile for creating stacked 802.1Q VLANs.
Before you begin:
To configure a stacked VLAN dynamic profile:
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set demux-source inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set proxy-arp
- [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.
- [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.
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit"]
- user@host# set family inet
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set mac-validate strict
- [edit dynamic-profiles VLAN-PROF1 interfaces "$junos-interface-ifd-name"
unit "$junos-interface-unit" family inet]
- user@host# set unnumbered-address lo.0
- [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