Study guide
4.2 Templates and Template Stacks Configuration
Palo Alto Networks Certified Next-Generation Firewall Engineer Exam
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Device Deployment & Architecture
1.1 Platform Selection & Sizing: Hardware, VM-Series, and Cloud NGFW Form Factors 1.2 Base PAN-OS 11.x System Settings, Management Interfaces, and Service Routes 1.3 Interface Types, Zone Topologies, and Virtual Wire Configurations 1.4 Site-to-Site VPN Tunnels: IPSec, GRE, and Quantum-Resistant Cryptography
2 Chapter 2: Routing, VRFs, and Virtual Routers
2.1 Virtual Routers and VRF Architecture in PAN-OS 11.x 2.2 Static Routing, BGP, and OSPF Configuration & Failover 2.3 Policy-Based Forwarding (PBF) and Path Monitoring
3 Chapter 3: NAT and High Availability Designs
3.1 Source, Destination, and Twice-NAT Policy Configurations 3.2 High Availability Active/Passive Architecture and State Synchronization 3.3 High Availability Active/Active Architecture and HA Clustering
4 Chapter 4: Panorama Management & Policy Hierarchy
4.1 Panorama Architecture: Collector Groups, Log Collectors, and Device Registration 4.2 Templates and Template Stacks Configuration 4.3 Device Groups, Shared Rulestacks, and Policy Hierarchy
5 Chapter 5: Strata Cloud Manager and AIOps
5.1 Strata Cloud Manager (SCM) Architecture and Cloud-Delivered Management 5.2 SCM Rulestacks, Folder Hierarchies, and Unified Policy Management 5.3 AIOps for NGFW: Telemetry, Proactive Best-Practice Audits, and Operational Insights
6 Chapter 6: Security Profiles and Content Inspection
6.1 Antivirus, Anti-Spyware, and DNS Security Profiles 6.2 Vulnerability Protection, Custom Signatures, and Threat Exceptions 6.3 URL Filtering, Advanced WildFire Analysis, and Inline Deep Learning
7 Chapter 7: Decryption Inspection & Policy
7.1 SSL Forward Proxy Architecture and Internal Certificate Authority Trust 7.2 SSL Inbound Inspection for Internal Web Servers 7.3 Decryption Exclusions, HSM Integration, and Troubleshooting Decryption Failures
8 Chapter 8: User Identity and GlobalProtect Remote Access
8.1 User-ID Architecture, Agentless/Agent Deployment, and Cloud Identity Engine (CIE) 8.2 GlobalProtect Portals, Gateways, and Authentication Methods (SAML, MFA) 8.3 Host Information Profile (HIP) Checks and Endpoint Security Enforcement
9 Chapter 9: Cloud NGFW, Automation, and API Integration
9.1 Cloud NGFW for AWS and Azure Architectures (GWLB and VWAN) 9.2 XML and REST API Automation with Palo Alto Networks Firewalls 9.3 Infrastructure as Code: Terraform and Ansible Automation for PAN-OS 9.4 CN-Series, AI Runtime Security, and Edge Deployment Options
10 Chapter 10: Virtual Systems, Logging, and Operational Monitoring
10.1 Virtual Systems (VSYS), Logical Routers, and Inter-VSYS Routing 10.2 Logging Architecture: Strata Logging Service, Log Forwarding, and Collectors 10.3 Application Command Center (ACC), Dashboards, and Custom Reporting 10.4 Explicit and Transparent Web Proxy on PAN-OS
4.2 Templates and Template Stacks Configuration
Key Takeaways Explain This Topic AI
Templates contain Network and Device configuration settings, while Template Stacks group multiple ordered templates to push unified baseline settings to managed firewalls.
Template Stacks evaluate templates from top to bottom, where settings in higher-positioned templates take precedence over identical settings defined in lower templates.
Template Variables permit site-specific values (such as WAN IP addresses, default gateways, BGP AS numbers, and DNS servers) without breaking centralized template inheritance.
Local firewall configurations override inherited template stack settings; administrators can inspect local overrides and revert them to template-defined values when needed.
Last updated: July 2026
4.2 Templates and Template Stacks Configuration
Managing network interfaces, routing protocols, VPN tunnels, and system services across dozens or hundreds of firewalls requires a structured configuration framework. Panorama separates firewall configuration into two distinct domains: Device Groups (which handle security policies and objects) and Templates / Template Stacks (which handle network interfaces, zones, virtual routers, and system parameters).
Templates vs. Template Stacks
Understanding the distinction between an individual Template and a Template Stack is essential for designing scalable Panorama management architectures.
What is a Template?
A Template is an individual container for Network and Device configuration settings. A single template can define standard settings that apply across multiple firewalls. The configuration scopes covered by templates include:
Network Tab Settings: Ethernet interfaces, aggregate ethernet (AE) groups, VLANs, loopback interfaces, security zones, virtual routers (OSPF, BGP, static routes), IPsec VPN tunnels, and GlobalProtect gateways/portals.
Device Tab Settings: System setup (hostname, DNS servers, NTP servers, time zone), administrator user accounts, authentication profiles, SNMP configuration, syslog/email server profiles, and master key settings.
What is a Template Stack?
A Template Stack is an ordered sequence of individual templates combined together and assigned to specific target firewalls. Managed firewalls are assigned to a Template Stack , never directly to an isolated individual template. Key principles of template stacks include:
Ordered Inheritance: Templates inside a stack are arranged in a strict top-to-bottom hierarchy.
Top-Down Precedence: If the same configuration setting (e.g., a primary DNS server IP) is defined in multiple templates within the same stack, the value defined in the highest-positioned template in the stack overrides the values in lower templates.
Direct Firewall Association: A firewall can belong to only one Template Stack at a time, but a single template can be included in multiple Template Stacks.
Hierarchy of Configuration Settings
When a firewall processes its active configuration, settings are evaluated in a clear order of precedence:
Local Firewall Configuration (Highest Precedence): Settings configured directly on the firewall local management web interface or CLI. Local settings override all template stack inherited values.
Template Stack Overrides: Variable overrides or stack-level modifications configured in Panorama at the Template Stack level.
Top Template in Stack: Settings defined in the top-most template within the assigned stack.
Subsequent Templates in Stack (Top to Bottom): Settings inherited from lower templates in the stack.
Bottom Template in Stack (Lowest Precedence): Baseline or global settings defined in the bottom-most template (e.g., global NTP or DNS parameters). [ Local Firewall Config ] --> Overrides Template Stack
- |
- [ Template Stack Overrides / Variables ]
- |
- [ Template 1 (Top) ] --> Overrides Template 2 & 3
- |
- [ Template 2 (Middle) ] --> Overrides Template 3
- |
- [ Template 3 (Bottom) ] --> Global Baseline Settings
- Template Variables and Dynamic Parameterization
In multi-site deployments, firewalls share common networking structures (such as static route frameworks, BGP configurations, or zone definitions) but require unique, site-specific parameters (such as WAN interface IP addresses, peer AS numbers, or local gateway IPs). Panorama resolves this through Template Variables .
Variable Definition and Types
Variables are created inside a template or template stack using a dollar sign prefix (e.g., $WAN_IP , $NEXT_HOP_GW , $BGP_LOCAL_AS ). Supported variable types include:
IP Address / Subnet: Used for interface IP addresses, static route next-hops, and server IPs.
Interface Name: Used to dynamically assign physical interface identifiers (e.g., ethernet1/1 vs ethernet1/5 ).
Autonomous System (AS) Number: Used in BGP routing protocol definitions.
Text String: Used for hostnames, domain names, or profile identifiers.
Egress Interface: Used in routing and NAT definitions. Example Variable Syntax:
- Interface IP: $FW_WAN_IP / 30
- Next-Hop Gateway: $WAN_GATEWAY_IP
- BGP Local AS: $SITE_BGP_AS
- Overriding Variables Per Managed Device
Administrators assign default variable values at the Template or Template Stack level. To customize parameters for an individual firewall, the administrator selects the specific device under Panorama > Templates > Stack > Variable Overrides and supplies device-specific values. When Panorama pushes the stack to that firewall, it substitutes the template variables with the device-specific values, achieving customized local configuration without duplicating templates.
Managing Local Overrides and Inherited Values
When a template stack is pushed to a firewall, the firewall GUI visually distinguishes between template-inherited settings and local settings:
Inherited Values (Green Text / Template Icon): Indicate settings pushed from a Panorama Template Stack. These fields are read-only on the firewall unless explicitly overridden.
Local Overrides (Red/Yellow Background or Override Indicator): Indicate settings that were modified locally on the firewall or overridden via local CLI/GUI actions.
Reverting Local Overrides
Local overrides can introduce configuration drift and defeat centralized management. Administrators can revert local overrides back to template-inherited values using two methods:
Revert Button on Firewall: On the firewall GUI, select the overridden field and click Revert to discard local changes and restore the template stack value.
Force Template Values During Push: During a Panorama Push to Devices operation, check the Force Template Values option. This forcefully overwrites all local network and device settings on the target firewalls with the exact values defined in the Panorama Template Stack.
Multi-Tenant and Enterprise Template Architecture
Best-practice enterprise design utilizes a layered, modular template stack structure:
Base System Template (Bottom of Stack): Contains universal corporate settings such as DNS servers, NTP servers, SNMP community strings, syslog server profiles, and admin authentication settings.
Regional Template (Middle of Stack): Contains region-specific routing rules, time zones, regional syslog collectors, and shared IPsec VPN profiles.
Site-Specific / Model-Specific Template (Top of Stack): Contains hardware-specific interface mappings (e.g., PA-3410 vs PA-5450 port layouts) and site-unique variables.
Templates vs. Template Stacks Comparison
- Feature / Attribute Individual Template Template Stack
- Primary Purpose Defines discrete Network & Device settings Combines & orders templates for firewall deployment
- Direct Firewall Assignment No (assigned via Template Stack) Yes (firewalls assign directly to one stack)
- Precedence Resolution N/A (single container) Evaluated top-to-bottom within the stack
- Variable Override Location Defines default variable names/values Overrides variable values per managed device
- Target Scope Network & Device tabs only Network & Device tabs only