Files

46 lines
1.2 KiB
Django/Jinja

{% if enable_bgp %}
{% if probes is defined and probes | length > 0 %}
{% for peer in probes | sort(attribute='asn,name') %}
{% for afi in afis %}
{% if afi == 4 and peer.peer_ipv4 is defined or afi == 6 and peer.peer_ipv6 is defined %}
protocol bgp 'probe_AS{{ peer.asn }}_{{ peer.name }}_v{{ afi }}' {
local as myasn;
{% if afi == 4 %}
neighbor {{ peer.peer_ipv4 }} as {{ peer.asn }};
source address {{ peer.source_ipv4 }};
{% else %}
neighbor {{ peer.peer_ipv6 }} as {{ peer.asn }};
source address {{ peer.source_ipv6 }};
{% endif %}
ipv6 {
export filter {
if ((myasn, 1, 1) ~ bgp_large_community) then accept; # Internal
if ((myasn, 1, 2) ~ bgp_large_community) then accept; # Customer
if ((myasn, 1, 3) ~ bgp_large_community) then accept; # Peering
if ((myasn, 1, 4) ~ bgp_large_community) then accept; # Transit
reject;
};
import none;
{% if peer.addpaths %}
add paths;
{% endif %}
};
{% if peer.rr_client | default(false) %}
rr client;
{% endif %}
{% if peer.multihop | default(false) %}
multihop 255;
{% endif %}
}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% else %}
# bgp is not enabled
{% endif %}