Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add advertise_map and supress_map keys to B…
Browse files Browse the repository at this point in the history
…GP template (#3360)

Co-authored-by: Claus Holbech <[email protected]>
  • Loading branch information
gusmb and ClausHolbechArista authored Jan 11, 2024
1 parent 7a43e51 commit 5067972
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ interface Management1

#### BGP Route Aggregation

| Prefix | AS Set | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------ | ------------- | --------- | -------------- |
| 1.1.1.0/24 | False | False | - | - | True |
| 1.12.1.0/24 | True | True | RM-ATTRIBUTE | RM-MATCH | True |
| 2.2.1.0/24 | False | False | - | - | False |
| Prefix | AS Set | Advertise Map | Supress Map | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------- | ----------- | ------------ | ------------- | --------- | -------------- |
| 1.1.1.0/24 | False | - | - | False | - | - | True |
| 1.12.1.0/24 | True | ADV-MAP | SUP-MAP | True | RM-ATTRIBUTE | RM-MATCH | True |
| 2.2.1.0/24 | False | - | - | False | - | - | False |

#### Router BGP Session Trackers

Expand Down Expand Up @@ -206,7 +206,7 @@ router bgp 65101
neighbor 192.0.3.9 remote-as 65438
no neighbor 192.0.3.9 bfd
aggregate-address 1.1.1.0/24 advertise-only
aggregate-address 1.12.1.0/24 as-set summary-only attribute-map RM-ATTRIBUTE match-map RM-MATCH advertise-only
aggregate-address 1.12.1.0/24 as-set advertise-map ADV-MAP supress-map SUP-MAP summary-only attribute-map RM-ATTRIBUTE match-map RM-MATCH advertise-only
aggregate-address 2.2.1.0/24
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute ospf include leaked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ router bgp 65101
neighbor 192.0.3.9 remote-as 65438
no neighbor 192.0.3.9 bfd
aggregate-address 1.1.1.0/24 advertise-only
aggregate-address 1.12.1.0/24 as-set summary-only attribute-map RM-ATTRIBUTE match-map RM-MATCH advertise-only
aggregate-address 1.12.1.0/24 as-set advertise-map ADV-MAP supress-map SUP-MAP summary-only attribute-map RM-ATTRIBUTE match-map RM-MATCH advertise-only
aggregate-address 2.2.1.0/24
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute ospf include leaked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ router_bgp:
- prefix: 2.2.1.0/24
- prefix: 1.12.1.0/24
as_set: true
advertise_map: ADV-MAP
supress_map: SUP-MAP
summary_only: true
attribute_map: RM-ATTRIBUTE
match_map: RM-MATCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1079,10 +1079,10 @@ router isis EVPN_UNDERLAY

#### BGP Route Aggregation

| Prefix | AS Set | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------ | ------------- | --------- | -------------- |
| 1.1.1.0/24 | False | False | - | - | True |
| 2.2.1.0/24 | False | False | - | - | False |
| Prefix | AS Set | Advertise Map | Supress Map | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------- | ----------- | ------------ | ------------- | --------- | -------------- |
| 1.1.1.0/24 | False | - | - | False | - | - | True |
| 2.2.1.0/24 | False | - | - | False | - | - | False |

#### Router BGP EVPN Address Family

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;prefix</samp>](## "router_bgp.aggregate_addresses.[].prefix") | String | Required, Unique | | | IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I" |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;advertise_only</samp>](## "router_bgp.aggregate_addresses.[].advertise_only") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as_set</samp>](## "router_bgp.aggregate_addresses.[].as_set") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;advertise_map</samp>](## "router_bgp.aggregate_addresses.[].advertise_map") | String | | | | Route-map name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supress_map</samp>](## "router_bgp.aggregate_addresses.[].supress_map") | String | | | | Route-map name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;summary_only</samp>](## "router_bgp.aggregate_addresses.[].summary_only") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attribute_map</samp>](## "router_bgp.aggregate_addresses.[].attribute_map") | String | | | | Route-map name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match_map</samp>](## "router_bgp.aggregate_addresses.[].match_map") | String | | | | Route-map name |
Expand Down Expand Up @@ -589,6 +591,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;prefix</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].prefix") | String | Required, Unique | | | IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I" |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;advertise_only</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].advertise_only") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as_set</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].as_set") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;advertise_map</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].advertise_map") | String | | | | Route-map name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supress_map</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].supress_map") | String | | | | Route-map name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;summary_only</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].summary_only") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attribute_map</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].attribute_map") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match_map</samp>](## "router_bgp.vrfs.[].aggregate_addresses.[].match_map") | String | | | | |
Expand Down Expand Up @@ -1029,6 +1033,12 @@
- prefix: <str; required; unique>
advertise_only: <bool>
as_set: <bool>

# Route-map name
advertise_map: <str>

# Route-map name
supress_map: <str>
summary_only: <bool>

# Route-map name
Expand Down Expand Up @@ -1732,6 +1742,12 @@
- prefix: <str; required; unique>
advertise_only: <bool>
as_set: <bool>

# Route-map name
advertise_map: <str>

# Route-map name
supress_map: <str>
summary_only: <bool>
attribute_map: <str>
match_map: <str>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,12 @@ keys:
type: bool
as_set:
type: bool
advertise_map:
type: str
description: Route-map name
supress_map:
type: str
description: Route-map name
summary_only:
type: bool
attribute_map:
Expand Down Expand Up @@ -2113,6 +2119,12 @@ keys:
type: bool
as_set:
type: bool
advertise_map:
type: str
description: Route-map name
supress_map:
type: str
description: Route-map name
summary_only:
type: bool
attribute_map:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,16 @@

#### BGP Route Aggregation

| Prefix | AS Set | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------ | ------------- | --------- | -------------- |
| Prefix | AS Set | Advertise Map | Supress Map | Summary Only | Attribute Map | Match Map | Advertise Only |
| ------ | ------ | ------------- | ----------- | ------------ | ------------- | --------- | -------------- |
{% for aggregate_address in router_bgp.aggregate_addresses | arista.avd.natural_sort('prefix') %}
{% if aggregate_address.as_set is arista.avd.defined(true) %}
{% set as_set = true %}
{% else %}
{% set as_set = false %}
{% endif %}
{% set advertise_map = aggregate_address.advertise_map | arista.avd.default('-') %}
{% set supress_map = aggregate_address.supress_map | arista.avd.default('-') %}
{% if aggregate_address.summary_only is arista.avd.defined(true) %}
{% set summary_only = true %}
{% else %}
Expand All @@ -500,7 +502,7 @@
{% else %}
{% set advertise_only = false %}
{% endif %}
| {{ aggregate_address.prefix }} | {{ as_set }} | {{ summary_only }} | {{ attribute_map }} | {{ match_map }} | {{ advertise_only }} |
| {{ aggregate_address.prefix }} | {{ as_set }} | {{ advertise_map }} | {{ supress_map }} | {{ summary_only }} | {{ attribute_map }} | {{ match_map }} | {{ advertise_only }} |
{% endfor %}
{% endif %}
{% if router_bgp.address_family_evpn is arista.avd.defined %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ router bgp {{ router_bgp.as }}
{% if aggregate_address.as_set is arista.avd.defined(true) %}
{% set aggregate_address_cli = aggregate_address_cli ~ " as-set" %}
{% endif %}
{% if aggregate_address.advertise_map is arista.avd.defined %}
{% set aggregate_address_cli = aggregate_address_cli ~ " advertise-map " ~ aggregate_address.advertise_map %}
{% endif %}
{% if aggregate_address.supress_map is arista.avd.defined %}
{% set aggregate_address_cli = aggregate_address_cli ~ " supress-map " ~ aggregate_address.supress_map %}
{% endif %}
{% if aggregate_address.summary_only is arista.avd.defined(true) %}
{% set aggregate_address_cli = aggregate_address_cli ~ " summary-only" %}
{% endif %}
Expand Down Expand Up @@ -1384,6 +1390,12 @@ router bgp {{ router_bgp.as }}
{% if aggregate_address.as_set is arista.avd.defined(true) %}
{% set aggregate_address_cli = aggregate_address_cli ~ " as-set" %}
{% endif %}
{% if aggregate_address.advertise_map is arista.avd.defined %}
{% set aggregate_address_cli = aggregate_address_cli ~ " advertise-map " ~ aggregate_address.advertise_map %}
{% endif %}
{% if aggregate_address.supress_map is arista.avd.defined %}
{% set aggregate_address_cli = aggregate_address_cli ~ " supress-map " ~ aggregate_address.supress_map %}
{% endif %}
{% if aggregate_address.summary_only is arista.avd.defined(true) %}
{% set aggregate_address_cli = aggregate_address_cli ~ " summary-only" %}
{% endif %}
Expand Down

0 comments on commit 5067972

Please sign in to comment.