-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[bgp] Render BGP_AGGREGATE_ADDRESS into classic bootstrap bgpd.conf to avoid transient leak on bgp restart #28570
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
Open
guangyao6
wants to merge
4
commits into
sonic-net:master
Choose a base branch
from
guangyao6:guangyao/bgpd-aggregate-conf
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7696c19
[bgp] Render BGP_AGGREGATE_ADDRESS into classic bootstrap bgpd.conf t…
guangyao6 36e9db3
[bgp] Add sonic-cfggen tests for BGP_AGGREGATE_ADDRESS rendering
guangyao6 c6ecab3
[bgp] Fix bgp aggregate test case issue
guangyao6 eb72560
[bgp] Add sonic-cfggen ipv6 test case for BGP AGGREGATE
guangyao6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| ! | ||
| ! template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
| ! Render BGP_AGGREGATE_ADDRESS from CONFIG_DB directly into the bootstrap | ||
| ! bgpd.conf so the aggregate-address and the contributing/aggregate prefix-list | ||
| ! entries are present in FRR *before* bgpd forms any session. This closes the | ||
| ! transient leak window where bgpcfgd's AggregateAddressMgr replays the | ||
| ! aggregate config AFTER the neighbor managers have already brought sessions up | ||
| ! (contributing routes would otherwise escape to T2 until the manager runs). | ||
| ! | ||
| ! This template is the SOLE gate at boot (template-only design: the manager does | ||
| ! NOT withdraw a bootstrap-rendered entry). It must therefore reproduce every | ||
| ! safety check the manager applies before pushing an aggregate to FRR: | ||
| ! * prefix must parse as a v4/v6 network (else it would poison bgpd.conf parse) | ||
| ! * prefix must be strict (no host bits) -- parity with validate_prefix(strict=True) | ||
| ! * bbr-required entries only when BBR is *certainly* on (see BBR safety gate) | ||
| ! Anything we skip stays owned by AggregateAddressMgr, which gates on the | ||
| ! fully-resolved live BBR state. | ||
| ! | ||
| ! Idempotency: | ||
| ! * command strings MUST mirror managers_aggregate_address.py byte-for-byte: | ||
| ! generate_aggregate_address_commands() and generate_prefix_list_commands(). | ||
| ! A later manager reconcile is then a FRR no-op (duplicate prefix-list value | ||
| ! + identical aggregate-address are both dropped by FRR). If you edit one | ||
| ! side, edit the other. | ||
| ! * prefix-list entries use explicit seq >= 10 to avoid colliding with any | ||
| ! existing lower-numbered prefix-list entries. The manager emits NO seq (FRR | ||
| ! auto-assigns), and FRR dedups by value, so the differing seq does not matter. | ||
| ! | ||
| ! BBR safety gate (STRICT -- do not loosen): | ||
| ! bbr-required=true aggregates must only be rendered when bounce-back (BBR) is | ||
| ! active, otherwise suppressing the contributing routes to T2 risks a | ||
| ! blackhole. Because there is NO manager withdrawal to undo a wrong guess in | ||
| ! this template-only design, we render a bbr-required aggregate at boot ONLY | ||
| ! when BGP_BBR|all status == "enabled" is EXPLICITLY present. We deliberately | ||
| ! do NOT consult constants.yml default_state: BBRMgr's effective state also | ||
| ! depends on BBR peer-groups existing, which this template cannot verify, so | ||
| ! the default_state path could render unsafe suppression with nothing to | ||
| ! reverse it. Conservative gate = correct when you are the only gate. | ||
| ! | ||
| {% set bbr_on = (BGP_BBR is defined and 'all' in BGP_BBR and BGP_BBR['all'].get('status', 'disabled') == 'enabled') %} | ||
| {% if BGP_AGGREGATE_ADDRESS is defined and (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('bgp_asn' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['bgp_asn'].lower() not in ['none', 'null']) %} | ||
| {% set bgp_asn = DEVICE_METADATA['localhost']['bgp_asn'] %} | ||
| {# Precompute whether any entry qualifies so we never emit empty stanzas. #} | ||
| {% set ns = namespace(any=false) %} | ||
| {% for prefix, attr in BGP_AGGREGATE_ADDRESS.items() %} | ||
| {% if ('/' in prefix) and ((prefix | ipv4) or (prefix | ipv6)) and ((prefix | ip | string | lower) == (prefix | ip_network | string | lower)) and (attr.get('bbr-required', 'false') != 'true' or bbr_on) %} | ||
| {% set ns.any = true %} | ||
|
guangyao6 marked this conversation as resolved.
|
||
| {% endif %} | ||
| {% endfor %} | ||
| {% if ns.any %} | ||
| ! | ||
| ! ---- aggregate / contributing prefix-lists (global scope) ---- | ||
| {% for prefix, attr in BGP_AGGREGATE_ADDRESS.items() %} | ||
| {% if ('/' in prefix) and ((prefix | ipv4) or (prefix | ipv6)) and ((prefix | ip | string | lower) == (prefix | ip_network | string | lower)) and (attr.get('bbr-required', 'false') != 'true' or bbr_on) %} | ||
| {% set is_v4 = prefix | ipv4 %} | ||
| {% set ipcmd = 'ip' if is_v4 else 'ipv6' %} | ||
| {% set seq = 10 + loop.index0 * 5 %} | ||
| {% if attr.get('aggregate-address-prefix-list', '') %} | ||
| {{ ipcmd }} prefix-list {{ attr['aggregate-address-prefix-list'] }} seq {{ seq }} permit {{ prefix }} | ||
| {% endif %} | ||
| {% if attr.get('contributing-address-prefix-list', '') %} | ||
| {{ ipcmd }} prefix-list {{ attr['contributing-address-prefix-list'] }} seq {{ seq }} permit {{ prefix }} le {{ 32 if is_v4 else 128 }} | ||
| {% endif %} | ||
| {% endif %} | ||
|
guangyao6 marked this conversation as resolved.
|
||
| {% endfor %} | ||
| ! | ||
| ! ---- aggregate-address (router bgp scope) ---- | ||
| router bgp {{ bgp_asn }} | ||
| {% for prefix, attr in BGP_AGGREGATE_ADDRESS.items() %} | ||
| {% if ('/' in prefix) and ((prefix | ipv4) or (prefix | ipv6)) and ((prefix | ip | string | lower) == (prefix | ip_network | string | lower)) and (attr.get('bbr-required', 'false') != 'true' or bbr_on) %} | ||
| {% set is_v4 = prefix | ipv4 %} | ||
| address-family {{ 'ipv4' if is_v4 else 'ipv6' }} | ||
| aggregate-address {{ prefix }}{{ ' summary-only' if attr.get('summary-only', 'false') == 'true' else '' }}{{ ' as-set' if attr.get('as-set', 'false') == 'true' else '' }} | ||
| exit-address-family | ||
| {% endif %} | ||
| {% endfor %} | ||
| exit | ||
| {% endif %} | ||
| {% endif %} | ||
| ! | ||
| ! end of template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
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
43 changes: 43 additions & 0 deletions
43
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/bbr_required_disabled.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| ! | ||
| ! template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
| ! Render BGP_AGGREGATE_ADDRESS from CONFIG_DB directly into the bootstrap | ||
| ! bgpd.conf so the aggregate-address and the contributing/aggregate prefix-list | ||
| ! entries are present in FRR *before* bgpd forms any session. This closes the | ||
| ! transient leak window where bgpcfgd's AggregateAddressMgr replays the | ||
| ! aggregate config AFTER the neighbor managers have already brought sessions up | ||
| ! (contributing routes would otherwise escape to T2 until the manager runs). | ||
| ! | ||
| ! This template is the SOLE gate at boot (template-only design: the manager does | ||
| ! NOT withdraw a bootstrap-rendered entry). It must therefore reproduce every | ||
| ! safety check the manager applies before pushing an aggregate to FRR: | ||
| ! * prefix must parse as a v4/v6 network (else it would poison bgpd.conf parse) | ||
| ! * prefix must be strict (no host bits) -- parity with validate_prefix(strict=True) | ||
| ! * bbr-required entries only when BBR is *certainly* on (see BBR safety gate) | ||
| ! Anything we skip stays owned by AggregateAddressMgr, which gates on the | ||
| ! fully-resolved live BBR state. | ||
| ! | ||
| ! Idempotency: | ||
| ! * command strings MUST mirror managers_aggregate_address.py byte-for-byte: | ||
| ! generate_aggregate_address_commands() and generate_prefix_list_commands(). | ||
| ! A later manager reconcile is then a FRR no-op (duplicate prefix-list value | ||
| ! + identical aggregate-address are both dropped by FRR). If you edit one | ||
| ! side, edit the other. | ||
| ! * prefix-list entries use explicit seq >= 10 to avoid colliding with any | ||
| ! existing lower-numbered prefix-list entries. The manager emits NO seq (FRR | ||
| ! auto-assigns), and FRR dedups by value, so the differing seq does not matter. | ||
| ! | ||
| ! BBR safety gate (STRICT -- do not loosen): | ||
| ! bbr-required=true aggregates must only be rendered when bounce-back (BBR) is | ||
| ! active, otherwise suppressing the contributing routes to T2 risks a | ||
| ! blackhole. Because there is NO manager withdrawal to undo a wrong guess in | ||
| ! this template-only design, we render a bbr-required aggregate at boot ONLY | ||
| ! when BGP_BBR|all status == "enabled" is EXPLICITLY present. We deliberately | ||
| ! do NOT consult constants.yml default_state: BBRMgr's effective state also | ||
| ! depends on BBR peer-groups existing, which this template cannot verify, so | ||
| ! the default_state path could render unsafe suppression with nothing to | ||
| ! reverse it. Conservative gate = correct when you are the only gate. | ||
| ! | ||
| ! | ||
| ! end of template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! |
18 changes: 18 additions & 0 deletions
18
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/bbr_required_disabled.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost": { | ||
| "bgp_asn": "65001" | ||
| } | ||
| }, | ||
| "BGP_BBR": { | ||
| "all": { | ||
| "status": "disabled" | ||
| } | ||
| }, | ||
| "BGP_AGGREGATE_ADDRESS": { | ||
| "192.168.0.0/24": { | ||
| "bbr-required": "true", | ||
| "summary-only": "true" | ||
| } | ||
| } | ||
| } |
52 changes: 52 additions & 0 deletions
52
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/bbr_required_enabled.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| ! | ||
| ! template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
| ! Render BGP_AGGREGATE_ADDRESS from CONFIG_DB directly into the bootstrap | ||
| ! bgpd.conf so the aggregate-address and the contributing/aggregate prefix-list | ||
| ! entries are present in FRR *before* bgpd forms any session. This closes the | ||
| ! transient leak window where bgpcfgd's AggregateAddressMgr replays the | ||
| ! aggregate config AFTER the neighbor managers have already brought sessions up | ||
| ! (contributing routes would otherwise escape to T2 until the manager runs). | ||
| ! | ||
| ! This template is the SOLE gate at boot (template-only design: the manager does | ||
| ! NOT withdraw a bootstrap-rendered entry). It must therefore reproduce every | ||
| ! safety check the manager applies before pushing an aggregate to FRR: | ||
| ! * prefix must parse as a v4/v6 network (else it would poison bgpd.conf parse) | ||
| ! * prefix must be strict (no host bits) -- parity with validate_prefix(strict=True) | ||
| ! * bbr-required entries only when BBR is *certainly* on (see BBR safety gate) | ||
| ! Anything we skip stays owned by AggregateAddressMgr, which gates on the | ||
| ! fully-resolved live BBR state. | ||
| ! | ||
| ! Idempotency: | ||
| ! * command strings MUST mirror managers_aggregate_address.py byte-for-byte: | ||
| ! generate_aggregate_address_commands() and generate_prefix_list_commands(). | ||
| ! A later manager reconcile is then a FRR no-op (duplicate prefix-list value | ||
| ! + identical aggregate-address are both dropped by FRR). If you edit one | ||
| ! side, edit the other. | ||
| ! * prefix-list entries use explicit seq >= 10 to avoid colliding with any | ||
| ! existing lower-numbered prefix-list entries. The manager emits NO seq (FRR | ||
| ! auto-assigns), and FRR dedups by value, so the differing seq does not matter. | ||
| ! | ||
| ! BBR safety gate (STRICT -- do not loosen): | ||
| ! bbr-required=true aggregates must only be rendered when bounce-back (BBR) is | ||
| ! active, otherwise suppressing the contributing routes to T2 risks a | ||
| ! blackhole. Because there is NO manager withdrawal to undo a wrong guess in | ||
| ! this template-only design, we render a bbr-required aggregate at boot ONLY | ||
| ! when BGP_BBR|all status == "enabled" is EXPLICITLY present. We deliberately | ||
| ! do NOT consult constants.yml default_state: BBRMgr's effective state also | ||
| ! depends on BBR peer-groups existing, which this template cannot verify, so | ||
| ! the default_state path could render unsafe suppression with nothing to | ||
| ! reverse it. Conservative gate = correct when you are the only gate. | ||
| ! | ||
| ! | ||
| ! ---- aggregate / contributing prefix-lists (global scope) ---- | ||
| ! | ||
| ! ---- aggregate-address (router bgp scope) ---- | ||
| router bgp 65001 | ||
| address-family ipv4 | ||
| aggregate-address 192.168.0.0/24 summary-only | ||
| exit-address-family | ||
| exit | ||
| ! | ||
| ! end of template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! |
18 changes: 18 additions & 0 deletions
18
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/bbr_required_enabled.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost": { | ||
| "bgp_asn": "65001" | ||
| } | ||
| }, | ||
| "BGP_BBR": { | ||
| "all": { | ||
| "status": "enabled" | ||
| } | ||
| }, | ||
| "BGP_AGGREGATE_ADDRESS": { | ||
| "192.168.0.0/24": { | ||
| "bbr-required": "true", | ||
| "summary-only": "true" | ||
| } | ||
| } | ||
| } |
52 changes: 52 additions & 0 deletions
52
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/ipv4_basic.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| ! | ||
| ! template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
| ! Render BGP_AGGREGATE_ADDRESS from CONFIG_DB directly into the bootstrap | ||
| ! bgpd.conf so the aggregate-address and the contributing/aggregate prefix-list | ||
| ! entries are present in FRR *before* bgpd forms any session. This closes the | ||
| ! transient leak window where bgpcfgd's AggregateAddressMgr replays the | ||
| ! aggregate config AFTER the neighbor managers have already brought sessions up | ||
| ! (contributing routes would otherwise escape to T2 until the manager runs). | ||
| ! | ||
| ! This template is the SOLE gate at boot (template-only design: the manager does | ||
| ! NOT withdraw a bootstrap-rendered entry). It must therefore reproduce every | ||
| ! safety check the manager applies before pushing an aggregate to FRR: | ||
| ! * prefix must parse as a v4/v6 network (else it would poison bgpd.conf parse) | ||
| ! * prefix must be strict (no host bits) -- parity with validate_prefix(strict=True) | ||
| ! * bbr-required entries only when BBR is *certainly* on (see BBR safety gate) | ||
| ! Anything we skip stays owned by AggregateAddressMgr, which gates on the | ||
| ! fully-resolved live BBR state. | ||
| ! | ||
| ! Idempotency: | ||
| ! * command strings MUST mirror managers_aggregate_address.py byte-for-byte: | ||
| ! generate_aggregate_address_commands() and generate_prefix_list_commands(). | ||
| ! A later manager reconcile is then a FRR no-op (duplicate prefix-list value | ||
| ! + identical aggregate-address are both dropped by FRR). If you edit one | ||
| ! side, edit the other. | ||
| ! * prefix-list entries use explicit seq >= 10 to avoid colliding with any | ||
| ! existing lower-numbered prefix-list entries. The manager emits NO seq (FRR | ||
| ! auto-assigns), and FRR dedups by value, so the differing seq does not matter. | ||
| ! | ||
| ! BBR safety gate (STRICT -- do not loosen): | ||
| ! bbr-required=true aggregates must only be rendered when bounce-back (BBR) is | ||
| ! active, otherwise suppressing the contributing routes to T2 risks a | ||
| ! blackhole. Because there is NO manager withdrawal to undo a wrong guess in | ||
| ! this template-only design, we render a bbr-required aggregate at boot ONLY | ||
| ! when BGP_BBR|all status == "enabled" is EXPLICITLY present. We deliberately | ||
| ! do NOT consult constants.yml default_state: BBRMgr's effective state also | ||
| ! depends on BBR peer-groups existing, which this template cannot verify, so | ||
| ! the default_state path could render unsafe suppression with nothing to | ||
| ! reverse it. Conservative gate = correct when you are the only gate. | ||
| ! | ||
| ! | ||
| ! ---- aggregate / contributing prefix-lists (global scope) ---- | ||
| ! | ||
| ! ---- aggregate-address (router bgp scope) ---- | ||
| router bgp 65001 | ||
| address-family ipv4 | ||
| aggregate-address 192.168.0.0/24 summary-only | ||
| exit-address-family | ||
| exit | ||
| ! | ||
| ! end of template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! |
12 changes: 12 additions & 0 deletions
12
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/ipv4_basic.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost": { | ||
| "bgp_asn": "65001" | ||
| } | ||
| }, | ||
| "BGP_AGGREGATE_ADDRESS": { | ||
| "192.168.0.0/24": { | ||
| "summary-only": "true" | ||
| } | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/ipv4_with_prefix_lists.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| ! | ||
| ! template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! | ||
| ! Render BGP_AGGREGATE_ADDRESS from CONFIG_DB directly into the bootstrap | ||
| ! bgpd.conf so the aggregate-address and the contributing/aggregate prefix-list | ||
| ! entries are present in FRR *before* bgpd forms any session. This closes the | ||
| ! transient leak window where bgpcfgd's AggregateAddressMgr replays the | ||
| ! aggregate config AFTER the neighbor managers have already brought sessions up | ||
| ! (contributing routes would otherwise escape to T2 until the manager runs). | ||
| ! | ||
| ! This template is the SOLE gate at boot (template-only design: the manager does | ||
| ! NOT withdraw a bootstrap-rendered entry). It must therefore reproduce every | ||
| ! safety check the manager applies before pushing an aggregate to FRR: | ||
| ! * prefix must parse as a v4/v6 network (else it would poison bgpd.conf parse) | ||
| ! * prefix must be strict (no host bits) -- parity with validate_prefix(strict=True) | ||
| ! * bbr-required entries only when BBR is *certainly* on (see BBR safety gate) | ||
| ! Anything we skip stays owned by AggregateAddressMgr, which gates on the | ||
| ! fully-resolved live BBR state. | ||
| ! | ||
| ! Idempotency: | ||
| ! * command strings MUST mirror managers_aggregate_address.py byte-for-byte: | ||
| ! generate_aggregate_address_commands() and generate_prefix_list_commands(). | ||
| ! A later manager reconcile is then a FRR no-op (duplicate prefix-list value | ||
| ! + identical aggregate-address are both dropped by FRR). If you edit one | ||
| ! side, edit the other. | ||
| ! * prefix-list entries use explicit seq >= 10 to avoid colliding with any | ||
| ! existing lower-numbered prefix-list entries. The manager emits NO seq (FRR | ||
| ! auto-assigns), and FRR dedups by value, so the differing seq does not matter. | ||
| ! | ||
| ! BBR safety gate (STRICT -- do not loosen): | ||
| ! bbr-required=true aggregates must only be rendered when bounce-back (BBR) is | ||
| ! active, otherwise suppressing the contributing routes to T2 risks a | ||
| ! blackhole. Because there is NO manager withdrawal to undo a wrong guess in | ||
| ! this template-only design, we render a bbr-required aggregate at boot ONLY | ||
| ! when BGP_BBR|all status == "enabled" is EXPLICITLY present. We deliberately | ||
| ! do NOT consult constants.yml default_state: BBRMgr's effective state also | ||
| ! depends on BBR peer-groups existing, which this template cannot verify, so | ||
| ! the default_state path could render unsafe suppression with nothing to | ||
| ! reverse it. Conservative gate = correct when you are the only gate. | ||
| ! | ||
| ! | ||
| ! ---- aggregate / contributing prefix-lists (global scope) ---- | ||
| ip prefix-list AGG_PL seq 10 permit 192.168.0.0/24 | ||
| ip prefix-list CON_PL seq 10 permit 192.168.0.0/24 le 32 | ||
| ! | ||
| ! ---- aggregate-address (router bgp scope) ---- | ||
| router bgp 65001 | ||
| address-family ipv4 | ||
| aggregate-address 192.168.0.0/24 summary-only | ||
| exit-address-family | ||
| exit | ||
| ! | ||
| ! end of template: bgpd/bgpd.aggregate.conf.j2 | ||
| ! |
14 changes: 14 additions & 0 deletions
14
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.aggregate.conf.j2/ipv4_with_prefix_lists.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "DEVICE_METADATA": { | ||
| "localhost": { | ||
| "bgp_asn": "65001" | ||
| } | ||
| }, | ||
| "BGP_AGGREGATE_ADDRESS": { | ||
| "192.168.0.0/24": { | ||
| "summary-only": "true", | ||
| "aggregate-address-prefix-list": "AGG_PL", | ||
| "contributing-address-prefix-list": "CON_PL" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.