-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[bgpcfgd]: Support default action for "Allow prefix" feature #6370
[bgpcfgd]: Support default action for "Allow prefix" feature #6370
Conversation
67dabec
to
1f0edc4
Compare
1f0edc4
to
acc3c66
Compare
route-map ALLOW_LIST_DEPLOYMENT_ID_0_V4 permit 65535 | ||
set community {{ constants.bgp.allow_list.drop_community }} additive | ||
! | ||
route-map ALLOW_LIST_DEPLOYMENT_ID_0_V6 permit 65535 | ||
set community {{ constants.bgp.allow_list.drop_community }} additive | ||
{% endif %} | ||
! | ||
route-map FROM_BGP_PEER_V4 permit 2 | ||
bgp community-list standard allow_list_default_community permit no-export | ||
bgp community-list standard allow_list_default_community permit {{ constants.bgp.allow_list.drop_community }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pavel-shirshov in my understanding we should this only "no-export" case. This is because if there is no allow list prefix configured we should tag them with drop community and continue to process other route-map. Otherwise we can break existing behaviour where we don't have prefix list by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove the second line here, the later routing policy could remove the mark from the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pavel-shirshov i think we have to keep processing other route-map and can't break here . Because otherwise how we will permit default route from T0 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T0 will not send any default route, otherwise how do we choose between mulityple T0 for default routes?
Only T2 layer will send us default routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will have another PR on top of this for remaining changes/fixes
* Use 20 and 30 route-map entries instead of 2 and 3 for TSA * Added support for dynamic "Allow list" default action. Co-authored-by: Pavel Shirshov <[email protected]>
* Use 20 and 30 route-map entries instead of 2 and 3 for TSA * Added support for dynamic "Allow list" default action. Co-authored-by: Pavel Shirshov <[email protected]>
Updated test case to align with sonic-net/sonic-buildimage#6370 which made allow list action dynamic Added test case to cover sonic-net/sonic-buildimage#6671 Remove fixed value of Drop Community and read from /etc/sonic/constants.yml file. Organized the case as three test case one to verify default pre/post-config behavior when no prefix list there on device and then test case to verify with prefix list programmed with action as permit and deny
- Why I did it
To enable dynamic default action parameter for "Allow prefix" feature.
- How I did it
I introduce another field into the "Allow prefix" controlling object.
I added field with name "default_action", which must have either "permit" or "deny" value
When you apply this configuration to the DB by command:
sonic-cfggen -j apply.json -w
this configuration would be rendered into the following changeThat will mark differently prefixes which weren't matched by the "Allow prefix" rules.
By default or when "default_action" is not presented, the values from the constants.yml is used.
- How to verify it
sonic-cfggen -j apply.json -w
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)