-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[multi-ASIC] BGP internal neighbor table support (#5520)
* Initial commit for BGP internal neighbor table support. > Add new template named "internal" for the internal BGP sessions > Add a new table in database "BGP_INTERNAL_NEIGHBOR" > The internal BGP sessions will be stored in this new table "BGP_INTERNAL_NEIGHBOR" * Changes in template generation tests with the introduction of internal neighbor template files.
- Loading branch information
1 parent
09d5a62
commit 6088bd5
Showing
40 changed files
with
404 additions
and
173 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
34 changes: 34 additions & 0 deletions
34
dockers/docker-fpm-frr/frr/bgpd/templates/internal/instance.conf.j2
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
! | ||
! template: bgpd/templates/internal/instance.conf.j2 | ||
! | ||
neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} | ||
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} | ||
! | ||
{% if neighbor_addr | ipv4 %} | ||
address-family ipv4 | ||
neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V4 | ||
! | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V4 in | ||
{% endif %} | ||
! | ||
{% elif neighbor_addr | ipv6 %} | ||
address-family ipv6 | ||
neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V6 | ||
! | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V6 in | ||
{% endif %} | ||
{% endif %} | ||
! | ||
{% if bgp_session.has_key('rrclient') and bgp_session['rrclient'] | int != 0 %} | ||
neighbor {{ neighbor_addr }} route-reflector-client | ||
{% endif %} | ||
! | ||
neighbor {{ neighbor_addr }} next-hop-self force | ||
! | ||
neighbor {{ neighbor_addr }} activate | ||
exit-address-family | ||
! | ||
! end of template: bgpd/templates/internal/instance.conf.j2 | ||
! |
24 changes: 24 additions & 0 deletions
24
dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
! | ||
! template: bgpd/templates/internal/peer-group.conf.j2 | ||
! | ||
neighbor INTERNAL_PEER_V4 peer-group | ||
neighbor INTERNAL_PEER_V6 peer-group | ||
address-family ipv4 | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
neighbor INTERNAL_PEER_V4 route-reflector-client | ||
{% endif %} | ||
neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound | ||
neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in | ||
neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out | ||
exit-address-family | ||
address-family ipv6 | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
neighbor INTERNAL_PEER_V6 route-reflector-client | ||
{% endif %} | ||
neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound | ||
neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in | ||
neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out | ||
exit-address-family | ||
! | ||
! end of template: bgpd/templates/internal/peer-group.conf.j2 | ||
! |
27 changes: 27 additions & 0 deletions
27
dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
! | ||
! template: bgpd/templates/internal/policies.conf.j2 | ||
! | ||
! | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 | ||
set ipv6 next-hop prefer-global | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 | ||
set originator-id {{ loopback0_ipv4 | ip }} | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 | ||
set originator-id {{ loopback0_ipv4 | ip }} | ||
{% endif %} | ||
! | ||
! end of template: bgpd/templates/internal/policies.conf.j2 | ||
! |
This file contains 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
This file contains 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
15 changes: 0 additions & 15 deletions
15
src/sonic-bgpcfgd/tests/data/general/instance.conf/param_ASIC_v6.json
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/sonic-bgpcfgd/tests/data/general/instance.conf/param_all_v4.json
This file contains 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
5 changes: 0 additions & 5 deletions
5
src/sonic-bgpcfgd/tests/data/general/instance.conf/param_all_v6.json
This file contains 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
13 changes: 0 additions & 13 deletions
13
src/sonic-bgpcfgd/tests/data/general/instance.conf/result_ASIC_v6.conf
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
3 changes: 1 addition & 2 deletions
3
src/sonic-bgpcfgd/tests/data/general/peer-group.conf/param_base.json
This file contains 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
This file contains 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
This file contains 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
5 changes: 0 additions & 5 deletions
5
src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json
This file contains 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
5 changes: 0 additions & 5 deletions
5
src/sonic-bgpcfgd/tests/data/general/policies.conf/param_base.json
This file contains 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
5 changes: 0 additions & 5 deletions
5
src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json
This file contains 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
This file contains 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
Oops, something went wrong.