Skip to content
Snippets Groups Projects
Commit dcb53162 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

BGP base config in a separate template

Common BGP base config into a separate template (bgp_base).
This allows to re-use it in both router Base and VPRN contexts.
parent 6b31cfab
Branches
Tags
1 merge request!167PE base config - integrated into `base_config` role.
<bgp xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% if pe_bgp_base.best_path_selection is defined %}
<best-path-selection>
{% for bps in pe_bgp_base.best_path_selection %}
<{{ bps }}>true</{{ bps }}>
{% endfor %}
</best-path-selection>
{% endif %}
{% if pe_bgp_base.error_handling is defined %}
<error-handling>
<{{ pe_bgp_base.error_handling }}>true</{{ pe_bgp_base.error_handling }}>
</error-handling>
{% endif %}
{% if pe_bgp_base.next_hop_resolution.shortcut_tunnel is defined %}
<next-hop-resolution>
<shortcut-tunnel>
{% for nhr in pe_bgp_base.next_hop_resolution.shortcut_tunnel %}
<family>
<family-type>{{ nhr.type }}</family-type>
<resolution-filter>
<{{ nhr.resolution_filter }}>true</{{ nhr.resolution_filter }}>
</resolution-filter>
</family>
{% endfor %}
</shortcut-tunnel>
</next-hop-resolution>
{% endif %}
{% if pe_bgp_base.multipath is defined %}
<multipath alu:operation="replace">
{% if pe_bgp_base.multipath.ibgp is defined %}
<ibgp>{{ pe_bgp_base.multipath.ibgp }}</ibgp>
{% endif %}
{% if pe_bgp_base.multipath.ebgp is defined %}
<ebgp>{{ pe_bgp_base.multipath.ebgp }}</ebgp>
{% endif %}
{% if pe_bgp_base.multipath.ipv4 is defined %}
<family>
<family-type>ipv4</family-type>
<max-paths>{{ pe_bgp_base.multipath.ipv4 }}</max-paths>
</family>
{% endif %}
{% if pe_bgp_base.multipath.ipv6 is defined %}
<family>
<family-type>ipv6</family-type>
<max-paths>{{ pe_bgp_base.multipath.ipv6 }}</max-paths>
</family>
{% endif %}
</multipath>
{% endif %}
{% with bgp_obj=pe_bgp_tools %}
{% include "router/bgp_group.j2" %}
{% include "router/bgp_neighbor.j2" %}
{% endwith %}
{% with bgp_obj=pe_bgp_internal %}
{% include "router/bgp_group.j2" %}
{% endwith %}
</bgp>
<bgp xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% with bgp_base_obj=pe_bgp_base, bgp_context='bgp_base' %}
{% include 'router/bgp_base.j2' %}
{% endwith %}
{% with bgp_obj=pe_bgp_tools %}
{% include "router/bgp_group.j2" %}
{% include "router/bgp_neighbor.j2" %}
{% endwith %}
{% with bgp_obj=pe_bgp_internal %}
{% include "router/bgp_group.j2" %}
{% endwith %}
</bgp>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{% include 'router/static_routes.j2' %} {% include 'router/static_routes.j2' %}
{% endwith %} {% endwith %}
{% with bgp_group_context='bgp_base' %} {% with bgp_group_context='bgp_base' %}
{% include 'router/base_bgp.j2' %} {% include 'router/bgp.j2' %}
{% endwith %} {% endwith %}
{% include 'router/flowspec.j2' %} {% include 'router/flowspec.j2' %}
{% include 'router/ldp.j2' %} {% include 'router/ldp.j2' %}
......
...@@ -24,42 +24,9 @@ ...@@ -24,42 +24,9 @@
</mpls> </mpls>
</bgp-ipvpn> </bgp-ipvpn>
<bgp> <bgp>
{% if vprn.bgp.families is defined %} {% with bgp_base_obj=vprn.bgp, bgp_context='vprn' %}
<family> {% include 'router/bgp_base.j2' %}
{% for fam in vprn.bgp.families %} {% endwith %}
<{{ fam }}>true</{{ fam }}>
{% endfor %}
</family>
{% endif %}
{% if vprn.bgp.best_path_selection is defined %}
<best-path-selection>
{% for bps in vprn.bgp.best_path_selection %}
<{{ bps }}>true</{{ bps }}>
{% endfor %}
</best-path-selection>
{% endif %}
{% if vprn.bgp.multipath is defined %}
<multipath>
{% if vprn.bgp.multipath.ibgp is defined %}
<ibgp>{{ vprn.bgp.multipath.ibgp }}</ibgp>
{% endif %}
{% if vprn.bgp.multipath.ebgp is defined %}
<ebgp>{{ vprn.bgp.multipath.ebgp }}</ebgp>
{% endif %}
{% if vprn.bgp.multipath.ipv4 is defined %}
<family>
<family-type>ipv4</family-type>
<max-paths>{{ vprn.bgp.multipath.ipv4 }}</max-paths>
</family>
{% endif %}
{% if vprn.bgp.multipath.ipv6 is defined %}
<family>
<family-type>ipv6</family-type>
<max-paths>{{ vprn.bgp.multipath.ipv6 }}</max-paths>
</family>
{% endif %}
</multipath>
{% endif %}
{% with bgp_obj=vprn.bgp, bgp_group_context='vprn' %} {% with bgp_obj=vprn.bgp, bgp_group_context='vprn' %}
{% include 'router/bgp_group.j2' %} {% include 'router/bgp_group.j2' %}
{% endwith %} {% endwith %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment