Skip to content

Commit

Permalink
RR client support in minigraph for FRR
Browse files Browse the repository at this point in the history
A=
  • Loading branch information
Nikos Triantafillis committed Aug 27, 2017
1 parent 0766365 commit 45ab087
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dockers/docker-fpm-frr/bgpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{ bgp_session['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 {{ bgp_session['addr'] }} route-reflector-client
{% endif %}
maximum-paths 64
exit-address-family
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,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")))
Expand All @@ -292,6 +296,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

Expand Down

0 comments on commit 45ab087

Please sign in to comment.