Skip to content
Emer NetworkingEmer Networking
Go back

Mist Device Variables: One Template, Every Site

Edit post link disabled per config.

Juniper Mist is a cloud-managed networking platform for wireless access points and EX/QFX switches (among other devices). Configuration at scale is built around templates: WLAN templates for wireless, switch templates for wired. Those templates are meant to be shared. The values that change per site—VLAN IDs, management subnets, DNS, NTP—belong in variables, not in a pile of site-specific template copies.

This guide walks through using Mist device and site variables for wired and wireless only. WAN Edge / SSR is out of scope. The goal is one switch template and one WLAN template that stay identical everywhere, while site-specific values still resolve correctly—and a later template change (RADIUS timeout, port profile, radio settings) still lands at every site.

Official Juniper documentation for the features used here:

Assumptions

  • You already have Mist org access and at least two sites (or plan to).
  • APs and/or EX switches are claimed and assigned to sites.
  • You know how to open WLAN templates and switch templates in Mist.
  • You are standardizing on one WLAN template for a shared SSID and one switch template for the common wired design.
  • Out of scope: WAN Edge / SSR templates, theme/site branding, and inventing a full IP plan from scratch.

Why variables exist

Templates hold the shared design. Variables hold the differences. If you fork the template per site to hard-code VLAN 100 vs 110, the next org-wide change becomes a merge problem. If instead the template references {{corp_vlan}} and each site defines that name, the template stays one object.

Juniper’s own framing matches that model: one WLAN template, same variable names at each site, different values—see the VLAN example in Configure Site Variables.

Rules of the road (read these once)

Only VAR fields accept tokens

On configuration screens, look for the VAR indicator. Fields with that label accept site or device variables. Juniper documents this tip on the site-variables page.

Syntax

Use double curly braces:

{{variableName}}

Letters, numbers, and underscores only. No spaces. No other special characters. Names are case sensitive: {{Mgmt_VLAN}} and {{mgmt_vlan}} are different variables. Pick a convention early—lowercase with underscores works well ({{mgmt_vlan}}, {{site_id}}, {{corp_vlan}}, {{default_gateway}})—and keep it as you roll sites out.

Literal trap

If you type {{variableName}} into a field that does not accept variables, Mist does not substitute it. The string is stored as literal text. You will not get a friendly error; you get a VLAN or address that is wrong because the braces never expanded.

Passphrase

For this guide, do not use the SSID passphrase as a variable example. Do not put {{ }} tokens in PSK/passphrase fields. Stick to fields that clearly show VAR—VLAN ID is the wireless example below.

Configuration: site variables

Step 1: Open Site Configuration

  1. In the Mist portal, go to Organization → Admin → Site Configuration.
  2. Select the site.
  3. Scroll to Site Variables.

Site Configuration Site Variables panel listing names like {{corp_vlan}}, {{mgmt_vlan}}, and {{site_id}} with Add Variable and Import Variables

Step 2: Add or edit variables

In Site Variables, click Add Variable for a new name, or click an existing row to edit. For each row:

FieldWhat to enter
VariableName in braces, e.g. {{corp_vlan}}
ValueSite-specific value, e.g. 2
NoteOptional reminder (site nickname, allocation notes)

A practical starter set for multi-site rollouts:

{{site_id}}
{{corp_vlan}}
{{mgmt_vlan}}
{{default_gateway}}
{{dns_1}}
{{ntp_1}}

Edit Variables dialog for {{corp_vlan}} with Generic type and site-specific value

Click Save on the variable dialog, then click the top-right Save on the Site Configuration page. Juniper notes that variables listed in the section are not committed until that top-right Save.

Step 3: Export / import so you do not rebuild by hand

You can export and import variables so every site starts from the same name set.

  1. In Site Variables, use Import Variables.
  2. Download Site Variable List to get the CSV.
  3. Add new rows at the bottom (first column: {{name}}, second: value). Letters, numbers, underscores only in the name.
  4. Upload the CSV and Save.

