Skip to content

Commit 1b9def0

Browse files
pavel-shirshovPksStudent
authored andcommitted
Fix issues in bgp templates for general peers
1 parent d44926e commit 1b9def0

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2

-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ route-map HIDE_INTERNAL permit 10
1919
set community local-AS
2020
!
2121
{% endif %}
22-
{% if DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
23-
route-map OVERRIDE_ORIGINATOR_ID permit 10
24-
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
25-
{% if prefix | ipv4 and name == 'Loopback0' %}
26-
set originator-id {{ prefix | ip }}
27-
{% endif %}
28-
{% endfor %}
29-
{% endif %}
3022
!
3123
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
3224
!

dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2

+11-9
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,34 @@
88
or (bgp_session['holdtime'] is defined and bgp_session['holdtime'] | int != 180) %}
99
neighbor {{ neighbor_addr }} timers {{ bgp_session['keepalive'] }} {{ bgp_session['holdtime'] }}
1010
{% endif %}
11+
!
1112
{% if bgp_session.has_key('admin_status') and bgp_session['admin_status'] == 'down' or not bgp_session.has_key('admin_status') and CONFIG_DB__DEVICE_METADATA['localhost'].has_key('default_bgp_status') and CONFIG_DB__DEVICE_METADATA['localhost']['default_bgp_status'] == 'down' %}
1213
neighbor {{ neighbor_addr }} shutdown
1314
{% endif %}
15+
!
1416
{% if neighbor_addr | ipv4 %}
1517
address-family ipv4
1618
neighbor {{ neighbor_addr }} peer-group PEER_V4
19+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
20+
neighbor {{ neighbor_addr }} route-map FROM_BGP_PEER_V4_INT in
21+
{% endif %}
1722
{% elif neighbor_addr | ipv6 %}
1823
address-family ipv6
19-
{% if bgp_session['asn'] != bgp_asn %}
20-
neighbor {{ neighbor_addr }} route-map set-next-hop-global-v6 in
21-
{% endif %}
2224
neighbor {{ neighbor_addr }} peer-group PEER_V6
25+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
26+
neighbor {{ neighbor_addr }} route-map FROM_BGP_PEER_V6_INT in
27+
{% endif %}
2328
{% endif %}
29+
!
2430
{% if bgp_session['rrclient'] | int != 0 %}
2531
neighbor {{ neighbor_addr }} route-reflector-client
2632
{% endif %}
33+
!
2734
{% if bgp_session['nhopself'] | int != 0 %}
2835
neighbor {{ neighbor_addr }} next-hop-self
2936
{% endif %}
3037
!
31-
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
32-
neighbor {{ neighbor_addr }} route-map OVERRIDE_ORIGINATOR_ID in
33-
{% endif %}
34-
!
35-
{% if bgp_session["asn"] == bgp_asn
36-
and CONFIG_DB__DEVICE_METADATA['localhost']['type'] == "SpineChassisFrontendRouter" %}
38+
{% if bgp_session["asn"] == bgp_asn and CONFIG_DB__DEVICE_METADATA['localhost']['type'] == "SpineChassisFrontendRouter" %}
3739
address-family l2vpn evpn
3840
neighbor {{ neighbor_addr }} activate
3941
advertise-all-vni

dockers/docker-fpm-frr/frr/bgpd/templates/general/peer-group.conf.j2

+2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
neighbor PEER_V4 allowas-in 1
99
{% endif %}
1010
neighbor PEER_V4 soft-reconfiguration inbound
11+
neighbor PEER_V4 route-map FROM_BGP_PEER_V4 in
1112
neighbor PEER_V4 route-map TO_BGP_PEER_V4 out
1213
exit-address-family
1314
address-family ipv6
1415
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %}
1516
neighbor PEER_V6 allowas-in 1
1617
{% endif %}
1718
neighbor PEER_V6 soft-reconfiguration inbound
19+
neighbor PEER_V4 route-map FROM_BGP_PEER_V6 in
1820
neighbor PEER_V6 route-map TO_BGP_PEER_V6 out
1921
exit-address-family
2022
!

dockers/docker-fpm-frr/frr/bgpd/templates/general/policies.conf.j2

+18-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@
22
! template: bgpd/templates/general/policies.conf.j2
33
!
44
!
5+
!
6+
route-map FROM_BGP_PEER_V4 permit 100
7+
!
58
route-map TO_BGP_PEER_V4 permit 100
69
!
710
!
8-
route-map TO_BGP_PEER_V6 permit 1
9-
set ipv6 next-hop prefer-global
11+
route-map FROM_BGP_PEER_V6 permit 1
12+
set ipv6 next-hop prefer-global
13+
!
14+
route-map FROM_BGP_PEER_V6 permit 100
15+
!
1016
route-map TO_BGP_PEER_V6 permit 100
1117
!
18+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
19+
route-map FROM_BGP_PEER_V4_INT permit 2
20+
set originator-id {{ loopback0_ipv4 | ip }}
21+
!
22+
route-map FROM_BGP_PEER_V6_INT permit 1
23+
set ipv6 next-hop prefer-global
24+
!
25+
route-map FROM_BGP_PEER_V6_INT permit 2
26+
set originator-id {{ loopback0_ipv4 | ip }}
27+
{% endif %}
1228
!
1329
! end of template: bgpd/templates/general/policies.conf.j2
1430
!

0 commit comments

Comments
 (0)