NetStacksNetStacks

Example Templates

Ready-to-use template examples for common configurations.

SNMP Configuration

snmp-ios.j2jinja2
{# SNMP Configuration Template - Cisco IOS #}
snmp-server community {{ snmp_ro_community }} RO
{% if snmp_rw_community %}
snmp-server community {{ snmp_rw_community }} RW
{% endif %}
snmp-server location {{ location | default('Not Set') }}
snmp-server contact {{ contact | default('noc@company.com') }}
snmp-server enable traps
{% for trap_host in trap_hosts %}
snmp-server host {{ trap_host }} version 2c {{ snmp_ro_community }}
{% endfor %}

NTP Configuration

ntp-multi.j2jinja2
{# NTP Configuration Template - Multi-vendor #}
{% if device_type == 'cisco_ios' %}
{% for server in ntp_servers %}
ntp server {{ server }}{% if loop.first %} prefer{% endif %}

{% endfor %}
ntp source {{ source_interface | default('Loopback0') }}
{% elif device_type == 'juniper_junos' %}
set system ntp boot-server {{ ntp_servers[0] }}
{% for server in ntp_servers %}
set system ntp server {{ server }}{% if loop.first %} prefer{% endif %}

{% endfor %}
{% endif %}

Access Control List

acl-standard.j2jinja2
{# Standard ACL Template #}
ip access-list standard {{ acl_name }}
{% for entry in acl_entries %}
 {{ entry.action }} {{ entry.source }}{% if entry.wildcard %} {{ entry.wildcard }}{% endif %}

{% endfor %}
 deny any log

Interface Configuration

interface-switchport.j2jinja2
{# Interface Configuration Template #}
interface {{ interface_name }}
 description {{ description }}
{% if mode == 'access' %}
 switchport mode access
 switchport access vlan {{ vlan_id }}
{% elif mode == 'trunk' %}
 switchport mode trunk
 switchport trunk allowed vlan {{ allowed_vlans | join(',') }}
{% endif %}
{% if enable_portfast %}
 spanning-tree portfast
{% endif %}
 no shutdown