diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index 0f1e255b5c..f17464e3f8 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -57,12 +57,18 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if neighbor_addr | ipv4 %} address-family ipv4 neighbor {{ neighbor_addr }} activate +{% if bgp_session['rrclient'] != 0 %} + neighbor {{ neighbor_addr }} route-reflector-client +{% endif %} maximum-paths 64 exit-address-family {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 neighbor {{ neighbor_addr }} activate +{% if bgp_session['rrclient'] != 0 %} + neighbor {{ neighbor_addr }} route-reflector-client +{% endif %} maximum-paths 64 exit-address-family {% endif %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 565a1a43d0..7cf4d2f829 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -233,6 +233,10 @@ def parse_cpg(cpg, hname): for router in child.findall(str(QName(ns1, "BGPRouterDeclaration"))): asn = router.find(str(QName(ns1, "ASN"))).text hostname = router.find(str(QName(ns1, "Hostname"))).text + if router.find(str(QName(ns1, "RRClient"))): + rrclient = '1' + else: + rrclient = '0' if hostname == hname: myasn = int(asn) peers = router.find(str(QName(ns1, "Peers"))) @@ -251,6 +255,7 @@ def parse_cpg(cpg, hname): bgp_session = bgp_sessions[peer] if hostname == bgp_session['name']: bgp_session['asn'] = int(asn) + bgp_session['rrclient'] = int(rrclient) return bgp_sessions, myasn, bgp_peers_with_range