summaryrefslogtreecommitdiff
path: root/data/templates/frr/ldpd.frr.tmpl
blob: 5a67b5cdf50ed325eeade0fdabaa7b5db1ca226f (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
!
{% if ldp is vyos_defined %}
mpls ldp
{%   if ldp.router_id is vyos_defined %}
 router-id {{ ldp.router_id }}
{%   endif %}
{%   if ldp.parameters.cisco_interop_tlv is vyos_defined %}
 dual-stack cisco-interop
{%   endif %}
{%   if ldp.parameters.transport_prefer_ipv4 is vyos_defined %}
 dual-stack transport-connection prefer ipv4
{%   endif %}
{%   if ldp.parameters.ordered_control is vyos_defined %}
 ordered-control
{%   endif %}
{%   if ldp.neighbor is vyos_defined %}
{%     for neighbor, neighbor_config in ldp.neighbor %}
{%       if neighbor_config.password is vyos_defined %}
 neighbor {{ neighbors }} password {{ neighbor_config.password }}
{%       endif %}
{%       if neighbor_config.ttl_security is vyos_defined %}
{%         if neighbor_config.ttl_security.disable is vyos_defined%}
 neighbor {{ neighbors }} ttl-security disable
{%         else %}
 neighbor {{ neighbors }} ttl-security hops {{ neighbor_config.ttl_security }}
{%         endif %}
{%       endif %}
{%       if neighbor_config.session_holdtime is vyos_defined %}
 neighbor {{ neighbors }} session holdtime {{ neighbor_config.session_holdtime }}
{%       endif %}
{%     endfor %}
{%   endif %}
 !
{%   if ldp.discovery.transport_ipv4_address is vyos_defined %}
 address-family ipv4
{%     if ldp.allocation.ipv4.access_list is vyos_defined %}
  label local allocate for {{ ldp.allocation.ipv4.access_list }}
{%     else %}
  label local allocate host-routes
{%     endif %}
{%     if ldp.discovery.transport_ipv4_address is vyos_defined %}
  discovery transport-address {{ ldp.discovery.transport_ipv4_address }}
{%     endif %}
{%     if ldp.discovery.hello_ipv4_holdtime is vyos_defined %}
  discovery hello holdtime {{ ldp.discovery.hello_ipv4_holdtime }}
{%     endif %}
{%     if ldp.discovery.hello_ipv4_interval is vyos_defined %}
  discovery hello interval {{ ldp.discovery.hello_ipv4_interval }}
{%     endif %}
{%     if ldp.discovery.session_ipv4_holdtime is vyos_defined %}
  session holdtime {{ ldp.discovery.session_ipv4_holdtime }}
{%     endif %}
{%     if ldp.import.ipv4.import_filter.filter_access_list is vyos_defined %}
{%       if ldp.import.ipv4.import_filter.neighbor_access_list is vyos_defined %}
  label remote accept for {{ ldp.import.ipv4.import_filter.filter_access_list }} from {{ ldp.import.ipv4.import_filter.neighbor_access_list }}
{%       else %}
  label remote accept for {{ ldp.import.ipv4.import_filter.filter_access_list }}
{%       endif %}
{%     endif %}
{%     if ldp.export.ipv4.explicit_null is vyos_defined %}
  label local advertise explicit-null
{%     endif %}
{%     if ldp.export.ipv4.export_filter.filter_access_list is vyos_defined %}
{%       if ldp.export.ipv4.export_filter.neighbor_access_list is vyos_defined %}
  label local advertise for {{ ldp.export.ipv4.export_filter.filter_access_list }} to {{ ldp.export.ipv4.export_filter.neighbor_access_list }}
{%       else %}
  label local advertise for {{ ldp.export.ipv4.export_filter.filter_access_list }}
{%       endif %}
{%     endif %}
{%     if ldp.targeted_neighbor is vyos_defined %}
{%       if ldp.targeted_neighbor.ipv4.enable is vyos_defined %}
  discovery targeted-hello accept
{%       endif %}
{%       if ldp.targeted_neighbor.ipv4.hello_holdtime is vyos_defined %}
  discovery targeted-hello holdtime {{ ldp.targeted_neighbor.ipv4.hello_holdtime }}
{%       endif %}
{%       if ldp.targeted_neighbor.ipv4.hello_interval is vyos_defined %}
  discovery targeted-hello interval {{ ldp.targeted_neighbor.ipv4.hello_interval }}
{%       endif %}
{%       for addresses in ldp.targeted_neighbor.ipv4.address %}
  neighbor {{ addresses }} targeted
{%       endfor %}
{%     endif %}
{%     if ldp.interface is vyos_defined %}
{%       for interface in ldp.interface %}
  interface {{ interface }}
  exit
{%       endfor %}
{%     endif %}
 exit-address-family
{%   else %}
 no address-family ipv4
{%   endif %}
 !
{%   if ldp.discovery.transport_ipv6_address is vyos_defined %}
 address-family ipv6
{%     if ldp.allocation.ipv6.access_list6 is vyos_defined %}
  label local allocate for {{ ldp.allocation.ipv6.access_list6 }}
{%     else %}
  label local allocate host-routes
{%     endif %}
{%     if ldp.discovery.transport_ipv6_address is vyos_defined %}
  discovery transport-address {{ ldp.discovery.transport_ipv6_address }}
{%     endif %}
{%     if ldp.discovery.hello_ipv6_holdtime is vyos_defined %}
  discovery hello holdtime {{ ldp.discovery.hello_ipv6_holdtime }}
{%     endif %}
{%     if ldp.discovery.hello_ipv6_interval is vyos_defined %}
  discovery hello interval {{ ldp.discovery.hello_ipv6_interval }}
{%     endif %}
{%     if ldp.discovery.session_ipv6_holdtime is vyos_defined %}
  session holdtime {{ ldp.discovery.session_ipv6_holdtime }}
{%     endif %}
{%     if ldp.import.ipv6.import_filter.filter_access_list6 is vyos_defined %}
{%       if ldp.import.ipv6.import_filter.neighbor_access_list6 is vyos_defined %}
  label remote accept for {{ ldp.import.ipv6.import_filter.filter_access_list6 }} from {{ ldp.import.ipv6.import_filter.neighbor_access_list6 }}
{%       else %}
  label remote accept for {{ ldp.import.ipv6.import_filter.filter_access_list6 }}
{%       endif %}
{%     endif %}
{%     if ldp.export.ipv6.explicit_null is vyos_defined %}
  label local advertise explicit-null
{%     endif %}
{%     if ldp.export.ipv6.export_filter.filter_access_list6 is vyos_defined %}
{%       if ldp.export.ipv6.export_filter.neighbor_access_list6 is vyos_defined %}
  label local advertise for {{ ldp.export.ipv6.export_filter.filter_access_list6 }} to {{ ldp.export.ipv6.export_filter.neighbor_access_list6 }}
{%       else %}
  label local advertise for {{ ldp.export.ipv6.export_filter.filter_access_list6 }}
{%       endif %}
{%     endif %}
{%     if ldp.targeted_neighbor is vyos_defined %}
{%       if ldp.targeted_neighbor.ipv6.enable is vyos_defined %}
  discovery targeted-hello accept
{%       endif %}
{%       if ldp.targeted_neighbor.ipv6.hello_holdtime is vyos_defined %}
  discovery targeted-hello holdtime {{ ldp.targeted_neighbor.ipv6.hello_holdtime }}
{%       endif %}
{%       if ldp.targeted_neighbor.ipv6.hello_interval is vyos_defined %}
  discovery targeted-hello interval {{ ldp.targeted_neighbor.ipv6.hello_interval }}
{%       endif %}
{%       for addresses in ldp.targeted_neighbor.ipv6.address %}
  neighbor {{ addresses }} targeted
{%       endfor %}
{%     endif %}
{%     if ldp.interface is vyos_defined %}
{%       for interface in ldp.interface %}
  interface {{ interface }}
{%       endfor %}
{%     endif %}
 exit-address-family
{%   else %}
 no address-family ipv6
{%   endif %}
 !
exit
{% endif %}
!