ansible/roles/bird/templates/bird/bird6.conf.j2

66 lines
1.8 KiB
Django/Jinja

{{ ansible_header | comment }}
# This is a minimal configuration file, which allows the bird daemon to start
# but will not cause anything else to happen.
#
# Please refer to the documentation in the bird-doc package or BIRD User's
# Guide on http://bird.network.cz/ for more information on configuring BIRD and
# adding routing protocols.
# Change this into your BIRD router ID. It's a world-wide unique identification
# of your router, usually one of router's IPv6 addresses.
router id {{ bird.ipv6.id }};
{% for bind in bird.ipv6.binds %}
listen bgp address {{ bind }} port 179;
{% endfor %}
# The Kernel protocol is not a real routing protocol. Instead of communicating
# with other routers in the network, it performs synchronization of BIRD's
# routing tables with the OS kernel.
protocol kernel {
# persist;
scan time 60;
import none;
{% if bird.ipv6.kernel_filter is defined %}
export filter {
if ( net ~ [ {{ bird.ipv6.kernel_filter|join(', ') }} ] ) then reject;
accept;
};
{% else %}
export all;
{% endif %}
}
# The Device protocol is not a real routing protocol. It doesn't generate any
# routes and it only serves as a module for getting information about network
# interfaces from the kernel.
protocol device {
scan time 60;
}
protocol static {
{% for route in bird.ipv6.statics %}
route {{ route }} reject;
{% endfor %}
}
{%for bgp in bird.ipv6.bgps %}
protocol bgp {{ bgp.name }} {
{% if bgp.local.address is defined %}
local {{ bgp.local.address }} as {{ bgp.local.as }};
{% else %}
local as {{ bgp.local.as }};
{% endif %}
{% if bgp.allow_local_as is defined %}
allow local as {{ bgp.allow_local_as }};
{% endif %}
neighbor {{ bgp.remote.address }} as {{ bgp.remote.as }};
import all;
export filter {
if ( net ~ [ {{ bgp.allow_export_prefixes|join(', ') }} ] ) then accept;
reject;
};
}
{% endfor %}