Skip to content

Commit 45ab087

Browse files
author
Nikos Triantafillis
committed
RR client support in minigraph for FRR
A=
1 parent 0766365 commit 45ab087

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,18 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
5757
{% if neighbor_addr | ipv4 %}
5858
address-family ipv4
5959
neighbor {{ neighbor_addr }} activate
60+
{% if bgp_session['rrclient'] != 0 %}
61+
neighbor {{ bgp_session['addr'] }} route-reflector-client
62+
{% endif %}
6063
maximum-paths 64
6164
exit-address-family
6265
{% endif %}
6366
{% if neighbor_addr | ipv6 %}
6467
address-family ipv6
6568
neighbor {{ neighbor_addr }} activate
69+
{% if bgp_session['rrclient'] != 0 %}
70+
neighbor {{ bgp_session['addr'] }} route-reflector-client
71+
{% endif %}
6672
maximum-paths 64
6773
exit-address-family
6874
{% endif %}

src/sonic-config-engine/minigraph.py

+5
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ def parse_cpg(cpg, hname):
274274
for router in child.findall(str(QName(ns1, "BGPRouterDeclaration"))):
275275
asn = router.find(str(QName(ns1, "ASN"))).text
276276
hostname = router.find(str(QName(ns1, "Hostname"))).text
277+
if router.find(str(QName(ns1, "RRClient"))):
278+
rrclient = '1'
279+
else:
280+
rrclient = '0'
277281
if hostname == hname:
278282
myasn = int(asn)
279283
peers = router.find(str(QName(ns1, "Peers")))
@@ -292,6 +296,7 @@ def parse_cpg(cpg, hname):
292296
bgp_session = bgp_sessions[peer]
293297
if hostname == bgp_session['name']:
294298
bgp_session['asn'] = int(asn)
299+
bgp_session['rrclient'] = int(rrclient)
295300

296301
return bgp_sessions, myasn, bgp_peers_with_range
297302

0 commit comments

Comments
 (0)