hobarton_config_templates/juniper-vxlan.j2

58 lines
1.4 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,tenant['vlans']) }}
{{ 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 {{ 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,tenant['spines']) }}
{% 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 {{ primary_ip4['address'][:-3] }}:1;
vrf-target {
target:64512:1111;
auto;
}
}
{{ junos.vlanssection(tenant['vlans'], device) }}
{% endif %}