forked from sonic-net/sonic-buildimage-msft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chassis] Support advertisement of Loopback0 of all LC's across all e…
…-BGP peers in TSA mode (#16714) What I did: In Chassis TSA mode Loopback0 Ip's of each LC's should be advertise through e-BGP peers of each remote LC's How I did: - Route-map policy to Advertise own/self Loopback IP to other internal iBGP peers with a community internal_community as define in constants.yml - Route-map policy to match on above internal_community when route is received from internal iBGP peers and set a internal tag as define in constants.yml and also delete the internal_community so we don't send to any of e-BGP peers - In TSA new route-map match on above internal tag and permit the route (Loopback0 IP's of remote LC's) and set the community to traffic_shift_community. - In TSB delete the above new route-map. How I verify: Manual Verification UT updated. sonic-mgmt PR: sonic-net/sonic-mgmt#10239 Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
- Loading branch information
Showing
22 changed files
with
214 additions
and
41 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
20 changes: 20 additions & 0 deletions
20
dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
route-map {{ route_map_name }} permit 20 | ||
match {{ ip_protocol }} address prefix-list PL_Loopback{{ ip_version }} | ||
set community {{ constants.bgp.traffic_shift_community }} | ||
route-map {{ route_map_name }} deny 30 | ||
route-map {{ route_map_name }} permit 30 | ||
match tag {{ constants.bgp.internal_community_match_tag }} | ||
set community {{ constants.bgp.traffic_shift_community }} | ||
route-map {{ route_map_name }} deny 40 | ||
! |
3 changes: 2 additions & 1 deletion
3
dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
no route-map {{ route_map_name }} permit 20 | ||
no route-map {{ route_map_name }} deny 30 | ||
no route-map {{ route_map_name }} permit 30 | ||
no route-map {{ route_map_name }} deny 40 | ||
! |
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
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
6 changes: 4 additions & 2 deletions
6
src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_unisolate.conf
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
|
||
no route-map TO_BGP_PEER_V4 permit 20 | ||
no route-map TO_BGP_PEER_V4 deny 30 | ||
no route-map TO_BGP_PEER_V4 permit 30 | ||
no route-map TO_BGP_PEER_V4 deny 40 | ||
! | ||
no route-map TO_BGP_PEER_V6 permit 20 | ||
no route-map TO_BGP_PEER_V6 deny 30 | ||
no route-map TO_BGP_PEER_V6 permit 30 | ||
no route-map TO_BGP_PEER_V6 deny 40 | ||
! |
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
16 changes: 16 additions & 0 deletions
16
src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_chasiss_packet.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"CONFIG_DB__DEVICE_METADATA": { | ||
"localhost": { | ||
"type": "SpineRouter", | ||
"sub_role": "FrontEnd", | ||
"switch_type": "chassis-packet" | ||
} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"internal_community": "12345:556", | ||
"internal_community_match_tag": "101" | ||
} | ||
}, | ||
"loopback0_ipv4": "10.10.10.10/32" | ||
} |
8 changes: 7 additions & 1 deletion
8
src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_front.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
18 changes: 9 additions & 9 deletions
18
src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back.conf
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
! | ||
! 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_V4 permit 1 | ||
set originator-id 10.10.10.10 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 | ||
set ipv6 next-hop prefer-global | ||
on-match next | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 | ||
set originator-id 10.10.10.10 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V6 permit 100 | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 | ||
set originator-id 10.10.10.10 | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 | ||
set originator-id 10.10.10.10 | ||
route-map TO_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
! end of template: bgpd/templates/internal/policies.conf.j2 | ||
! |
37 changes: 37 additions & 0 deletions
37
src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_chasiss_packet.conf
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,37 @@ | ||
! | ||
! template: bgpd/templates/internal/policies.conf.j2 | ||
! | ||
bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit 12345:556 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 | ||
match community DEVICE_INTERNAL_COMMUNITY | ||
set comm-list DEVICE_INTERNAL_COMMUNITY delete | ||
set tag 101 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 | ||
set ipv6 next-hop prefer-global | ||
on-match next | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 | ||
match community DEVICE_INTERNAL_COMMUNITY | ||
set comm-list DEVICE_INTERNAL_COMMUNITY delete | ||
set tag 101 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V4 permit 1 | ||
match ip address prefix-list PL_LoopbackV4 | ||
set community 12345:556 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V6 permit 2 | ||
match ipv6 address prefix-list PL_LoopbackV6 | ||
set community 12345:556 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V4 permit 100 | ||
! | ||
route-map TO_BGP_INTERNAL_PEER_V6 permit 100 | ||
! | ||
! end of template: bgpd/templates/internal/policies.conf.j2 | ||
! |
8 changes: 4 additions & 4 deletions
8
src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_front.conf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
route-map test_rm_name permit 20 | ||
match ip address prefix-list PL_LoopbackV4 | ||
set community 12345:555 | ||
route-map test_rm_name deny 30 | ||
route-map test_rm_name permit 30 | ||
match tag 1002 | ||
set community 12345:555 | ||
route-map test_rm_name deny 40 | ||
! |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"constants": { | ||
"bgp": { | ||
"traffic_shift_community": "12345:555" | ||
"traffic_shift_community": "12345:555", | ||
"internal_community_match_tag": "1002" | ||
} | ||
}, | ||
"route_map_name": "test_rm_name", | ||
"ip_version": "V4", | ||
"ip_protocol": "ip" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
no route-map test_rm permit 20 | ||
no route-map test_rm deny 30 | ||
no route-map test_rm permit 30 | ||
no route-map test_rm deny 40 | ||
! |
6 changes: 6 additions & 0 deletions
6
src/sonic-bgpcfgd/tests/data/voq_chassis/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{ | ||
"CONFIG_DB__DEVICE_METADATA": { | ||
"localhost": {} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"internal_community": "12345:556", | ||
"internal_community_match_tag": "101" | ||
} | ||
} | ||
} |
Oops, something went wrong.