Handling modification of ip range for dynamic BGP peers#22261
Merged
StormLiangMS merged 3 commits intosonic-net:masterfrom May 7, 2025
Merged
Handling modification of ip range for dynamic BGP peers#22261StormLiangMS merged 3 commits intosonic-net:masterfrom
StormLiangMS merged 3 commits intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
anish-n
suggested changes
Apr 10, 2025
StormLiangMS
requested changes
Apr 11, 2025
Contributor
StormLiangMS
left a comment
There was a problem hiding this comment.
hi @sudarshankumar4893 since this is for phase 2, could we have test cases ready for review and in place at same time?
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
d307b97 to
a76964c
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
a76964c to
3342949
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
3342949 to
8aae118
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
8aae118 to
8ca92ee
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
8ca92ee to
bdefa7a
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
anish-n
suggested changes
Apr 17, 2025
anish-n
suggested changes
Apr 17, 2025
bdefa7a to
34063d8
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
hi @sudarshankumar4893 |
anish-n
reviewed
Apr 30, 2025
84cc990 to
b75d463
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
anish-n
approved these changes
May 1, 2025
b75d463 to
d06afd4
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
d06afd4 to
2ee7a9b
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
2ee7a9b to
db793f3
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…pdate Signed-off-by: Sudarshan Kumar (from Dev Box) <sudakumar@microsoft.com>
db793f3 to
5410c2d
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
StormLiangMS
added a commit
that referenced
this pull request
May 7, 2025
…)" This reverts commit 0405fdf.
StormLiangMS
added a commit
that referenced
this pull request
May 7, 2025
sudarshankumar4893
added a commit
to sudarshankumar4893/per-vnet-bgp
that referenced
this pull request
May 7, 2025
…ic-net#22261)" (sonic-net#22556) This reverts commit a4793cd.
11 tasks
StormLiangMS
pushed a commit
that referenced
this pull request
May 9, 2025
Why I did it This PR adds the changes back from this PR: #22261 Along with 1 more change to fix the UT such that it only asserts if the template for dynamic neighbors exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
There is a requirement to be able to modify the listen range of dynamic peers in a peer group and persist the changes through bgpcfgd during run time. This PR adds support for being able to modify the ip_range for a dynamic BGP peer through bgpcfgd.
Here is the High level design document explaining this feature:
Dynamic BGP peer update and delete support by anish-n · Pull Request #1963 · sonic-net/SONiC
Work item tracking
How I did it
The ranges from the set handler will be applied. Any older ranges which are not in the new ranges or any older ranges which overlap with the new ranges will be removed and then the new ranges will be applied. There will be no impact to existing ranges which are present in new range as well. If an older range gets deleted, the peers from that range will flap.
How to verify it
Create a dynamic peer range like so in config_db.json:
"BGP_PEER_RANGE": {
"BGPSLBPassive": {
"ip_range": [
"10.0.0.60/30"
],
"peer_asn": "64600",
"src_address": "10.0.0.60",
"name": "BGPSLBPassive"
}
}
Once the peer is up, add/delete/modify the range to see that the corresponding FRR commands are generated and peers from new range come up. To parse the new changes, run sonic-cfggen like so:
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
Sample updates:
"BGP_PEER_RANGE": {
"BGPSLBPassive": {
"ip_range": [
"10.0.0.60/29"
],
"peer_asn": "64600",
"src_address": "10.0.0.60",
"name": "BGPSLBPassive"
}
}
"BGP_PEER_RANGE": {
"BGPSLBPassive": {
"ip_range": [
"10.0.0.60/30","10.0.0.56/30"
],
"peer_asn": "64600",
"src_address": "10.0.0.60",
"name": "BGPSLBPassive"
}
}
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)