Files
as205079-automation/ansible/roles/bird2/templates/bgp_announce.conf.j2

28 lines
753 B
Django/Jinja

{%- if enable_bgp %}
# Static routes for our network
{%- for afi in afis %}
{% if afi == 4 and enable_ipv4 or afi == 6 %}
{% for route in bgp['prefixes'][afi] %}
protocol static 'announce_{{ bgp['prefixes'][afi][route]["name"] }}_v{{ afi }}' {
route {{ route }} reject;
ipv{{ afi }} {
import filter {
# Import static routes into bird routing table
bgp_large_community.add((myasn, lc_route_relation, 1)); # Route originated internally
{% for community in bgp['prefixes'][afi][route]["add_communities"] %}
bgp_large_community.add(({{ community }}));
{% endfor %}
accept;
};
export none; # Do not export routes to this proto
};
}
{% endfor %}
{% endif %}
{% endfor %}
{% else %}
# bgp is not enabled
{% endif %}