network/salt/bird/bird.conf

49 lines
1.2 KiB
Plaintext

protocol kernel {
scan time 10;
import none;
export all;
}
protocol device {
scan time 10;
}
protocol ospf ZW4 {
area 0 {
networks {
172.20.72.0/21;
};
{%- for iface, ips in salt['grains.get']('ip_interfaces').items() %}
{%- set subnet = pillar['subnets-inet'].get(iface) %}
{%- if iface == 'core' or iface == 'br-core' %}
interface "{{ iface }}" {
authentication cryptographic;
password "{{ pillar['ospf']['secret'] }}";
};
{%- elif subnet %}
stubnet {{ subnet }} {};
{%- endif %}
{%- endfor %}
{%- if pillar['ospf'].get('stubnets-inet') %}
{%- for stubnet in pillar['ospf']['stubnets-inet'] %}
stubnet {{ stubnet }} {};
{%- endfor %}
{%- endif %}
};
}
{%- if pillar.get('bgp') %}
protocol static {
route 172.20.72.0/21 unreachable;
}
protocol bgp {
local as {{ pillar['bgp']['asn'] }};
import all;
{%- for host, neighbor in pillar['bgp']['peers-inet'].items() %}
neighbor {{ host }} as {{ neighbor.asn }};
{%- endfor %}
export where source=RTS_STATIC;
}
{%- endif %}