summaryrefslogtreecommitdiff
path: root/data/templates/frr/babeld.frr.j2
blob: 344a5f988b079e31e3ca5b02f17152d7bc42deac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{% from 'frr/distribute_list_macro.j2' import render_distribute_list %}
{% from 'frr/ipv6_distribute_list_macro.j2' import render_ipv6_distribute_list %}
!
{# Interface specific configuration #}
{% if interface is vyos_defined %}
{%     for iface, iface_config in interface.items() %}
interface {{ iface }}
{%         if iface_config.type is vyos_defined('wired') or iface_config.type is vyos_defined('wireless') %}
 babel {{ iface_config.type }}
{%         endif %}
{%         if iface_config.split_horizon is vyos_defined("enable") %}
 babel split-horizon
{%         elif iface_config.split_horizon is vyos_defined("disable") %}
 no babel split-horizon
{%         endif %}
{%         if iface_config.hello_interval is vyos_defined %}
 babel hello-interval {{ iface_config.hello_interval }}
{%         endif %}
{%         if iface_config.update_interval is vyos_defined %}
 babel update-interval {{ iface_config.update_interval }}
{%         endif %}
{%         if iface_config.rxcost is vyos_defined %}
 babel rxcost {{ iface_config.rxcost }}
{%         endif %}
{%         if iface_config.rtt_decay is vyos_defined %}
 babel rtt-decay {{ iface_config.rtt_decay }}
{%         endif %}
{%         if iface_config.rtt_min is vyos_defined %}
 babel rtt-min {{ iface_config.rtt_min }}
{%         endif %}
{%         if iface_config.rtt_max is vyos_defined %}
 babel rtt-max {{ iface_config.rtt_max }}
{%         endif %}
{%         if iface_config.max_rtt_penalty is vyos_defined %}
 babel max-rtt-penalty {{ iface_config.max_rtt_penalty }}
{%         endif %}
{%         if iface_config.enable_timestamps is vyos_defined %}
 babel enable-timestamps
{%         endif %}
{%         if iface_config.channel is vyos_defined %}
 babel channel {{ iface_config.channel | replace("non-interfering", "noninterfering") }}
{%         endif %}
exit
!
{%     endfor %}
{% endif %}
!
{# Babel configuration #}
router babel
{% if parameters.diversity is vyos_defined %}
 babel diversity
{% endif %}
{% if parameters.diversity_factor is vyos_defined %}
 babel diversity-factor {{ parameters.diversity_factor }}
{% endif %}
{% if parameters.resend_delay is vyos_defined %}
 babel resend-delay {{ parameters.resend_delay }}
{% endif %}
{% if parameters.smoothing_half_life is vyos_defined %}
 babel smoothing-half-life {{ parameters.smoothing_half_life }}
{% endif %}
{% if interface is vyos_defined %}
{%     for iface, iface_config in interface.items() %}
 network {{ iface }}
{%     endfor %}
{% endif %}
{% if redistribute is vyos_defined %}
{%     for address_family in redistribute %}
{%         for protocol, protocol_config in redistribute[address_family].items() %}
{%             if protocol is vyos_defined('ospfv3') %}
{%                 set protocol = 'ospf6' %}
{%             endif %}
 redistribute {{ address_family }} {{ protocol }}
{%         endfor %}
{%     endfor %}
{% endif %}
{% if distribute_list.ipv4 is vyos_defined %}
{{ render_distribute_list(distribute_list.ipv4) }}
{% endif %}
{% if distribute_list.ipv6 is vyos_defined %}
{{ render_ipv6_distribute_list(distribute_list.ipv6) }}
{% endif %}
exit
!
end