Existing names in the file are ignored on upload so you do not clobber live values—confirm the import summary Mist shows. Details: Configure Site Variables.

Import Site Variables dialog with CSV upload and Download Site Variable List

Wireless: one WLAN template, VLAN as a variable

Shared SSIDs are the usual wireless case. Keep radio, security, and roaming settings in one WLAN template. Let the VLAN change per site (or per AP group) via a variable.

Step 4: Reference {{corp_vlan}} in the WLAN

  1. Open Organization → Wireless → WLAN Templates.
  2. Open the shared WLAN template, then edit the WLAN for the shared SSID.
  3. On the VLAN field, confirm you are in a field that accepts variables, then enter:
{{corp_vlan}}
  1. Leave the rest of the WLAN settings in the template—do not fork a second WLAN template just to change VLAN.

Site A resolves {{corp_vlan}} to one ID. Site B resolves it to another. Same template object. Same later edits for timeouts or radio settings.

Edit WLAN dialog showing Tagged VLAN ID set to {{corp_vlan}} on the shared SSID

Wired: switch template (strongest use)

Switch templates are where variables earn their keep. Mist’s wired model is hierarchical: organization template → site → device (template overview). Prefer variables over site overrides when the shape of the config is shared and only the values differ.

Step 5: Build L3 values from site_id and gateway variables

In the switch template, use composed addresses and gateway variables instead of hard-coding per site. Examples that stay in one template:

192.{{site_id}}.1.6
{{default_gateway}}
10.{{site_id}}.{{mgmt_vlan}}.1
PatternWhat it solves
192.{{site_id}}.1.6NTP (or similar) that embeds the site octet
{{default_gateway}}Static route next hop that differs per site
10.{{site_id}}.{{mgmt_vlan}}.1Fully composed management gateway

Same template. Same port profiles. Different resolved addresses.

Step 6: DNS and NTP fields with the VAR badge

Open the switch template and find NTP Servers / DNS Servers. Both show the VAR badge when variables are allowed. Put tokens (or mixed literals + tokens) there, and keep the rest of the template shared.

Switch template NTP Servers using 192.{{site_id}}.1.6 with VAR badge, DNS Servers with VAR badge, and static route to {{default_gateway}}

Step 7 (optional): switch-level variables

When two switches at the same site need different values under one template, open the switch → Management → Device Variables. Syntax is the same {{variable_name}}. If a device variable and a site variable share a name, the device variable wins. Procedure: Configure Switch-Level Variables.

Switch details Device Variables tile with Import Variables and Add Variables

Inside a site: device-profile variables

Sometimes the split is not site-vs-site. Clinical wing vs lobby APs can share an SSID and still need different VLANs. Define variables on the device profile, reference them from the WLAN template, and attach the profile to the right AP group. See Variables in Device Profiles.

The Variables section lives on the device profile form (Add Variable). Use it when you need AP-group differences inside one site while the WLAN template stays shared.

Device profile form Variables section with Add Variable

Precedence

Highest wins:

  1. AP (device) variable
  2. Device profile variable
  3. Site variable

Set the most specific layer you need. Do not define the same name at every layer “just in case.”

Validation checklist

  • Site Configuration → variables saved with top-right Save.
  • Every token in templates sits in a VAR-capable field (no literal {{...}} left in non-VAR fields).
  • Case matches exactly across sites ({{corp_vlan}} everywhere, not mixed case).
  • Spot-check one AP and one switch per site after apply (Mist UI + client VLAN / gateway as appropriate).

Practical takeaway

Templates are the contract. Variables are the fill-ins. Confirm VAR before you type {{anything}}. Keep names case-stable. Parameterize VLANs, site IDs, gateways, DNS, and NTP—not fields that only accept literals. Export/import the variable name set as you add sites. Do that, and one switch template plus one WLAN template can serve the rollout without turning into a museum of site forks.


Back to top
Edit post link disabled per config.

Previous Post
HPE Juniper Wired 802.1X Authentication with ClearPass
Next Post
Bench Tools: answers that stay in the browser
EOF