2017-01-19 23:27:29 +01:00
|
|
|
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') %}
|
2017-01-20 00:30:22 +01:00
|
|
|
protocol static {
|
|
|
|
route 172.20.72.0/21 unreachable;
|
|
|
|
}
|
|
|
|
|
2017-01-19 23:27:29 +01:00
|
|
|
protocol bgp {
|
|
|
|
local as {{ pillar['bgp']['asn'] }};
|
|
|
|
import all;
|
|
|
|
{%- for host, neighbor in pillar['bgp']['peers-inet'].items() %}
|
|
|
|
neighbor {{ host }} as {{ neighbor.asn }};
|
|
|
|
{%- endfor %}
|
2017-01-20 00:30:22 +01:00
|
|
|
export where source=RTS_STATIC;
|
2017-01-19 23:27:29 +01:00
|
|
|
}
|
|
|
|
{%- endif %}
|