hobarton_config_templates/juniper-vxlan.j2

58 lines
1.5 KiB
Django/Jinja

{% import "juniper-macros.j2" as junos %}
{{ junos.systemsection(device,root_pw,users,syslog_servers,ntp_servers) }}
{% if device.role.name == 'Leaf' %}
{{ junos.chassissection(device,breakout_ports) }}
{% endif %}
{{ junos.interfacesection(device,ipam.VLAN.objects.filter(tenant=device.tenant)) }}
{{ junos.snmpsection(rack, snmp) }}
{% if device.role.name == 'Leaf' %}
forwarding-options {
storm-control-profiles default {
all;
}
}
{% endif %}
policy-options {
policy-statement BGP_LOOPBACK0 {
term TERM1 {
from {
protocol direct;
route-filter {{ device.primary_ip4.address }} exact;
}
then accept;
}
}
policy-statement PFE-ECMP {
then {
load-balance per-packet;
}
}
}
{{ junos.routingoptionssection(primary_ip4, overlay_as, gateway) }}
protocols {
{{ junos.bgpsection(device,dcim.Device.objects.filter(tenant=device.tenant,role__name='Spine')) }}
{% if device.role.name == 'Leaf' %}
evpn {
encapsulation vxlan;
extended-vni-list all;
}
{% endif %}
lldp {
interface all;
}
{% if sflow %}
{{ junos.sflowsection(sflow) }}
{% endif %}
}
{% if device.role.name == 'Leaf' %}
switch-options {
vtep-source-interface lo0.0;
route-distinguisher {{ device.primary_ip4.address.ip }}:1;
vrf-target {
target:64512:1111;
auto;
}
}
{{ junos.vlanssection(ipam.VLAN.objects.filter(tenant=device.tenant), device) }}
{% endif %}