Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RR client support in minigraph for FRR #923

Merged
merged 8 commits into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"))):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add this in the sample minigraph and add unit test as well, to make sure later no one will break this feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let me do that and repost.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still worth to add the sample configuration in the minigraph, so that later taoyu know how to move it to the config db.

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