Configure Switch-Level Variables
Follow these steps to create switch-level variables to use in your templates.
You can streamline and standardize the Juniper Mist™ configuration process by using device-level variables in your switch configuration. Device variables are similar to site variables, except that they are scoped to a specific switch rather than a site. You can define them as key-value pairs and reference them in configuration fields using the {{variable_name}} syntax.
Switch-level variables allow you to apply unique configuration values per switch, even when multiple switches are associated with the same switch template, as shown in the following example:
You configure the variable {{VLAN0}} with VLAN ID 100 on Switch A and VLAN ID 200 on Switch B.

Assign both switches to a switch template that specifies the VLAN ID as {{VLAN0}}.

Now, Switch A receives VLAN ID 100, while Switch B receives VLAN ID 200.
Switch-level variables are supported for the following configuration fields:
-
DNS servers and DNS suffix
-
NTP servers
-
Networks (VLAN ID, subnet, subnet mask)
-
IP Configuration (Inband Management): IP address, subnet mask, default gateway, primary DNS, secondary DNS, DNS suffix — for both IPv4 and IPv6
-
IP Configuration (Out-of-Band): IP address, subnet mask
-
Additional IP Configuration
-
Authentication servers (RADIUS and accounting server hostname/IP)
-
TACACS+ servers (server and accounting server hostname/IP)
-
Static routes (destination, next hop)
-
SNMP (v2 and v3): name, location, contact, description, source address
When working on configuration screens, look for the VAR indicators. Fields with this indicator allow variables.

To configure switch variables:
After configuring switch variables on multiple switches, use these variables in the associated switch template. Each switch associated with the template receives its own unique configuration values based on the variables configured on that switch.

