From 31814d3c28a474aa2ce1fd05d7f4908e77a6b82d Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 10:24:33 +0100 Subject: [PATCH 01/26] Create initial schema --- .../docs/tables/router-bgp.md | 243 ++++++++++++++ .../schema/eos_cli_config_gen.schema.yml | 296 ++++++++++++++++++ .../schema_fragments/router_bgp.schema.yml | 287 +++++++++++++++++ 3 files changed, 826 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index d0bc0b68596..6155627b739 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -385,6 +385,82 @@ | [        include_leaked](## "router_bgp.address_family_ipv4.redistribute_routes.[].include_leaked") | Boolean | | | | Only applicable if `source_protocol` is one of `connected`, `static`, `isis`, `ospf`, `ospfv3`. | | [        rcf](## "router_bgp.address_family_ipv4.redistribute_routes.[].rcf") | String | | | | RCF function name with parenthesis.
Example: MyFunction(myarg).
`route_map` and `rcf` are mutually exclusive. `route_map` takes precedence.
Only applicable if `source_protocol` is one of `connected`, `static`, `isis`, `user`, `dynamic`. | | [        ospf_route_type](## "router_bgp.address_family_ipv4.redistribute_routes.[].ospf_route_type") | String | | | Valid Values:
- external
- internal
- nssa-external
- nssa-external 1
- nssa-external 2 | Routes learned by the OSPF protocol.
The `ospf_route_type` is valid for source_protocols 'ospf' and 'ospfv3'.
| + | [  address_family_ipv4_labeled_unicast](## "router_bgp.address_family_ipv4_labeled_unicast") | Dictionary | | | | | + | [    aigp_session](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session") | Dictionary | | | | | + | [      confederation](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.confederation") | Boolean | | | | | + | [      ebgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ebgp") | Boolean | | | | | + | [      ibgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ibgp") | Boolean | | | | | + | [    bgp_additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths") | Dictionary | | | | BGP additional-paths commands. | + | [      receive](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.receive") | Boolean | | | | Receive multiple paths. | + | [      send](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send") | Dictionary | | | | Send multiple paths. | + | [        any](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.any") | Boolean | | | | Any eligible path. | + | [        backup](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | + | [        ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | + | [        ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | + | [        limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [    bgp_missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy") | Dictionary | | | | | + | [      direction_in_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy.direction_in_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | + | [      direction_out_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy.direction_out_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | + | [    bgp_next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_next_hop_unchanged") | Boolean | | | | | + | [    graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.graceful_restart") | Boolean | | | | | + | [    label_local_termination](## "router_bgp.address_family_ipv4_labeled_unicast.label_local_termination") | String | | | Valid Values:
- explicit-null
- implicit-null | | + | [    lfib_entry_installation_skipped](## "router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped") | Boolean | | | | Skip LFIB entry installation and next hop self route advertisements. | + | [    neighbor_default](## "router_bgp.address_family_ipv4_labeled_unicast.neighbor_default") | Dictionary | | | | | + | [      next_hop_self](## "router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self") | Boolean | | | | | + | [    neighbors](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors") | List, items: Dictionary | | | | | + | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].ip_address") | String | Required, Unique | | | | + | [        activate](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].activate") | Boolean | | | | | + | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths") | Dictionary | | | | BGP additional-paths commands. | + | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.receive") | Boolean | | | | Receive multiple paths. | + | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send") | Dictionary | | | | Send multiple paths. | + | [            any](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.any") | Boolean | | | | Any eligible path. | + | [            backup](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | + | [            ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | + | [            ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | + | [            limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [        aigp_session](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].aigp_session") | Boolean | | | | | + | [        graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart") | Boolean | | | | | + | [        graceful_restart_helper](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart_helper") | Dictionary | | | | | + | [          stale_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart_helper.stale_route_map") | String | | | | | + | [        maximum_advertised_routes](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].maximum_advertised_routes") | Integer | | | Min: 0
Max: 4294967294 | Maximum number of routes (0 means unlimited). | + | [        missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy") | Dictionary | | | | Missing policy configuration for BGP Labeled-Unicast neighbor. | + | [          direction_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in") | Dictionary | | | | Missing policy inbound direction. | + | [            action](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [            include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [            include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [            include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | + | [          direction_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_out") | Dictionary | | | | Missing policy outbound direction. | + | [            action](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_out.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [            include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_out.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [            include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_out.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [            include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_out.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | + | [        multi_path](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].multi_path") | Boolean | | | | | + | [        next_hop_resolution](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_resolution") | Dictionary | | | | | + | [          v4_mapped_v6_translation](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_resolution.v4_mapped_v6_translation") | Boolean | | | | | + | [        next_hop_self](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self") | Boolean | | | | | + | [        next_hop_self_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self_source_interface") | String | | | | Source interface name. | + | [        next_hop_self_v4_mapped_v6_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self_v4_mapped_v6_source_interface") | String | | | | v4-mapped-v6 source interface name. | + | [        next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_unchanged") | Boolean | | | | | + | [        prefix_list_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].prefix_list_in") | String | | | | Inbound prefix-list name. | + | [        prefix_list_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].prefix_list_out") | String | | | | Outbound prefix-list name. | + | [        rcf_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].rcf_in") | String | | | | Inbound RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [        rcf_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].rcf_out") | String | | | | Outbound RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [        route_map_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].route_map_in") | String | | | | Inbound route-map name. | + | [        route_map_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].route_map_out") | String | | | | Outbound route-map name. | + | [    networks](## "router_bgp.address_family_ipv4_labeled_unicast.networks") | List, items: Dictionary | | | | | + | [      - prefix](## "router_bgp.address_family_ipv4_labeled_unicast.networks.[].prefix") | String | Required, Unique | | | IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". | + | [        route_map](## "router_bgp.address_family_ipv4_labeled_unicast.networks.[].route_map") | String | | | | Route-map name. | + | [    next_hops](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops") | List, items: Dictionary | | | | | + | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].ip_address") | String | Required, Unique | | | | + | [        originate](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].originate") | Boolean | | | | | + | [        lfib_backup_ip_forwarding](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].lfib_backup_ip_forwarding") | Boolean | | | | | + | [    next_hop_resolution_ribs](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs") | List, items: Dictionary | | | Min Length: 1
Max Length: 3 | Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. | + | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib-colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | + | [        rib_name](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. | + | [    tunnel_source_protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | + | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol.[].protocol") | String | | | Valid Values:
- isis segment-routing
- ldp | | + | [        rcf](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol.[].rcf") | String | | | | Optional RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [    update_wait_for_convergence](## "router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence") | Boolean | | | | Wait for BGP to converge before sending out any route updates. | | [  address_family_ipv4_multicast](## "router_bgp.address_family_ipv4_multicast") | Dictionary | | | | | | [    peer_groups](## "router_bgp.address_family_ipv4_multicast.peer_groups") | List, items: Dictionary | | | | | | [      - name](## "router_bgp.address_family_ipv4_multicast.peer_groups.[].name") | String | Required, Unique | | | Peer-group name. | @@ -1609,6 +1685,173 @@ # Routes learned by the OSPF protocol. # The `ospf_route_type` is valid for source_protocols 'ospf' and 'ospfv3'. ospf_route_type: + address_family_ipv4_labeled_unicast: + aigp_session: + confederation: + ebgp: + ibgp: + + # BGP additional-paths commands. + bgp_additional_paths: + + # Receive multiple paths. + receive: + + # Send multiple paths. + send: + + # Any eligible path. + any: + + # Best path and installed backup path. + backup: + + # All paths in best path ECMP group. + ecmp: + + # Amount of ECMP paths to send. + ecmp_limit: + + # Amount of paths to send. + limit: + bgp_missing_policy: + direction_in_action: + direction_out_action: + bgp_next_hop_unchanged: + graceful_restart: + label_local_termination: + + # Skip LFIB entry installation and next hop self route advertisements. + lfib_entry_installation_skipped: + neighbor_default: + next_hop_self: + neighbors: + - ip_address: + activate: + + # BGP additional-paths commands. + additional_paths: + + # Receive multiple paths. + receive: + + # Send multiple paths. + send: + + # Any eligible path. + any: + + # Best path and installed backup path. + backup: + + # All paths in best path ECMP group. + ecmp: + + # Amount of ECMP paths to send. + ecmp_limit: + + # Amount of paths to send. + limit: + aigp_session: + graceful_restart: + graceful_restart_helper: + stale_route_map: + + # Maximum number of routes (0 means unlimited). + maximum_advertised_routes: + + # Missing policy configuration for BGP Labeled-Unicast neighbor. + missing_policy: + + # Missing policy inbound direction. + direction_in: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: + + # Missing policy outbound direction. + direction_out: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: + multi_path: + next_hop_resolution: + v4_mapped_v6_translation: + next_hop_self: + + # Source interface name. + next_hop_self_source_interface: + + # v4-mapped-v6 source interface name. + next_hop_self_v4_mapped_v6_source_interface: + next_hop_unchanged: + + # Inbound prefix-list name. + prefix_list_in: + + # Outbound prefix-list name. + prefix_list_out: + + # Inbound RCF function name with parenthesis. + # Example: MyFunction(myarg). + rcf_in: + + # Outbound RCF function name with parenthesis. + # Example: MyFunction(myarg). + rcf_out: + + # Inbound route-map name. + route_map_in: + + # Outbound route-map name. + route_map_out: + networks: + + # IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". + - prefix: + + # Route-map name. + route_map: + next_hops: + - ip_address: + originate: + lfib_backup_ip_forwarding: + + # Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. + next_hop_resolution_ribs: # 1-3 items + + # Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. + - rib_type: + + # The name of the tunnel-rib to use when using 'tunnel-rib' type. + rib_name: + tunnel_source_protocol: # 1-2 items + - protocol: + + # Optional RCF function name with parenthesis. + # Example: MyFunction(myarg). + rcf: + + # Wait for BGP to converge before sending out any route updates. + update_wait_for_convergence: address_family_ipv4_multicast: peer_groups: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 564773cd146..e62ca1ccdfb 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -12891,6 +12891,302 @@ keys: ''ospfv3''. ' + address_family_ipv4_labeled_unicast: + type: dict + keys: + aigp_session: + type: dict + keys: + confederation: + type: bool + ebgp: + type: bool + ibgp: + type: bool + bgp_additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + bgp_missing_policy: + type: dict + keys: + direction_in_action: + type: str + valid_values: + - deny + - deny-in-out + - permit + direction_out_action: + type: str + valid_values: + - deny + - deny-in-out + - permit + bgp_next_hop_unchanged: + type: bool + graceful_restart: + type: bool + label_local_termination: + type: str + valid_values: + - explicit-null + - implicit-null + lfib_entry_installation_skipped: + type: bool + description: Skip LFIB entry installation and next hop self route advertisements. + neighbor_default: + type: dict + keys: + next_hop_self: + type: bool + neighbors: + type: list + primary_key: ip_address + items: + type: dict + keys: + ip_address: + type: str + activate: + type: bool + additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + aigp_session: + type: bool + graceful_restart: + type: bool + graceful_restart_helper: + type: dict + keys: + stale_route_map: + type: str + maximum_advertised_routes: + type: int + description: Maximum number of routes (0 means unlimited). + min: 0 + max: 4294967294 + convert_types: + - str + missing_policy: + type: dict + description: Missing policy configuration for BGP Labeled-Unicast + neighbor. + keys: + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing + policy decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing + policy decision. + multi_path: + type: bool + next_hop_resolution: + type: dict + keys: + v4_mapped_v6_translation: + type: bool + next_hop_self: + type: bool + next_hop_self_source_interface: + description: Source interface name. + type: str + next_hop_self_v4_mapped_v6_source_interface: + description: v4-mapped-v6 source interface name. + type: str + next_hop_unchanged: + type: bool + prefix_list_in: + type: str + description: Inbound prefix-list name. + prefix_list_out: + type: str + description: Outbound prefix-list name. + rcf_in: + type: str + description: 'Inbound RCF function name with parenthesis. + + Example: MyFunction(myarg).' + rcf_out: + type: str + description: 'Outbound RCF function name with parenthesis. + + Example: MyFunction(myarg).' + route_map_in: + type: str + description: Inbound route-map name. + route_map_out: + type: str + description: Outbound route-map name. + networks: + type: list + primary_key: prefix + items: + type: dict + keys: + prefix: + description: IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". + type: str + route_map: + description: Route-map name. + type: str + next_hops: + type: list + primary_key: ip_address + items: + type: dict + keys: + ip_address: + type: str + originate: + type: bool + lfib_backup_ip_forwarding: + type: bool + next_hop_resolution_ribs: + type: list + min_length: 1 + max_length: 3 + description: Specify the RIBs used to resolve next-hops. The order of + this list determines the order of RIB lookups. + items: + type: dict + keys: + rib_type: + type: str + required: true + valid_values: + - system-connected + - tunnel-rib-colored + - tunnel-rib + description: Type of RIB. For 'tunnel-rib', use 'rib_name' to specify + the name of the Tunnel-RIB to use. + rib_name: + type: str + description: The name of the tunnel-rib to use when using 'tunnel-rib' + type. + tunnel_source_protocol: + type: list + min_length: 1 + max_length: 2 + items: + type: dict + keys: + protocol: + type: str + valid_values: + - isis segment-routing + - ldp + rcf: + type: str + description: 'Optional RCF function name with parenthesis. + + Example: MyFunction(myarg).' + update_wait_for_convergence: + type: bool + description: Wait for BGP to converge before sending out any route updates. address_family_ipv4_multicast: type: dict keys: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 1c40d5aef55..ac7a87e989a 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1439,6 +1439,293 @@ keys: description: | Routes learned by the OSPF protocol. The `ospf_route_type` is valid for source_protocols 'ospf' and 'ospfv3'. + address_family_ipv4_labeled_unicast: + type: dict + keys: + aigp_session: + type: dict + keys: + confederation: + type: bool + ebgp: + type: bool + ibgp: + type: bool + bgp_additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + bgp_missing_policy: + type: dict + keys: + direction_in_action: + type: str + valid_values: + - "deny" + - "deny-in-out" + - "permit" + direction_out_action: + type: str + valid_values: + - "deny" + - "deny-in-out" + - "permit" + bgp_next_hop_unchanged: + type: bool + graceful_restart: + type: bool + label_local_termination: + type: str + valid_values: + - "explicit-null" + - "implicit-null" + lfib_entry_installation_skipped: + type: bool + description: Skip LFIB entry installation and next hop self route advertisements. + neighbor_default: + type: dict + keys: + next_hop_self: + type: bool + neighbors: + type: list + primary_key: ip_address + items: + type: dict + keys: + ip_address: + type: str + activate: + type: bool + additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + aigp_session: + type: bool + graceful_restart: + type: bool + graceful_restart_helper: + type: dict + keys: + stale_route_map: + type: str + maximum_advertised_routes: + type: int + description: Maximum number of routes (0 means unlimited). + min: 0 + max: 4294967294 + convert_types: + - str + missing_policy: + type: dict + description: Missing policy configuration for BGP Labeled-Unicast neighbor. + keys: + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. + multi_path: + type: bool + next_hop_resolution: + type: dict + keys: + v4_mapped_v6_translation: + type: bool + next_hop_self: + type: bool + next_hop_self_source_interface: + description: Source interface name. + type: str + next_hop_self_v4_mapped_v6_source_interface: + description: v4-mapped-v6 source interface name. + type: str + next_hop_unchanged: + type: bool + prefix_list_in: + type: str + description: Inbound prefix-list name. + prefix_list_out: + type: str + description: Outbound prefix-list name. + rcf_in: + type: str + description: |- + Inbound RCF function name with parenthesis. + Example: MyFunction(myarg). + rcf_out: + type: str + description: |- + Outbound RCF function name with parenthesis. + Example: MyFunction(myarg). + route_map_in: + type: str + description: Inbound route-map name. + route_map_out: + type: str + description: Outbound route-map name. + networks: + type: list + primary_key: prefix + items: + type: dict + keys: + prefix: + description: IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". + type: str + route_map: + description: Route-map name. + type: str + next_hops: + type: list + primary_key: ip_address + items: + type: dict + keys: + ip_address: + type: str + originate: + type: bool + lfib_backup_ip_forwarding: + type: bool + next_hop_resolution_ribs: + type: list + min_length: 1 + max_length: 3 + description: "Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups." + items: + type: dict + keys: + rib_type: + type: str + required: true + valid_values: + - "system-connected" + - "tunnel-rib-colored" + - "tunnel-rib" + description: "Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use." + rib_name: + type: str + description: "The name of the tunnel-rib to use when using 'tunnel-rib' type." + tunnel_source_protocol: + type: list + min_length: 1 + max_length: 2 + items: + type: dict + keys: + protocol: + type: str + valid_values: + - "isis segment-routing" + - "ldp" + rcf: + type: str + description: |- + Optional RCF function name with parenthesis. + Example: MyFunction(myarg). + update_wait_for_convergence: + type: bool + description: Wait for BGP to converge before sending out any route updates. + address_family_ipv4_multicast: type: dict keys: From 6c25fb14a1992258c1a21eb6ab0a7ef011f847d2 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 10:32:28 +0100 Subject: [PATCH 02/26] Cleanup --- .../schema/schema_fragments/router_bgp.schema.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index ac7a87e989a..3f0a99def53 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1725,7 +1725,6 @@ keys: update_wait_for_convergence: type: bool description: Wait for BGP to converge before sending out any route updates. - address_family_ipv4_multicast: type: dict keys: From afa21dd4e8cf58fe7d8af20ced4ef65b6e66a944 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 12:30:13 +0100 Subject: [PATCH 03/26] Schema updates Initial CLI render - peer-groups not done yet Documentation not done yet Molecule tests not done --- .../docs/tables/router-bgp.md | 101 +++++----- .../j2templates/eos/router-bgp.j2 | 178 ++++++++++++++++++ .../schema/eos_cli_config_gen.schema.yml | 121 ++++++------ .../schema_fragments/router_bgp.schema.yml | 116 ++++++------ 4 files changed, 352 insertions(+), 164 deletions(-) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index 6155627b739..8dd182893a2 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -390,18 +390,19 @@ | [      confederation](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.confederation") | Boolean | | | | | | [      ebgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ebgp") | Boolean | | | | | | [      ibgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ibgp") | Boolean | | | | | - | [    bgp_additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths") | Dictionary | | | | BGP additional-paths commands. | - | [      receive](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.receive") | Boolean | | | | Receive multiple paths. | - | [      send](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send") | Dictionary | | | | Send multiple paths. | - | [        any](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.any") | Boolean | | | | Any eligible path. | - | [        backup](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | - | [        ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | - | [        ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | - | [        limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | - | [    bgp_missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy") | Dictionary | | | | | - | [      direction_in_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy.direction_in_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | - | [      direction_out_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_missing_policy.direction_out_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | - | [    bgp_next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.bgp_next_hop_unchanged") | Boolean | | | | | + | [    bgp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp") | Dictionary | | | | | + | [      additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths") | Dictionary | | | | BGP additional-paths commands. | + | [        receive](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive") | Boolean | | | | Receive multiple paths. | + | [        send](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send") | Dictionary | | | | Send multiple paths. | + | [          any](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.any") | Boolean | | | | Any eligible path. | + | [          backup](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | + | [          ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | + | [          ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | + | [          limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [      missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy") | Dictionary | | | | | + | [        direction_in_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | + | [        direction_out_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | + | [      next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged") | Boolean | | | | | | [    graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.graceful_restart") | Boolean | | | | | | [    label_local_termination](## "router_bgp.address_family_ipv4_labeled_unicast.label_local_termination") | String | | | Valid Values:
- explicit-null
- implicit-null | | | [    lfib_entry_installation_skipped](## "router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped") | Boolean | | | | Skip LFIB entry installation and next hop self route advertisements. | @@ -423,6 +424,7 @@ | [        graceful_restart_helper](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart_helper") | Dictionary | | | | | | [          stale_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart_helper.stale_route_map") | String | | | | | | [        maximum_advertised_routes](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].maximum_advertised_routes") | Integer | | | Min: 0
Max: 4294967294 | Maximum number of routes (0 means unlimited). | + | [        maximum_advertised_routes_warning_limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].maximum_advertised_routes_warning_limit") | String | | | | Maximum number of routes after which a warning is issued (0 means never warn) or
Percentage of maximum number of routes at which to warn ("<1-100> percent").
| | [        missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy") | Dictionary | | | | Missing policy configuration for BGP Labeled-Unicast neighbor. | | [          direction_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in") | Dictionary | | | | Missing policy inbound direction. | | [            action](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].missing_policy.direction_in.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | @@ -439,27 +441,24 @@ | [          v4_mapped_v6_translation](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_resolution.v4_mapped_v6_translation") | Boolean | | | | | | [        next_hop_self](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self") | Boolean | | | | | | [        next_hop_self_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self_source_interface") | String | | | | Source interface name. | - | [        next_hop_self_v4_mapped_v6_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self_v4_mapped_v6_source_interface") | String | | | | v4-mapped-v6 source interface name. | + | [        next_hop_self_v4_mapped_v6_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_self_v4_mapped_v6_source_interface") | String | | | | v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. | | [        next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].next_hop_unchanged") | Boolean | | | | | - | [        prefix_list_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].prefix_list_in") | String | | | | Inbound prefix-list name. | - | [        prefix_list_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].prefix_list_out") | String | | | | Outbound prefix-list name. | | [        rcf_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].rcf_in") | String | | | | Inbound RCF function name with parenthesis.
Example: MyFunction(myarg). | | [        rcf_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].rcf_out") | String | | | | Outbound RCF function name with parenthesis.
Example: MyFunction(myarg). | | [        route_map_in](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].route_map_in") | String | | | | Inbound route-map name. | | [        route_map_out](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].route_map_out") | String | | | | Outbound route-map name. | - | [    networks](## "router_bgp.address_family_ipv4_labeled_unicast.networks") | List, items: Dictionary | | | | | + | [    networks](## "router_bgp.address_family_ipv4_labeled_unicast.networks") | List, items: Dictionary | | | Min Length: 1 | | | [      - prefix](## "router_bgp.address_family_ipv4_labeled_unicast.networks.[].prefix") | String | Required, Unique | | | IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". | | [        route_map](## "router_bgp.address_family_ipv4_labeled_unicast.networks.[].route_map") | String | | | | Route-map name. | - | [    next_hops](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops") | List, items: Dictionary | | | | | + | [    next_hops](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops") | List, items: Dictionary | | | Min Length: 1 | | | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].ip_address") | String | Required, Unique | | | | - | [        originate](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].originate") | Boolean | | | | | | [        lfib_backup_ip_forwarding](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].lfib_backup_ip_forwarding") | Boolean | | | | | | [    next_hop_resolution_ribs](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs") | List, items: Dictionary | | | Min Length: 1
Max Length: 3 | Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. | | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib-colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | | [        rib_name](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. | - | [    tunnel_source_protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | - | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol.[].protocol") | String | | | Valid Values:
- isis segment-routing
- ldp | | - | [        rcf](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocol.[].rcf") | String | | | | Optional RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [    tunnel_source_protocols](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | + | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].protocol") | String | | | Valid Values:
- isis segment-routing
- ldp | | + | [        rcf](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].rcf") | String | | | | Optional RCF function name with parenthesis.
Example: MyFunction(myarg). | | [    update_wait_for_convergence](## "router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence") | Boolean | | | | Wait for BGP to converge before sending out any route updates. | | [  address_family_ipv4_multicast](## "router_bgp.address_family_ipv4_multicast") | Dictionary | | | | | | [    peer_groups](## "router_bgp.address_family_ipv4_multicast.peer_groups") | List, items: Dictionary | | | | | @@ -1690,34 +1689,35 @@ confederation: ebgp: ibgp: + bgp: - # BGP additional-paths commands. - bgp_additional_paths: + # BGP additional-paths commands. + additional_paths: - # Receive multiple paths. - receive: + # Receive multiple paths. + receive: - # Send multiple paths. - send: + # Send multiple paths. + send: - # Any eligible path. - any: + # Any eligible path. + any: - # Best path and installed backup path. - backup: + # Best path and installed backup path. + backup: - # All paths in best path ECMP group. - ecmp: + # All paths in best path ECMP group. + ecmp: - # Amount of ECMP paths to send. - ecmp_limit: + # Amount of ECMP paths to send. + ecmp_limit: - # Amount of paths to send. - limit: - bgp_missing_policy: - direction_in_action: - direction_out_action: - bgp_next_hop_unchanged: + # Amount of paths to send. + limit: + missing_policy: + direction_in_action: + direction_out_action: + next_hop_unchanged: graceful_restart: label_local_termination: @@ -1760,6 +1760,10 @@ # Maximum number of routes (0 means unlimited). maximum_advertised_routes: + # Maximum number of routes after which a warning is issued (0 means never warn) or + # Percentage of maximum number of routes at which to warn ("<1-100> percent"). + maximum_advertised_routes_warning_limit: + # Missing policy configuration for BGP Labeled-Unicast neighbor. missing_policy: @@ -1800,16 +1804,10 @@ # Source interface name. next_hop_self_source_interface: - # v4-mapped-v6 source interface name. + # v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. next_hop_self_v4_mapped_v6_source_interface: next_hop_unchanged: - # Inbound prefix-list name. - prefix_list_in: - - # Outbound prefix-list name. - prefix_list_out: - # Inbound RCF function name with parenthesis. # Example: MyFunction(myarg). rcf_in: @@ -1823,16 +1821,15 @@ # Outbound route-map name. route_map_out: - networks: + networks: # >=1 items # IPv4 prefix "A.B.C.D/E" or IPv6 prefix "A:B:C:D:E:F:G:H/I". - prefix: # Route-map name. route_map: - next_hops: + next_hops: # >=1 items - ip_address: - originate: lfib_backup_ip_forwarding: # Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. @@ -1843,7 +1840,7 @@ # The name of the tunnel-rib to use when using 'tunnel-rib' type. rib_name: - tunnel_source_protocol: # 1-2 items + tunnel_source_protocols: # 1-2 items - protocol: # Optional RCF function name with parenthesis. diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 0f953bbcb81..85967cea424 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -946,6 +946,184 @@ router bgp {{ router_bgp.as }} {% endif %} {% endfor %} {% endif %} + +{# address family ipv4 BGP Labeled-Unicast activation #} +{% if router_bgp.address_family_ipv4_labaled_unicast is arista.avd.defined %} + ! + address-family ipv4 labeled-unicast +{% if router_bgp.address_family_ipv4_labaled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} + update wait-for-convergence +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_in_action is arista.avd.defined %} + bgp missing-policy direction in action {{ router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_in_action }} +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_out_action is arista.avd.defined %} + bgp missing-policy direction out action {{ router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_out_action }} +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.receive is arista.avd.defined(true) %} + bgp additional-paths receive +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.any is arista.avd.defined(true) %} + bgp additional-paths send any +{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.backup is arista.avd.defined(true) %} + bgp additional-paths send backup +{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.ecmp is arista.avd.defined(true) %} + bgp additional-paths send ecmp +{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.ecmp_limit is arista.avd.defined %} + bgp additional-paths send ecmp limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.ecmp_limit }} +{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.limit is arista.avd.defined %} + bgp additional-paths send limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.limit }} +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} + bgp next-hop-unchanged +{% endif %} +{% for neighbor in router_bgp.address_family_ipv4_labaled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} +{% if neighbor.activate is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} activate +{% else %} + no neighbor {{ neighbor.ip_address }} activate +{% endif %} +{% if neighbor.additional_paths.receive is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} additional-paths receive +{% endif %} +{% if neighbor.route_map_in is arista.avd.defined %} +neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_in }} in +{% endif %} +{% if neighbor.route_map_out is arista.avd.defined %} +neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_out }} out +{% endif %} +{% if neighbor.rcf_in is arista.avd.defined %} +neighbor {{ neighbor.ip_address }} rcf in {{ neighbor.rcf_in }} +{% endif %} +{% if neighbor.rcf_out is arista.avd.defined %} +neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} +{% endif %} +{% if neighbor.graceful_restart is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} graceful-restart +{% endif %} +{% if neighbor.graceful_restart_helper.stale_route_map is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} graceful-restart-helper stale-route route-map {{ neighbor.graceful_restart_helper.stale_route_map }} +{% endif %} +{% if neighbor.additional_paths.send.any is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} additional-paths send any +{% elif neighbor.additional_paths.send.backup is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} additional-paths send backup +{% elif neighbor.additional_paths.send.ecmp is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} additional-paths send ecmp +{% elif neighbor.additional_paths.send.ecmp_limit is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} additional-paths send ecmp limit {{ neighbor.additional_paths.send.ecmp_limit }} +{% elif neighbor.additional_paths.send.limit is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} additional-paths send limit {{ neighbor.additional_paths.send.limit }} +{% endif %} +{% if neighbor.next_hop_unchanged is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} next-hop-unchanged +{% endif %} +{% if neighbor.next_hop_self is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} next-hop-self +{% endif %} +{% if neighbor.next_hop_self_v4_mapped_v6_source_interface is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} next-hop-self v4-mapped-v6 source-interface {{ neighbor.next_hop_self_v4_mapped_v6_source_interface }} +{% elif neighbor.next_hop_self_source_interface is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} next-hop-self source-interface {{ neighbor.next_hop_self_source_interface }} +{% endif %} +{% if neighbor.maximum_advertised_routes is arista.avd.defined %} +{% set maximum_routes_cli = "neighbor " ~neighbor.ip_address ~ " maximum-routes " ~neighbor.maximum_advertised_routes %} +{% if neighbor.maximum_advertised_routes_warning_limit is arista.avd.defined %} +{% set maximum_routes_cli = maximum_routes_cli ~ " warning-limit " ~ neighbor.maximum_advertised_routes_warning_limit %} +{% endif %} + {{ maximum_routes_cli }} +{% endif %} +{% if neighbor.missing_policy is arista.avd.defined %} +{% for direction in ['in', 'out'] %} +{% set dir = 'direction_' ~ direction %} +{% set policy = neighbor.missing_policy[dir] %} +{% if policy.action is arista.avd.defined %} +{% set missing_policy_cli = "neighbor " ~ neighbor.ip_address ~ " missing-policy address-family all" %} +{% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " include" %} +{% if policy.include_community_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " community-list" %} +{% endif %} +{% if policy.include_prefix_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " prefix-list" %} +{% endif %} +{% if policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " sub-route-map" %} +{% endif %} +{% endif %} +{% set missing_policy_cli = missing_policy_cli ~ " direction " ~ direction ~ " action " ~ policy.action %} + {{ missing_policy_cli }} +{% endif %} +{% endfor %} +{% endif %} +{% if neighbor.aigp_session is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} aigp-session +{% endif %} +{% if neighbor.multi_path is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} multi-path +{% endif %} +{% if neighbor.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} next-hop resolution v4-mapped-v6 translation +{% elif neighbor.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(false) %} + neighbor {{ neighbor.ip_address }} next-hop resolution v4-mapped-v6 translation disabled +{% endif %} +{% endfor %} +{% for network in router_bgp.address_family_ipv4_labaled_unicast.networks %} +{% set network_cli = "network " ~ network.prefix %} +{% if network.route_map is arista.avd.defined %} +{% set network_cli = network_cli ~ " route-map " ~ network.route_map %} +{% endif %} + {{ network_cli }} +{% endfor %} +{% for next_hop in router_bgp.address_family_ipv4_labaled_unicast.next_hops %} +{% set next_hop_cli = "next-hop " ~ next_hop.ip_address ~ " originate" %} +{% if next_hop.lfib_backup_ip_forwarding is arista.avd.defined(true) %} +{% set next_hop_cli = next_hop_cli ~ " lfib-backup ip-forwarding" %} +{% endif %} + {{ next_hop_cli }} +{% endfor %} +{% if router_bgp.address_family_ipv4_labaled_unicast.lfib_entry_installation_skipped is arista.avd.defined(true) %} + lfib entry installation skipped +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.label_local_termination is arista.avd.defined %} + label local-termination {{ router_bgp.address_family_ipv4_labaled_unicast.label_local_termination }} +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.graceful_restart is arista.avd.defined(true) %} + graceful-restart +{% endif %} +{% if router_bgp.address_family_ipv4_labaled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} + neighbor default next-hop-self +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} +{% set v4_bgp_lu_resolution_ribs = [] %} +{% for rib in router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs %} +{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} +{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib-colored system-colored-tunnel-rib") %} +{% elif rib.rib_type is arista.avd.defined("tunnel-rib") and rib.rib_name is arista.avd.defined() %} +{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} +{% elif rib.rib_type is arista.avd.defined %} +{% do v4_bgp_lu_resolution_ribs.append(rib.rib_type) %} +{% endif %} +{% endfor %} +{% if v4_bgp_lu_resolution_ribs %} + next-hop resolution ribs {{ v4_bgp_lu_resolution_ribs | join(" ") }} +{% endif %} +{% endif %} +{% for tunnel_source_protocol in router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols %} +{% set tunnel_source_protocol_cli = "tunnel source-protocol " ~ tunnel_source_protocol.protocol %} +{% if tunnel_source_protocol.rcf is arista.avd.defined %} +{% set tunnel_source_protocol_cli = tunnel_source_protocol_cli ~ " rcf " ~ tunnel_source_protocol.rcf %} +{% endif %} + {{ tunnel_source_protocol_cli }} +{% endfor %} +{% if router_bgp.address_family_ipv4_labeled_unicast.aigp_session is arista.avd.defined %} +{% for aigp_session_type in ['ibgp','confederation','ebgp'] %} +{% if router_bgp.address_family_ipv4_labeled_unicast.aigp_session[aigp_session_type] is arista.avd.defined(true) %} + aigp-session {{ aigp_session_type }} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} {# address family ipv4 multicast activation #} {% if router_bgp.address_family_ipv4_multicast is arista.avd.defined %} ! diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index e62ca1ccdfb..c7cba0491a2 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -12903,57 +12903,60 @@ keys: type: bool ibgp: type: bool - bgp_additional_paths: + bgp: type: dict - description: BGP additional-paths commands. keys: - receive: - type: bool - description: Receive multiple paths. - send: + additional_paths: type: dict - description: Send multiple paths. + description: BGP additional-paths commands. keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: + receive: type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 - bgp_missing_policy: - type: dict - keys: - direction_in_action: - type: str - valid_values: - - deny - - deny-in-out - - permit - direction_out_action: - type: str - valid_values: - - deny - - deny-in-out - - permit - bgp_next_hop_unchanged: - type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + missing_policy: + type: dict + keys: + direction_in_action: + type: str + valid_values: + - deny + - deny-in-out + - permit + direction_out_action: + type: str + valid_values: + - deny + - deny-in-out + - permit + next_hop_unchanged: + type: bool graceful_restart: type: bool label_local_termination: @@ -13029,6 +13032,17 @@ keys: max: 4294967294 convert_types: - str + maximum_advertised_routes_warning_limit: + type: str + convert_types: + - int + description: 'Maximum number of routes after which a warning is + issued (0 means never warn) or + + Percentage of maximum number of routes at which to warn ("<1-100> + percent"). + + ' missing_policy: type: dict description: Missing policy configuration for BGP Labeled-Unicast @@ -13095,16 +13109,11 @@ keys: description: Source interface name. type: str next_hop_self_v4_mapped_v6_source_interface: - description: v4-mapped-v6 source interface name. + description: v4-mapped-v6 source interface name. Takes precedence + over the next_hop_self_source_interface. type: str next_hop_unchanged: type: bool - prefix_list_in: - type: str - description: Inbound prefix-list name. - prefix_list_out: - type: str - description: Outbound prefix-list name. rcf_in: type: str description: 'Inbound RCF function name with parenthesis. @@ -13124,6 +13133,7 @@ keys: networks: type: list primary_key: prefix + min_length: 1 items: type: dict keys: @@ -13136,13 +13146,12 @@ keys: next_hops: type: list primary_key: ip_address + min_length: 1 items: type: dict keys: ip_address: type: str - originate: - type: bool lfib_backup_ip_forwarding: type: bool next_hop_resolution_ribs: @@ -13167,7 +13176,7 @@ keys: type: str description: The name of the tunnel-rib to use when using 'tunnel-rib' type. - tunnel_source_protocol: + tunnel_source_protocols: type: list min_length: 1 max_length: 2 diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 3f0a99def53..d4354fc879f 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1451,57 +1451,60 @@ keys: type: bool ibgp: type: bool - bgp_additional_paths: + bgp: type: dict - description: BGP additional-paths commands. keys: - receive: - type: bool - description: Receive multiple paths. - send: + additional_paths: type: dict - description: Send multiple paths. + description: BGP additional-paths commands. keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: + receive: type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 - bgp_missing_policy: - type: dict - keys: - direction_in_action: - type: str - valid_values: - - "deny" - - "deny-in-out" - - "permit" - direction_out_action: - type: str - valid_values: - - "deny" - - "deny-in-out" - - "permit" - bgp_next_hop_unchanged: - type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + missing_policy: + type: dict + keys: + direction_in_action: + type: str + valid_values: + - "deny" + - "deny-in-out" + - "permit" + direction_out_action: + type: str + valid_values: + - "deny" + - "deny-in-out" + - "permit" + next_hop_unchanged: + type: bool graceful_restart: type: bool label_local_termination: @@ -1577,6 +1580,13 @@ keys: max: 4294967294 convert_types: - str + maximum_advertised_routes_warning_limit: + type: str + convert_types: + - int + description: | + Maximum number of routes after which a warning is issued (0 means never warn) or + Percentage of maximum number of routes at which to warn ("<1-100> percent"). missing_policy: type: dict description: Missing policy configuration for BGP Labeled-Unicast neighbor. @@ -1636,16 +1646,10 @@ keys: description: Source interface name. type: str next_hop_self_v4_mapped_v6_source_interface: - description: v4-mapped-v6 source interface name. + description: v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. type: str next_hop_unchanged: type: bool - prefix_list_in: - type: str - description: Inbound prefix-list name. - prefix_list_out: - type: str - description: Outbound prefix-list name. rcf_in: type: str description: |- @@ -1665,6 +1669,7 @@ keys: networks: type: list primary_key: prefix + min_length: 1 items: type: dict keys: @@ -1677,13 +1682,12 @@ keys: next_hops: type: list primary_key: ip_address + min_length: 1 items: type: dict keys: ip_address: type: str - originate: - type: bool lfib_backup_ip_forwarding: type: bool next_hop_resolution_ribs: @@ -1705,7 +1709,7 @@ keys: rib_name: type: str description: "The name of the tunnel-rib to use when using 'tunnel-rib' type." - tunnel_source_protocol: + tunnel_source_protocols: type: list min_length: 1 max_length: 2 From ec5785430208a78dc907121081a19f6c78a40c68 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 13:41:55 +0100 Subject: [PATCH 04/26] Fix template Add inital testing --- .../router-bgp-ipv4-labeled-unicast.yml | 65 +++++++++++++ .../eos_cli_config_gen/inventory/hosts.ini | 1 + .../j2templates/eos/router-bgp.j2 | 93 ++++++++++--------- 3 files changed, 115 insertions(+), 44 deletions(-) create mode 100644 ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml new file mode 100644 index 00000000000..39fcf8ebaf6 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -0,0 +1,65 @@ +router_bgp: + as: 65101 + router_id: 192.168.255.3 + bgp_defaults: + - no bgp default ipv4-unicast + - distance bgp 20 200 200 + - graceful-restart restart-time 300 + - graceful-restart + - maximum-paths 2 ecmp 2 + peer_groups: + - name: EVPN-OVERLAY-PEERS + type: evpn + remote_as: 65001 + update_source: Loopback0 + bfd: true + ebgp_multihop: 3 + password: "q+VNViP5i4rVjW1cxFv2wA==" + send_community: all + maximum_routes: 0 + default_originate: + enabled: true + route_map: RM-FOO + always: true + rib_in_pre_policy_retain: + enabled: true + all: true + - name: MLAG-IPv4-UNDERLAY-PEER + type: ipv4 + remote_as: 65101 + # Test no config generation + default_originate: + # Test no config generation + rib_in_pre_policy_retain: + neighbors: + - ip_address: 192.168.255.1 + peer_group: EVPN-OVERLAY-PEERS + - ip_address: 192.168.255.2 + peer_group: EVPN-OVERLAY-PEERS + address_family_ipv4_labeled_unicast: + bgp: + additional_paths: + send: + limit: 10 + aigp_session: + confederation: true + next_hop_resolution_ribs: + - rib_type: "tunnel-rib-colored" + - rib_type: "tunnel-rib" + rib_name: "test-rib" + - rib_type: "system-connected" + label_local_termination: explicit-null + + neighbors: + - ip_address: 192.168.255.3 + activate: true + aigp_session: true + multi_path: true + graceful_restart: true + - ip_address: 192.168.255.4 + rcf_in: Address_Family_EVPN_In() + rcf_out: Address_Family_EVPN_Out() + networks: + - prefix: 203.0.113.0/25 + route_map: RM_TEST + - prefix: 203.0.113.128/25 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini index 1a74687b5b5..5ca01bf1d55 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini @@ -133,6 +133,7 @@ router-bgp-base router-bgp-evpn router-bgp-evpn-vpn-import-pruning router-bgp-evpn-mpls +router-bgp-ipv4-labeled-unicast router-bgp-link-state router-bgp-path-selection router-bgp-rtc diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 85967cea424..17eee784877 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -946,57 +946,56 @@ router bgp {{ router_bgp.as }} {% endif %} {% endfor %} {% endif %} - {# address family ipv4 BGP Labeled-Unicast activation #} -{% if router_bgp.address_family_ipv4_labaled_unicast is arista.avd.defined %} +{% if router_bgp.address_family_ipv4_labeled_unicast is arista.avd.defined %} ! address-family ipv4 labeled-unicast -{% if router_bgp.address_family_ipv4_labaled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} update wait-for-convergence {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_in_action is arista.avd.defined %} - bgp missing-policy direction in action {{ router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_in_action }} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action is arista.avd.defined %} + bgp missing-policy direction in action {{ router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action }} {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_out_action is arista.avd.defined %} - bgp missing-policy direction out action {{ router_bgp.address_family_ipv4_labaled_unicast.bgp.missing_policy.direction_out_action }} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action is arista.avd.defined %} + bgp missing-policy direction out action {{ router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action }} {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.receive is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive is arista.avd.defined(true) %} bgp additional-paths receive {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.any is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.any is arista.avd.defined(true) %} bgp additional-paths send any -{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.backup is arista.avd.defined(true) %} +{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.backup is arista.avd.defined(true) %} bgp additional-paths send backup -{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.ecmp is arista.avd.defined(true) %} +{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp is arista.avd.defined(true) %} bgp additional-paths send ecmp -{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.ecmp_limit is arista.avd.defined %} +{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp_limit is arista.avd.defined %} bgp additional-paths send ecmp limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.ecmp_limit }} -{% elif router_bgp.address_family_ipv4_labaled_unicast.bgp.additional_paths.send.limit is arista.avd.defined %} +{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.limit is arista.avd.defined %} bgp additional-paths send limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.limit }} {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} bgp next-hop-unchanged {% endif %} -{% for neighbor in router_bgp.address_family_ipv4_labaled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} +{% for neighbor in router_bgp.address_family_ipv4_labeled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} {% if neighbor.activate is arista.avd.defined(true) %} - neighbor {{ neighbor.ip_address }} activate + neighbor {{ neighbor.ip_address }} activate {% else %} - no neighbor {{ neighbor.ip_address }} activate + no neighbor {{ neighbor.ip_address }} activate {% endif %} {% if neighbor.additional_paths.receive is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} additional-paths receive {% endif %} {% if neighbor.route_map_in is arista.avd.defined %} -neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_in }} in + neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_in }} in {% endif %} {% if neighbor.route_map_out is arista.avd.defined %} -neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_out }} out + neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_out }} out {% endif %} {% if neighbor.rcf_in is arista.avd.defined %} -neighbor {{ neighbor.ip_address }} rcf in {{ neighbor.rcf_in }} + neighbor {{ neighbor.ip_address }} rcf in {{ neighbor.rcf_in }} {% endif %} {% if neighbor.rcf_out is arista.avd.defined %} -neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} + neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} {% endif %} {% if neighbor.graceful_restart is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} graceful-restart @@ -1068,30 +1067,34 @@ neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} neighbor {{ neighbor.ip_address }} next-hop resolution v4-mapped-v6 translation disabled {% endif %} {% endfor %} -{% for network in router_bgp.address_family_ipv4_labaled_unicast.networks %} -{% set network_cli = "network " ~ network.prefix %} -{% if network.route_map is arista.avd.defined %} -{% set network_cli = network_cli ~ " route-map " ~ network.route_map %} -{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.networks is arista.avd.defined %} +{% for network in router_bgp.address_family_ipv4_labeled_unicast.networks %} +{% set network_cli = "network " ~ network.prefix %} +{% if network.route_map is arista.avd.defined %} +{% set network_cli = network_cli ~ " route-map " ~ network.route_map %} +{% endif %} {{ network_cli }} -{% endfor %} -{% for next_hop in router_bgp.address_family_ipv4_labaled_unicast.next_hops %} -{% set next_hop_cli = "next-hop " ~ next_hop.ip_address ~ " originate" %} -{% if next_hop.lfib_backup_ip_forwarding is arista.avd.defined(true) %} -{% set next_hop_cli = next_hop_cli ~ " lfib-backup ip-forwarding" %} -{% endif %} +{% endfor %} +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.next_hops is arista.avd.defined %} +{% for next_hop in router_bgp.address_family_ipv4_labeled_unicast.next_hops %} +{% set next_hop_cli = "next-hop " ~ next_hop.ip_address ~ " originate" %} +{% if next_hop.lfib_backup_ip_forwarding is arista.avd.defined(true) %} +{% set next_hop_cli = next_hop_cli ~ " lfib-backup ip-forwarding" %} +{% endif %} {{ next_hop_cli }} -{% endfor %} -{% if router_bgp.address_family_ipv4_labaled_unicast.lfib_entry_installation_skipped is arista.avd.defined(true) %} +{% endfor %} +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped is arista.avd.defined(true) %} lfib entry installation skipped {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.label_local_termination is arista.avd.defined %} - label local-termination {{ router_bgp.address_family_ipv4_labaled_unicast.label_local_termination }} +{% if router_bgp.address_family_ipv4_labeled_unicast.label_local_termination is arista.avd.defined %} + label local-termination {{ router_bgp.address_family_ipv4_labeled_unicast.label_local_termination }} {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.graceful_restart is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.graceful_restart is arista.avd.defined(true) %} graceful-restart {% endif %} -{% if router_bgp.address_family_ipv4_labaled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} +{% if router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} neighbor default next-hop-self {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} @@ -1109,13 +1112,15 @@ neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} next-hop resolution ribs {{ v4_bgp_lu_resolution_ribs | join(" ") }} {% endif %} {% endif %} -{% for tunnel_source_protocol in router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols %} -{% set tunnel_source_protocol_cli = "tunnel source-protocol " ~ tunnel_source_protocol.protocol %} -{% if tunnel_source_protocol.rcf is arista.avd.defined %} -{% set tunnel_source_protocol_cli = tunnel_source_protocol_cli ~ " rcf " ~ tunnel_source_protocol.rcf %} -{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols is arista.avd.defined %} +{% for tunnel_source_protocol in router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols %} +{% set tunnel_source_protocol_cli = "tunnel source-protocol " ~ tunnel_source_protocol.protocol %} +{% if tunnel_source_protocol.rcf is arista.avd.defined %} +{% set tunnel_source_protocol_cli = tunnel_source_protocol_cli ~ " rcf " ~ tunnel_source_protocol.rcf %} +{% endif %} {{ tunnel_source_protocol_cli }} -{% endfor %} +{% endfor %} +{% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.aigp_session is arista.avd.defined %} {% for aigp_session_type in ['ibgp','confederation','ebgp'] %} {% if router_bgp.address_family_ipv4_labeled_unicast.aigp_session[aigp_session_type] is arista.avd.defined(true) %} From 903c6c314cbf743e44ded276a76126b62de04c83 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 13:42:12 +0100 Subject: [PATCH 05/26] Enhanced testing --- .../router-bgp-ipv4-labeled-unicast.yml | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 39fcf8ebaf6..2a9a53c6cca 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -37,29 +37,42 @@ router_bgp: - ip_address: 192.168.255.2 peer_group: EVPN-OVERLAY-PEERS address_family_ipv4_labeled_unicast: + update_wait_for_convergence: true + aigp_session: + ebgp: true + confederation: true bgp: additional_paths: + receive: true send: - limit: 10 - aigp_session: - confederation: true - next_hop_resolution_ribs: - - rib_type: "tunnel-rib-colored" - - rib_type: "tunnel-rib" - rib_name: "test-rib" - - rib_type: "system-connected" - label_local_termination: explicit-null - + ecmp: true + ecmp_limit: 20 + missing_policy: + direction_in_action: deny + next_hop_unchanged: true + label_local_termination: implicit-null + networks: + - prefix: 203.0.113.0/25 + route_map: RM-TEST + - prefix: 203.0.113.128/25 + tunnel_source_protocols: + - protocol: isis segment-routing + - protocol: ldp + rcf: TEST(ARGS) neighbors: - - ip_address: 192.168.255.3 + - ip_address: 198.51.100.1 activate: true + additional_paths: + receive: true + send: + ecmp: true + graceful_restart: true + maximum_advertised_routes: 0 + rcf_in: RCF_TEST(ARGS) + - ip_address: 198.51.100.2 aigp_session: true multi_path: true - graceful_restart: true - - ip_address: 192.168.255.4 - rcf_in: Address_Family_EVPN_In() - rcf_out: Address_Family_EVPN_Out() - networks: - - prefix: 203.0.113.0/25 - route_map: RM_TEST - - prefix: 203.0.113.128/25 + graceful_restart_helper: + stale_route_map: RM_STALE + next_hop_unchanged: true + route_map_out: RM_OUT_TEST From 6511f26477da7b827e83f7ab0842c174f3646a06 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 13:42:30 +0100 Subject: [PATCH 06/26] update molecule outputs --- .../router-bgp-ipv4-labeled-unicast.md | 139 ++++++++++++++++++ .../router-bgp-ipv4-labeled-unicast.cfg | 53 +++++++ 2 files changed, 192 insertions(+) create mode 100644 ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md create mode 100644 ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md new file mode 100644 index 00000000000..0ad32224746 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -0,0 +1,139 @@ +# router-bgp-ipv4-labeled-unicast + +## Table of Contents + +- [Management](#management) + - [Management Interfaces](#management-interfaces) +- [Routing](#routing) + - [Router BGP](#router-bgp) + +## Management + +### Management Interfaces + +#### Management Interfaces Summary + +##### IPv4 + +| Management Interface | Description | Type | VRF | IP Address | Gateway | +| -------------------- | ----------- | ---- | --- | ---------- | ------- | +| Management1 | oob_management | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 | + +##### IPv6 + +| Management Interface | Description | Type | VRF | IPv6 Address | IPv6 Gateway | +| -------------------- | ----------- | ---- | --- | ------------ | ------------ | +| Management1 | oob_management | oob | MGMT | - | - | + +#### Management Interfaces Device Configuration + +```eos +! +interface Management1 + description oob_management + vrf MGMT + ip address 10.73.255.122/24 +``` + +## Routing + +### Router BGP + +ASN Notation: asplain + +#### Router BGP Summary + +| BGP AS | Router ID | +| ------ | --------- | +| 65101 | 192.168.255.3 | + +| BGP Tuning | +| ---------- | +| no bgp default ipv4-unicast | +| distance bgp 20 200 200 | +| graceful-restart restart-time 300 | +| graceful-restart | +| maximum-paths 2 ecmp 2 | + +#### Router BGP Peer Groups + +##### EVPN-OVERLAY-PEERS + +| Settings | Value | +| -------- | ----- | +| Address Family | evpn | +| Remote AS | 65001 | +| Source | Loopback0 | +| RIB Pre-Policy Retain | True (All) | +| BFD | True | +| Ebgp multihop | 3 | +| Default originate | True | +| Send community | all | +| Maximum routes | 0 (no limit) | + +##### MLAG-IPv4-UNDERLAY-PEER + +| Settings | Value | +| -------- | ----- | +| Address Family | ipv4 | +| Remote AS | 65101 | + +#### BGP Neighbors + +| Neighbor | Remote AS | VRF | Shutdown | Send-community | Maximum-routes | Allowas-in | BFD | RIB Pre-Policy Retain | Route-Reflector Client | Passive | TTL Max Hops | +| -------- | --------- | --- | -------- | -------------- | -------------- | ---------- | --- | --------------------- | ---------------------- | ------- | ------------ | +| 192.168.255.1 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | +| 192.168.255.2 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | + +#### Router BGP Device Configuration + +```eos +! +router bgp 65101 + router-id 192.168.255.3 + no bgp default ipv4-unicast + distance bgp 20 200 200 + graceful-restart restart-time 300 + graceful-restart + maximum-paths 2 ecmp 2 + neighbor EVPN-OVERLAY-PEERS peer group + neighbor EVPN-OVERLAY-PEERS remote-as 65001 + neighbor EVPN-OVERLAY-PEERS update-source Loopback0 + neighbor EVPN-OVERLAY-PEERS bfd + neighbor EVPN-OVERLAY-PEERS rib-in pre-policy retain all + neighbor EVPN-OVERLAY-PEERS ebgp-multihop 3 + neighbor EVPN-OVERLAY-PEERS password 7 + neighbor EVPN-OVERLAY-PEERS default-originate route-map RM-FOO always + neighbor EVPN-OVERLAY-PEERS send-community + neighbor EVPN-OVERLAY-PEERS maximum-routes 0 + neighbor MLAG-IPv4-UNDERLAY-PEER peer group + neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 + neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS + neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS + ! + address-family ipv4 labeled-unicast + update wait-for-convergence + bgp missing-policy direction in action deny + bgp additional-paths receive + bgp additional-paths send ecmp + bgp next-hop-unchanged + neighbor 198.51.100.1 activate + neighbor 198.51.100.1 additional-paths receive + neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) + neighbor 198.51.100.1 graceful-restart + neighbor 198.51.100.1 additional-paths send ecmp + neighbor 198.51.100.1 maximum-routes 0 + no neighbor 198.51.100.2 activate + neighbor 198.51.100.2 route-map RM_OUT_TEST out + neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE + neighbor 198.51.100.2 next-hop-unchanged + neighbor 198.51.100.2 aigp-session + neighbor 198.51.100.2 multi-path + network 203.0.113.0/25 route-map RM-TEST + network 203.0.113.128/25 + label local-termination implicit-null + tunnel source-protocol isis segment-routing + tunnel source-protocol ldp rcf TEST(ARGS) + aigp-session confederation + aigp-session ebgp +``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg new file mode 100644 index 00000000000..ae23a80c8d4 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -0,0 +1,53 @@ +! +interface Management1 + description oob_management + vrf MGMT + ip address 10.73.255.122/24 +! +router bgp 65101 + router-id 192.168.255.3 + no bgp default ipv4-unicast + distance bgp 20 200 200 + graceful-restart restart-time 300 + graceful-restart + maximum-paths 2 ecmp 2 + neighbor EVPN-OVERLAY-PEERS peer group + neighbor EVPN-OVERLAY-PEERS remote-as 65001 + neighbor EVPN-OVERLAY-PEERS update-source Loopback0 + neighbor EVPN-OVERLAY-PEERS bfd + neighbor EVPN-OVERLAY-PEERS rib-in pre-policy retain all + neighbor EVPN-OVERLAY-PEERS ebgp-multihop 3 + neighbor EVPN-OVERLAY-PEERS password 7 q+VNViP5i4rVjW1cxFv2wA== + neighbor EVPN-OVERLAY-PEERS default-originate route-map RM-FOO always + neighbor EVPN-OVERLAY-PEERS send-community + neighbor EVPN-OVERLAY-PEERS maximum-routes 0 + neighbor MLAG-IPv4-UNDERLAY-PEER peer group + neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 + neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS + neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS + ! + address-family ipv4 labeled-unicast + update wait-for-convergence + bgp missing-policy direction in action deny + bgp additional-paths receive + bgp additional-paths send ecmp + bgp next-hop-unchanged + neighbor 198.51.100.1 activate + neighbor 198.51.100.1 additional-paths receive + neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) + neighbor 198.51.100.1 graceful-restart + neighbor 198.51.100.1 additional-paths send ecmp + neighbor 198.51.100.1 maximum-routes 0 + no neighbor 198.51.100.2 activate + neighbor 198.51.100.2 route-map RM_OUT_TEST out + neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE + neighbor 198.51.100.2 next-hop-unchanged + neighbor 198.51.100.2 aigp-session + neighbor 198.51.100.2 multi-path + network 203.0.113.0/25 route-map RM-TEST + network 203.0.113.128/25 + label local-termination implicit-null + tunnel source-protocol isis segment-routing + tunnel source-protocol ldp rcf TEST(ARGS) + aigp-session confederation + aigp-session ebgp From 599fb7cc664b17ca891d3bbf792c19653cf5eddf Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 14:11:36 +0100 Subject: [PATCH 07/26] Generate documentation --- .../router-bgp-ipv4-labeled-unicast.yml | 2 +- .../j2templates/documentation/router-bgp.j2 | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 2a9a53c6cca..39d789f564f 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -64,7 +64,7 @@ router_bgp: activate: true additional_paths: receive: true - send: + send: ecmp: true graceful_restart: true maximum_advertised_routes: 0 diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index 6a36641a316..19608ee7357 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -624,6 +624,46 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | L3 Gateway Inter-domain | True | {% endif %} {% endif %} +{% if router.bgp.address_family_ipv4_labeled_unicast is arista.avd.defined %} + +#### Router BGP IPv4 Labeled Unicast + +##### General Settings + +| Settings | Value | +| -------- | ----- | +{% if router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} +| Update - wait-for-convergence | Enabled | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} +| Next-hop Unchanged | True | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped is arista.avd.defined(true) %} +| lfib entry installation skipped | True | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.label_local_termination is arista.avd.defined %} +| label local-termination | {{ router_bgp.address_family_ipv4_labeled_unicast.label_local_termination }} | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.graceful_restart is arista.avd.defined(true) %} +| graceful-restart | Enabled | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} +| neighbor default next-hop-self | True | +{% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.neighbors is arista.avd.defined %} +##### IPv4 BGP-LU Neighbors + +| Neighbor | Activate | Route-map In | Route-map Out | RCF In | RCF Out | +| -------- | -------- | ------------ | ------------- | ------ | ------- | +{% for neighbor in router_bgp.address_family_ipv4_labeled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} +{% set route_map_in = neighbor.route_map_in | arista.avd.default("-") %} +{% set route_map_out = neighbor.route_map_out | arista.avd.default("-") %} +{% set rcf_in = neighbor.rcf_in | arista.avd.default("-") %} +{% set rcf_out = neighbor.rcf_out | arista.avd.default("-") %} +| {{ neighbor.ip_address }} | {{ neighbor.activate | arista.avd.default(false) }} | {{ route_map_in }} | {{ route_map_out }} | {{ rcf_in }} | {{ rcf_out }} | +{% endfor %} +{% endif %} +{% endif %} {% if router_bgp.address_family_ipv4_sr_te is arista.avd.defined %} #### Router BGP IPv4 SR-TE Address Family From e5d8044a95ca17ede20c71c8edf9103711f747d4 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 14:28:18 +0100 Subject: [PATCH 08/26] Add handling for peer-groups --- .../j2templates/documentation/router-bgp.j2 | 15 +- .../j2templates/eos/router-bgp.j2 | 91 ++++++++++ .../schema/eos_cli_config_gen.schema.yml | 160 ++++++++++++++++++ .../schema_fragments/router_bgp.schema.yml | 148 ++++++++++++++++ 4 files changed, 413 insertions(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index 19608ee7357..7a6e133d95c 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -624,7 +624,7 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | L3 Gateway Inter-domain | True | {% endif %} {% endif %} -{% if router.bgp.address_family_ipv4_labeled_unicast is arista.avd.defined %} +{% if router_bgp.address_family_ipv4_labeled_unicast is arista.avd.defined %} #### Router BGP IPv4 Labeled Unicast @@ -650,6 +650,19 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} {% if router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} | neighbor default next-hop-self | True | {% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.peer_groups is arista.avd.defined %} +##### IPv4 BGP-LU Peer-groups + +| Peer-group | Activate | Route-map In | Route-map Out | RCF In | RCF Out | +| ---------- | -------- | ------------ | ------------- | ------ | ------- | +{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort() %} +{% set route_map_in = peer.route_map_in | arista.avd.default("-") %} +{% set route_map_out = peer.route_map_out | arista.avd.default("-") %} +{% set rcf_in = peer.rcf_in | arista.avd.default("-") %} +{% set rcf_out = peer.rcf_out | arista.avd.default("-") %} +| {{ peer.name }} | {{ peer.activate | arista.avd.default(false) }} | {{ route_map_in }} | {{ route_map_out }} | {{ rcf_in }} | {{ rcf_out }} | +{% endfor %} +{% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.neighbors is arista.avd.defined %} ##### IPv4 BGP-LU Neighbors diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 17eee784877..8171e72d30b 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -976,6 +976,97 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} bgp next-hop-unchanged {% endif %} +{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort() %} +{% if peer.activate is arista.avd.defined(true) %} + peer {{ peer.name }} activate +{% else %} + no peer {{ peer.name }} activate +{% endif %} +{% if peer.additional_paths.receive is arista.avd.defined(true) %} + peer {{ peer.name }} additional-paths receive +{% endif %} +{% if peer.route_map_in is arista.avd.defined %} + peer {{ peer.name }} route-map {{ peer.route_map_in }} in +{% endif %} +{% if peer.route_map_out is arista.avd.defined %} + peer {{ peer.name }} route-map {{ peer.route_map_out }} out +{% endif %} +{% if peer.rcf_in is arista.avd.defined %} + peer {{ peer.name }} rcf in {{ peer.rcf_in }} +{% endif %} +{% if peer.rcf_out is arista.avd.defined %} + peer {{ peer.name }} rcf out {{ peer.rcf_out }} +{% endif %} +{% if peer.graceful_restart is arista.avd.defined(true) %} + peer {{ peer.name }} graceful-restart +{% endif %} +{% if peer.graceful_restart_helper.stale_route_map is arista.avd.defined %} + peer {{ peer.name }} graceful-restart-helper stale-route route-map {{ peer.graceful_restart_helper.stale_route_map }} +{% endif %} +{% if peer.additional_paths.send.any is arista.avd.defined(true) %} + peer {{ peer.name }} additional-paths send any +{% elif peer.additional_paths.send.backup is arista.avd.defined(true) %} + peer {{ peer.name }} additional-paths send backup +{% elif peer.additional_paths.send.ecmp is arista.avd.defined(true) %} + peer {{ peer.name }} additional-paths send ecmp +{% elif peer.additional_paths.send.ecmp_limit is arista.avd.defined %} + peer {{ peer.name }} additional-paths send ecmp limit {{ peer.additional_paths.send.ecmp_limit }} +{% elif peer.additional_paths.send.limit is arista.avd.defined %} + peer {{ peer.name }} additional-paths send limit {{ peer.additional_paths.send.limit }} +{% endif %} +{% if peer.next_hop_unchanged is arista.avd.defined(true) %} + peer {{ peer.name }} next-hop-unchanged +{% endif %} +{% if peer.next_hop_self is arista.avd.defined(true) %} + peer {{ peer.name }} next-hop-self +{% endif %} +{% if peer.next_hop_self_v4_mapped_v6_source_interface is arista.avd.defined %} + peer {{ peer.name }} next-hop-self v4-mapped-v6 source-interface {{ peer.next_hop_self_v4_mapped_v6_source_interface }} +{% elif peer.next_hop_self_source_interface is arista.avd.defined %} + peer {{ peer.name }} next-hop-self source-interface {{ peer.next_hop_self_source_interface }} +{% endif %} +{% if peer.maximum_advertised_routes is arista.avd.defined %} +{% set maximum_routes_cli = "peer " ~peer.name ~ " maximum-routes " ~peer.maximum_advertised_routes %} +{% if peer.maximum_advertised_routes_warning_limit is arista.avd.defined %} +{% set maximum_routes_cli = maximum_routes_cli ~ " warning-limit " ~ peer.maximum_advertised_routes_warning_limit %} +{% endif %} + {{ maximum_routes_cli }} +{% endif %} +{% if peer.missing_policy is arista.avd.defined %} +{% for direction in ['in', 'out'] %} +{% set dir = 'direction_' ~ direction %} +{% set policy = peer.missing_policy[dir] %} +{% if policy.action is arista.avd.defined %} +{% set missing_policy_cli = "peer " ~ peer.name ~ " missing-policy address-family all" %} +{% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " include" %} +{% if policy.include_community_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " community-list" %} +{% endif %} +{% if policy.include_prefix_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " prefix-list" %} +{% endif %} +{% if policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " sub-route-map" %} +{% endif %} +{% endif %} +{% set missing_policy_cli = missing_policy_cli ~ " direction " ~ direction ~ " action " ~ policy.action %} + {{ missing_policy_cli }} +{% endif %} +{% endfor %} +{% endif %} +{% if peer.aigp_session is arista.avd.defined(true) %} + peer {{ peer.name }} aigp-session +{% endif %} +{% if peer.multi_path is arista.avd.defined(true) %} + peer {{ peer.name }} multi-path +{% endif %} +{% if peer.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(true) %} + peer {{ peer.name }} next-hop resolution v4-mapped-v6 translation +{% elif peer.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(false) %} + peer {{ peer.name }} next-hop resolution v4-mapped-v6 translation disabled +{% endif %} +{% endfor %} {% for neighbor in router_bgp.address_family_ipv4_labeled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} {% if neighbor.activate is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} activate diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index c7cba0491a2..3983ebb8db1 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -12972,6 +12972,165 @@ keys: keys: next_hop_self: type: bool + peer_groups: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + description: Peer-group name. + activate: + type: bool + additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + aigp_session: + type: bool + graceful_restart: + type: bool + graceful_restart_helper: + type: dict + keys: + stale_route_map: + type: str + maximum_advertised_routes: + type: int + description: Maximum number of routes (0 means unlimited). + min: 0 + max: 4294967294 + convert_types: + - str + maximum_advertised_routes_warning_limit: + type: str + convert_types: + - int + description: 'Maximum number of routes after which a warning is + issued (0 means never warn) or + + Percentage of maximum number of routes at which to warn ("<1-100> + percent"). + + ' + missing_policy: + type: dict + description: Missing policy configuration for BGP Labeled-Unicast + neighbor. + keys: + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing + policy decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing + policy decision. + multi_path: + type: bool + next_hop_resolution: + type: dict + keys: + v4_mapped_v6_translation: + type: bool + next_hop_self: + type: bool + next_hop_self_source_interface: + description: Source interface name. + type: str + next_hop_self_v4_mapped_v6_source_interface: + description: v4-mapped-v6 source interface name. Takes precedence + over the next_hop_self_source_interface. + type: str + next_hop_unchanged: + type: bool + rcf_in: + type: str + description: 'Inbound RCF function name with parenthesis. + + Example: MyFunction(myarg).' + rcf_out: + type: str + description: 'Outbound RCF function name with parenthesis. + + Example: MyFunction(myarg).' + route_map_in: + type: str + description: Inbound route-map name. + route_map_out: + type: str + description: Outbound route-map name. neighbors: type: list primary_key: ip_address @@ -13180,6 +13339,7 @@ keys: type: list min_length: 1 max_length: 2 + primary_key: protocol items: type: dict keys: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index d4354fc879f..7af99b60dd7 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1520,6 +1520,153 @@ keys: keys: next_hop_self: type: bool + peer_groups: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + description: Peer-group name. + activate: + type: bool + additional_paths: + type: dict + description: BGP additional-paths commands. + keys: + receive: + type: bool + description: Receive multiple paths. + send: + type: dict + description: Send multiple paths. + keys: + any: + type: bool + description: Any eligible path. + backup: + type: bool + description: Best path and installed backup path. + ecmp: + type: bool + description: All paths in best path ECMP group. + ecmp_limit: + type: int + description: Amount of ECMP paths to send. + convert_types: + - str + min: 2 + max: 64 + limit: + type: int + description: Amount of paths to send. + convert_types: + - str + min: 2 + max: 64 + aigp_session: + type: bool + graceful_restart: + type: bool + graceful_restart_helper: + type: dict + keys: + stale_route_map: + type: str + maximum_advertised_routes: + type: int + description: Maximum number of routes (0 means unlimited). + min: 0 + max: 4294967294 + convert_types: + - str + maximum_advertised_routes_warning_limit: + type: str + convert_types: + - int + description: | + Maximum number of routes after which a warning is issued (0 means never warn) or + Percentage of maximum number of routes at which to warn ("<1-100> percent"). + missing_policy: + type: dict + description: Missing policy configuration for BGP Labeled-Unicast neighbor. + keys: + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. + multi_path: + type: bool + next_hop_resolution: + type: dict + keys: + v4_mapped_v6_translation: + type: bool + next_hop_self: + type: bool + next_hop_self_source_interface: + description: Source interface name. + type: str + next_hop_self_v4_mapped_v6_source_interface: + description: v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. + type: str + next_hop_unchanged: + type: bool + rcf_in: + type: str + description: |- + Inbound RCF function name with parenthesis. + Example: MyFunction(myarg). + rcf_out: + type: str + description: |- + Outbound RCF function name with parenthesis. + Example: MyFunction(myarg). + route_map_in: + type: str + description: Inbound route-map name. + route_map_out: + type: str + description: Outbound route-map name. neighbors: type: list primary_key: ip_address @@ -1713,6 +1860,7 @@ keys: type: list min_length: 1 max_length: 2 + primary_key: protocol items: type: dict keys: From e00a61add1d68bd32ced9cb63a88efddd9b8df56 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 14:28:29 +0100 Subject: [PATCH 09/26] doc update --- .../router-bgp-ipv4-labeled-unicast.md | 16 ++ .../docs/tables/router-bgp.md | 141 +++++++++++++++++- 2 files changed, 155 insertions(+), 2 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 0ad32224746..9c7359290ec 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -85,6 +85,22 @@ ASN Notation: asplain | 192.168.255.1 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | | 192.168.255.2 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | +#### Router BGP IPv4 Labeled Unicast + +##### General Settings + +| Settings | Value | +| -------- | ----- | +| Update - wait-for-convergence | Enabled | +| Next-hop Unchanged | True | +| label local-termination | implicit-null | +##### IPv4 BGP-LU Neighbors + +| Neighbor | Activate | Route-map In | Route-map Out | RCF In | RCF Out | +| -------- | -------- | ------------ | ------------- | ------ | ------- | +| 198.51.100.1 | True | - | - | RCF_TEST(ARGS) | - | +| 198.51.100.2 | False | - | RM_OUT_TEST | - | - | + #### Router BGP Device Configuration ```eos diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index 8dd182893a2..75976a73440 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -408,6 +408,45 @@ | [    lfib_entry_installation_skipped](## "router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped") | Boolean | | | | Skip LFIB entry installation and next hop self route advertisements. | | [    neighbor_default](## "router_bgp.address_family_ipv4_labeled_unicast.neighbor_default") | Dictionary | | | | | | [      next_hop_self](## "router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self") | Boolean | | | | | + | [    peer_groups](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups") | List, items: Dictionary | | | | | + | [      - name](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].name") | String | Required, Unique | | | Peer-group name. | + | [        activate](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].activate") | Boolean | | | | | + | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths") | Dictionary | | | | BGP additional-paths commands. | + | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.receive") | Boolean | | | | Receive multiple paths. | + | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send") | Dictionary | | | | Send multiple paths. | + | [            any](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.any") | Boolean | | | | Any eligible path. | + | [            backup](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | + | [            ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | + | [            ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | + | [            limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [        aigp_session](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].aigp_session") | Boolean | | | | | + | [        graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].graceful_restart") | Boolean | | | | | + | [        graceful_restart_helper](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].graceful_restart_helper") | Dictionary | | | | | + | [          stale_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].graceful_restart_helper.stale_route_map") | String | | | | | + | [        maximum_advertised_routes](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].maximum_advertised_routes") | Integer | | | Min: 0
Max: 4294967294 | Maximum number of routes (0 means unlimited). | + | [        maximum_advertised_routes_warning_limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].maximum_advertised_routes_warning_limit") | String | | | | Maximum number of routes after which a warning is issued (0 means never warn) or
Percentage of maximum number of routes at which to warn ("<1-100> percent").
| + | [        missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy") | Dictionary | | | | Missing policy configuration for BGP Labeled-Unicast neighbor. | + | [          direction_in](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_in") | Dictionary | | | | Missing policy inbound direction. | + | [            action](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_in.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [            include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_in.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [            include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_in.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [            include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_in.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | + | [          direction_out](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_out") | Dictionary | | | | Missing policy outbound direction. | + | [            action](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_out.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [            include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_out.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [            include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_out.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [            include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].missing_policy.direction_out.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | + | [        multi_path](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].multi_path") | Boolean | | | | | + | [        next_hop_resolution](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_resolution") | Dictionary | | | | | + | [          v4_mapped_v6_translation](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_resolution.v4_mapped_v6_translation") | Boolean | | | | | + | [        next_hop_self](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_self") | Boolean | | | | | + | [        next_hop_self_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_self_source_interface") | String | | | | Source interface name. | + | [        next_hop_self_v4_mapped_v6_source_interface](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_self_v4_mapped_v6_source_interface") | String | | | | v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. | + | [        next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].next_hop_unchanged") | Boolean | | | | | + | [        rcf_in](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].rcf_in") | String | | | | Inbound RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [        rcf_out](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].rcf_out") | String | | | | Outbound RCF function name with parenthesis.
Example: MyFunction(myarg). | + | [        route_map_in](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].route_map_in") | String | | | | Inbound route-map name. | + | [        route_map_out](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].route_map_out") | String | | | | Outbound route-map name. | | [    neighbors](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors") | List, items: Dictionary | | | | | | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].ip_address") | String | Required, Unique | | | | | [        activate](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].activate") | Boolean | | | | | @@ -457,7 +496,7 @@ | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib-colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | | [        rib_name](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. | | [    tunnel_source_protocols](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | - | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].protocol") | String | | | Valid Values:
- isis segment-routing
- ldp | | + | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].protocol") | String | Required, Unique | | Valid Values:
- isis segment-routing
- ldp | | | [        rcf](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].rcf") | String | | | | Optional RCF function name with parenthesis.
Example: MyFunction(myarg). | | [    update_wait_for_convergence](## "router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence") | Boolean | | | | Wait for BGP to converge before sending out any route updates. | | [  address_family_ipv4_multicast](## "router_bgp.address_family_ipv4_multicast") | Dictionary | | | | | @@ -1725,6 +1764,104 @@ lfib_entry_installation_skipped: neighbor_default: next_hop_self: + peer_groups: + + # Peer-group name. + - name: + activate: + + # BGP additional-paths commands. + additional_paths: + + # Receive multiple paths. + receive: + + # Send multiple paths. + send: + + # Any eligible path. + any: + + # Best path and installed backup path. + backup: + + # All paths in best path ECMP group. + ecmp: + + # Amount of ECMP paths to send. + ecmp_limit: + + # Amount of paths to send. + limit: + aigp_session: + graceful_restart: + graceful_restart_helper: + stale_route_map: + + # Maximum number of routes (0 means unlimited). + maximum_advertised_routes: + + # Maximum number of routes after which a warning is issued (0 means never warn) or + # Percentage of maximum number of routes at which to warn ("<1-100> percent"). + maximum_advertised_routes_warning_limit: + + # Missing policy configuration for BGP Labeled-Unicast neighbor. + missing_policy: + + # Missing policy inbound direction. + direction_in: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: + + # Missing policy outbound direction. + direction_out: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: + multi_path: + next_hop_resolution: + v4_mapped_v6_translation: + next_hop_self: + + # Source interface name. + next_hop_self_source_interface: + + # v4-mapped-v6 source interface name. Takes precedence over the next_hop_self_source_interface. + next_hop_self_v4_mapped_v6_source_interface: + next_hop_unchanged: + + # Inbound RCF function name with parenthesis. + # Example: MyFunction(myarg). + rcf_in: + + # Outbound RCF function name with parenthesis. + # Example: MyFunction(myarg). + rcf_out: + + # Inbound route-map name. + route_map_in: + + # Outbound route-map name. + route_map_out: neighbors: - ip_address: activate: @@ -1841,7 +1978,7 @@ # The name of the tunnel-rib to use when using 'tunnel-rib' type. rib_name: tunnel_source_protocols: # 1-2 items - - protocol: + - protocol: # Optional RCF function name with parenthesis. # Example: MyFunction(myarg). From f75a17bd500fb5e98c82915b9faa2b4d5cd2bb8e Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 14:44:20 +0100 Subject: [PATCH 10/26] Peer groups enabled Added tests Updated generated markdown --- .../router-bgp-ipv4-labeled-unicast.md | 19 +++++++ .../router-bgp-ipv4-labeled-unicast.cfg | 5 ++ .../router-bgp-ipv4-labeled-unicast.yml | 9 ++++ .../j2templates/documentation/router-bgp.j2 | 2 +- .../j2templates/eos/router-bgp.j2 | 50 +++++++++---------- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 9c7359290ec..9b02ba07669 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -78,12 +78,21 @@ ASN Notation: asplain | Address Family | ipv4 | | Remote AS | 65101 | +##### PG-BGP-LU + +| Settings | Value | +| -------- | ----- | +| Address Family | IPv4 Labeled-Unicast | +| Remote AS | 65555 | +| Source | Loopback0 | + #### BGP Neighbors | Neighbor | Remote AS | VRF | Shutdown | Send-community | Maximum-routes | Allowas-in | BFD | RIB Pre-Policy Retain | Route-Reflector Client | Passive | TTL Max Hops | | -------- | --------- | --- | -------- | -------------- | -------------- | ---------- | --- | --------------------- | ---------------------- | ------- | ------------ | | 192.168.255.1 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | | 192.168.255.2 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | +| 198.51.100.3 | Inherited from peer group PG-BGP-LU | default | - | - | - | - | - | - | - | - | - | #### Router BGP IPv4 Labeled Unicast @@ -94,6 +103,11 @@ ASN Notation: asplain | Update - wait-for-convergence | Enabled | | Next-hop Unchanged | True | | label local-termination | implicit-null | +##### IPv4 BGP-LU Peer-groups + +| Peer-group | Activate | Route-map In | Route-map Out | RCF In | RCF Out | +| ---------- | -------- | ------------ | ------------- | ------ | ------- | +| PG-BGP-LU | True | - | - | - | - | ##### IPv4 BGP-LU Neighbors | Neighbor | Activate | Route-map In | Route-map Out | RCF In | RCF Out | @@ -124,8 +138,12 @@ router bgp 65101 neighbor EVPN-OVERLAY-PEERS maximum-routes 0 neighbor MLAG-IPv4-UNDERLAY-PEER peer group neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 + neighbor PG-BGP-LU peer group + neighbor PG-BGP-LU remote-as 65555 + neighbor PG-BGP-LU update-source Loopback0 neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS + neighbor 198.51.100.3 peer group PG-BGP-LU ! address-family ipv4 labeled-unicast update wait-for-convergence @@ -133,6 +151,7 @@ router bgp 65101 bgp additional-paths receive bgp additional-paths send ecmp bgp next-hop-unchanged + neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index ae23a80c8d4..42fe926bd21 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -23,8 +23,12 @@ router bgp 65101 neighbor EVPN-OVERLAY-PEERS maximum-routes 0 neighbor MLAG-IPv4-UNDERLAY-PEER peer group neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 + neighbor PG-BGP-LU peer group + neighbor PG-BGP-LU remote-as 65555 + neighbor PG-BGP-LU update-source Loopback0 neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS + neighbor 198.51.100.3 peer group PG-BGP-LU ! address-family ipv4 labeled-unicast update wait-for-convergence @@ -32,6 +36,7 @@ router bgp 65101 bgp additional-paths receive bgp additional-paths send ecmp bgp next-hop-unchanged + neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 39d789f564f..eea896feac6 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -8,6 +8,10 @@ router_bgp: - graceful-restart - maximum-paths 2 ecmp 2 peer_groups: + - name: PG-BGP-LU + type: IPv4 Labeled-Unicast + remote_as: 65555 + update_source: Loopback0 - name: EVPN-OVERLAY-PEERS type: evpn remote_as: 65001 @@ -36,6 +40,8 @@ router_bgp: peer_group: EVPN-OVERLAY-PEERS - ip_address: 192.168.255.2 peer_group: EVPN-OVERLAY-PEERS + - ip_address: 198.51.100.3 + peer_group: PG-BGP-LU address_family_ipv4_labeled_unicast: update_wait_for_convergence: true aigp_session: @@ -76,3 +82,6 @@ router_bgp: stale_route_map: RM_STALE next_hop_unchanged: true route_map_out: RM_OUT_TEST + peer_groups: + - name: PG-BGP-LU + activate: true diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index 7a6e133d95c..61504813137 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -655,7 +655,7 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | Peer-group | Activate | Route-map In | Route-map Out | RCF In | RCF Out | | ---------- | -------- | ------------ | ------------- | ------ | ------- | -{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort() %} +{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort('name') %} {% set route_map_in = peer.route_map_in | arista.avd.default("-") %} {% set route_map_out = peer.route_map_out | arista.avd.default("-") %} {% set rcf_in = peer.rcf_in | arista.avd.default("-") %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 8171e72d30b..7fc25a4c1d2 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -976,57 +976,57 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} bgp next-hop-unchanged {% endif %} -{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort() %} +{% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort('name') %} {% if peer.activate is arista.avd.defined(true) %} - peer {{ peer.name }} activate + neighbor {{ peer.name }} activate {% else %} - no peer {{ peer.name }} activate + no neighbor {{ peer.name }} activate {% endif %} {% if peer.additional_paths.receive is arista.avd.defined(true) %} - peer {{ peer.name }} additional-paths receive + neighbor {{ peer.name }} additional-paths receive {% endif %} {% if peer.route_map_in is arista.avd.defined %} - peer {{ peer.name }} route-map {{ peer.route_map_in }} in + neighbor {{ peer.name }} route-map {{ peer.route_map_in }} in {% endif %} {% if peer.route_map_out is arista.avd.defined %} - peer {{ peer.name }} route-map {{ peer.route_map_out }} out + neighbor {{ peer.name }} route-map {{ peer.route_map_out }} out {% endif %} {% if peer.rcf_in is arista.avd.defined %} - peer {{ peer.name }} rcf in {{ peer.rcf_in }} + neighbor {{ peer.name }} rcf in {{ peer.rcf_in }} {% endif %} {% if peer.rcf_out is arista.avd.defined %} - peer {{ peer.name }} rcf out {{ peer.rcf_out }} + neighbor {{ peer.name }} rcf out {{ peer.rcf_out }} {% endif %} {% if peer.graceful_restart is arista.avd.defined(true) %} - peer {{ peer.name }} graceful-restart + neighbor {{ peer.name }} graceful-restart {% endif %} {% if peer.graceful_restart_helper.stale_route_map is arista.avd.defined %} - peer {{ peer.name }} graceful-restart-helper stale-route route-map {{ peer.graceful_restart_helper.stale_route_map }} + neighbor {{ peer.name }} graceful-restart-helper stale-route route-map {{ peer.graceful_restart_helper.stale_route_map }} {% endif %} {% if peer.additional_paths.send.any is arista.avd.defined(true) %} - peer {{ peer.name }} additional-paths send any + neighbor {{ peer.name }} additional-paths send any {% elif peer.additional_paths.send.backup is arista.avd.defined(true) %} - peer {{ peer.name }} additional-paths send backup + neighbor {{ peer.name }} additional-paths send backup {% elif peer.additional_paths.send.ecmp is arista.avd.defined(true) %} - peer {{ peer.name }} additional-paths send ecmp + neighbor {{ peer.name }} additional-paths send ecmp {% elif peer.additional_paths.send.ecmp_limit is arista.avd.defined %} - peer {{ peer.name }} additional-paths send ecmp limit {{ peer.additional_paths.send.ecmp_limit }} + neighbor {{ peer.name }} additional-paths send ecmp limit {{ peer.additional_paths.send.ecmp_limit }} {% elif peer.additional_paths.send.limit is arista.avd.defined %} - peer {{ peer.name }} additional-paths send limit {{ peer.additional_paths.send.limit }} + neighbor {{ peer.name }} additional-paths send limit {{ peer.additional_paths.send.limit }} {% endif %} {% if peer.next_hop_unchanged is arista.avd.defined(true) %} - peer {{ peer.name }} next-hop-unchanged + neighbor {{ peer.name }} next-hop-unchanged {% endif %} {% if peer.next_hop_self is arista.avd.defined(true) %} - peer {{ peer.name }} next-hop-self + neighbor {{ peer.name }} next-hop-self {% endif %} {% if peer.next_hop_self_v4_mapped_v6_source_interface is arista.avd.defined %} - peer {{ peer.name }} next-hop-self v4-mapped-v6 source-interface {{ peer.next_hop_self_v4_mapped_v6_source_interface }} + neighbor {{ peer.name }} next-hop-self v4-mapped-v6 source-interface {{ peer.next_hop_self_v4_mapped_v6_source_interface }} {% elif peer.next_hop_self_source_interface is arista.avd.defined %} - peer {{ peer.name }} next-hop-self source-interface {{ peer.next_hop_self_source_interface }} + neighbor {{ peer.name }} next-hop-self source-interface {{ peer.next_hop_self_source_interface }} {% endif %} {% if peer.maximum_advertised_routes is arista.avd.defined %} -{% set maximum_routes_cli = "peer " ~peer.name ~ " maximum-routes " ~peer.maximum_advertised_routes %} +{% set maximum_routes_cli = "neighbor " ~peer.name ~ " maximum-routes " ~peer.maximum_advertised_routes %} {% if peer.maximum_advertised_routes_warning_limit is arista.avd.defined %} {% set maximum_routes_cli = maximum_routes_cli ~ " warning-limit " ~ peer.maximum_advertised_routes_warning_limit %} {% endif %} @@ -1037,7 +1037,7 @@ router bgp {{ router_bgp.as }} {% set dir = 'direction_' ~ direction %} {% set policy = peer.missing_policy[dir] %} {% if policy.action is arista.avd.defined %} -{% set missing_policy_cli = "peer " ~ peer.name ~ " missing-policy address-family all" %} +{% set missing_policy_cli = "neighbor " ~ peer.name ~ " missing-policy address-family all" %} {% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} {% set missing_policy_cli = missing_policy_cli ~ " include" %} {% if policy.include_community_list is arista.avd.defined(true) %} @@ -1056,15 +1056,15 @@ router bgp {{ router_bgp.as }} {% endfor %} {% endif %} {% if peer.aigp_session is arista.avd.defined(true) %} - peer {{ peer.name }} aigp-session + neighbor {{ peer.name }} aigp-session {% endif %} {% if peer.multi_path is arista.avd.defined(true) %} - peer {{ peer.name }} multi-path + neighbor {{ peer.name }} multi-path {% endif %} {% if peer.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(true) %} - peer {{ peer.name }} next-hop resolution v4-mapped-v6 translation + neighbor {{ peer.name }} next-hop resolution v4-mapped-v6 translation {% elif peer.next_hop_resolution.v4_mapped_v6_translation is arista.avd.defined(false) %} - peer {{ peer.name }} next-hop resolution v4-mapped-v6 translation disabled + neighbor {{ peer.name }} next-hop resolution v4-mapped-v6 translation disabled {% endif %} {% endfor %} {% for neighbor in router_bgp.address_family_ipv4_labeled_unicast.neighbors | arista.avd.natural_sort('ip_address') %} From 6ee5a29e40e6e8fc7f9f91e167c8ee33adcc2a13 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:52:12 +0000 Subject: [PATCH 11/26] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../documentation/devices/router-bgp-ipv4-labeled-unicast.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 9b02ba07669..911dcf8f057 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -103,11 +103,13 @@ ASN Notation: asplain | Update - wait-for-convergence | Enabled | | Next-hop Unchanged | True | | label local-termination | implicit-null | + ##### IPv4 BGP-LU Peer-groups | Peer-group | Activate | Route-map In | Route-map Out | RCF In | RCF Out | | ---------- | -------- | ------------ | ------------- | ------ | ------- | | PG-BGP-LU | True | - | - | - | - | + ##### IPv4 BGP-LU Neighbors | Neighbor | Activate | Route-map In | Route-map Out | RCF In | RCF Out | From a285249ec90c2cff50c5955b9e31636efaf689c3 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Thu, 29 Aug 2024 14:58:15 +0100 Subject: [PATCH 12/26] fix missing newline --- .../_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index 61504813137..c8700c2b8cf 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -651,6 +651,7 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | neighbor default next-hop-self | True | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.peer_groups is arista.avd.defined %} + ##### IPv4 BGP-LU Peer-groups | Peer-group | Activate | Route-map In | Route-map Out | RCF In | RCF Out | @@ -664,6 +665,7 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} {% endfor %} {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.neighbors is arista.avd.defined %} + ##### IPv4 BGP-LU Neighbors | Neighbor | Activate | Route-map In | Route-map Out | RCF In | RCF Out | From 1e1f0bbce3013c3e7a7e924d3b6afcfe0e20c6bb Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Mon, 2 Sep 2024 10:46:27 +0100 Subject: [PATCH 13/26] Update generated documentation --- .../devices/router-bgp-ipv4-labeled-unicast.md | 2 +- .../j2templates/documentation/router-bgp.j2 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 911dcf8f057..0a9e32f4a6b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -102,7 +102,7 @@ ASN Notation: asplain | -------- | ----- | | Update - wait-for-convergence | Enabled | | Next-hop Unchanged | True | -| label local-termination | implicit-null | +| Label local-termination | implicit-null | ##### IPv4 BGP-LU Peer-groups diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index c8700c2b8cf..167470c8836 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -639,16 +639,16 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | Next-hop Unchanged | True | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.lfib_entry_installation_skipped is arista.avd.defined(true) %} -| lfib entry installation skipped | True | +| LFIB entry installation skipped | True | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.label_local_termination is arista.avd.defined %} -| label local-termination | {{ router_bgp.address_family_ipv4_labeled_unicast.label_local_termination }} | +| Label local-termination | {{ router_bgp.address_family_ipv4_labeled_unicast.label_local_termination }} | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.graceful_restart is arista.avd.defined(true) %} -| graceful-restart | Enabled | +| Graceful-restart | Enabled | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} -| neighbor default next-hop-self | True | +| Neighbor default next-hop-self | True | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.peer_groups is arista.avd.defined %} From 0769e1ee32c96f007b4abebad85a2e7ca64f067e Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Mon, 2 Sep 2024 10:59:04 +0100 Subject: [PATCH 14/26] Fix cli output --- .../documentation/devices/router-bgp-ipv4-labeled-unicast.md | 2 +- .../intended/configs/router-bgp-ipv4-labeled-unicast.cfg | 2 +- .../pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 0a9e32f4a6b..0afec902f7c 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -159,7 +159,7 @@ router bgp 65101 neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 graceful-restart neighbor 198.51.100.1 additional-paths send ecmp - neighbor 198.51.100.1 maximum-routes 0 + neighbor 198.51.100.1 maximum-advertised-routes 0 no neighbor 198.51.100.2 activate neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 42fe926bd21..7e279aa18ee 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -42,7 +42,7 @@ router bgp 65101 neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 graceful-restart neighbor 198.51.100.1 additional-paths send ecmp - neighbor 198.51.100.1 maximum-routes 0 + neighbor 198.51.100.1 maximum-advertised-routes 0 no neighbor 198.51.100.2 activate neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 7fc25a4c1d2..0344cd6edb6 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -1117,7 +1117,7 @@ router bgp {{ router_bgp.as }} neighbor {{ neighbor.ip_address }} next-hop-self source-interface {{ neighbor.next_hop_self_source_interface }} {% endif %} {% if neighbor.maximum_advertised_routes is arista.avd.defined %} -{% set maximum_routes_cli = "neighbor " ~neighbor.ip_address ~ " maximum-routes " ~neighbor.maximum_advertised_routes %} +{% set maximum_routes_cli = "neighbor " ~neighbor.ip_address ~ " maximum-advertised-routes " ~neighbor.maximum_advertised_routes %} {% if neighbor.maximum_advertised_routes_warning_limit is arista.avd.defined %} {% set maximum_routes_cli = maximum_routes_cli ~ " warning-limit " ~ neighbor.maximum_advertised_routes_warning_limit %} {% endif %} From 84dc28483ae86bc1959699d9a17638a597780015 Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Fri, 6 Sep 2024 09:32:32 +0100 Subject: [PATCH 15/26] Handle include options for bgp missing-policy Update tests --- .../router-bgp-ipv4-labeled-unicast.md | 2 +- .../router-bgp-ipv4-labeled-unicast.cfg | 2 +- .../router-bgp-ipv4-labeled-unicast.yml | 4 +- .../docs/tables/router-bgp.md | 48 +++++++++++++-- .../j2templates/eos/router-bgp.j2 | 31 +++++++--- .../schema/eos_cli_config_gen.schema.yml | 61 +++++++++++++++---- .../schema_fragments/router_bgp.schema.yml | 55 +++++++++++++---- 7 files changed, 164 insertions(+), 39 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 0afec902f7c..c20e662a1f7 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -149,7 +149,7 @@ router bgp 65101 ! address-family ipv4 labeled-unicast update wait-for-convergence - bgp missing-policy direction in action deny + bgp missing-policy include community-list direction in action deny bgp additional-paths receive bgp additional-paths send ecmp bgp next-hop-unchanged diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 7e279aa18ee..6b44f13ceb2 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -32,7 +32,7 @@ router bgp 65101 ! address-family ipv4 labeled-unicast update wait-for-convergence - bgp missing-policy direction in action deny + bgp missing-policy include community-list direction in action deny bgp additional-paths receive bgp additional-paths send ecmp bgp next-hop-unchanged diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index eea896feac6..10f8cdc826b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -54,7 +54,9 @@ router_bgp: ecmp: true ecmp_limit: 20 missing_policy: - direction_in_action: deny + direction_in: + action: deny + include_community_list: true next_hop_unchanged: true label_local_termination: implicit-null networks: diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index 75976a73440..366c67868e4 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -399,9 +399,17 @@ | [          ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | | [          ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | | [          limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | - | [      missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy") | Dictionary | | | | | - | [        direction_in_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | - | [        direction_out_action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action") | String | | | Valid Values:
- deny
- deny-in-out
- permit | | + | [      missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy") | Dictionary | | | | Missing policy configuration for all address-families. | + | [        direction_in](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in") | Dictionary | | | | Missing policy inbound direction. | + | [          action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [          include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [          include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [          include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | + | [        direction_out](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out") | Dictionary | | | | Missing policy outbound direction. | + | [          action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | + | [          include_community_list](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out.include_community_list") | Boolean | | | | Include community-list references in missing policy decision. | + | [          include_prefix_list](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out.include_prefix_list") | Boolean | | | | Include prefix-list references in missing policy decision. | + | [          include_sub_route_map](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out.include_sub_route_map") | Boolean | | | | Include sub-route-map references in missing policy decision. | | [      next_hop_unchanged](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged") | Boolean | | | | | | [    graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.graceful_restart") | Boolean | | | | | | [    label_local_termination](## "router_bgp.address_family_ipv4_labeled_unicast.label_local_termination") | String | | | Valid Values:
- explicit-null
- implicit-null | | @@ -1753,9 +1761,39 @@ # Amount of paths to send. limit: + + # Missing policy configuration for all address-families. missing_policy: - direction_in_action: - direction_out_action: + + # Missing policy inbound direction. + direction_in: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: + + # Missing policy outbound direction. + direction_out: + + # Missing policy action. + action: + + # Include community-list references in missing policy decision. + include_community_list: + + # Include prefix-list references in missing policy decision. + include_prefix_list: + + # Include sub-route-map references in missing policy decision. + include_sub_route_map: next_hop_unchanged: graceful_restart: label_local_termination: diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 0344cd6edb6..002e42e514c 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -953,11 +953,28 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} update wait-for-convergence {% endif %} -{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action is arista.avd.defined %} - bgp missing-policy direction in action {{ router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in_action }} -{% endif %} -{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action is arista.avd.defined %} - bgp missing-policy direction out action {{ router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_out_action }} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy is arista.avd.defined %} +{% for direction in ['in', 'out'] %} +{% set dir = 'direction_' ~ direction %} +{% set policy = router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy[dir] %} +{% if policy.action is arista.avd.defined %} +{% set missing_policy_cli = "bgp missing-policy" %} +{% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " include" %} +{% if policy.include_community_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " community-list" %} +{% endif %} +{% if policy.include_prefix_list is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " prefix-list" %} +{% endif %} +{% if policy.include_sub_route_map is arista.avd.defined(true) %} +{% set missing_policy_cli = missing_policy_cli ~ " sub-route-map" %} +{% endif %} +{% endif %} +{% set missing_policy_cli = missing_policy_cli ~ " direction " ~ direction ~ " action " ~ policy.action %} + {{ missing_policy_cli }} +{% endif %} +{% endfor %} {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive is arista.avd.defined(true) %} bgp additional-paths receive @@ -1037,7 +1054,7 @@ router bgp {{ router_bgp.as }} {% set dir = 'direction_' ~ direction %} {% set policy = peer.missing_policy[dir] %} {% if policy.action is arista.avd.defined %} -{% set missing_policy_cli = "neighbor " ~ peer.name ~ " missing-policy address-family all" %} +{% set missing_policy_cli = "neighbor " ~ peer.name ~ " missing-policy" %} {% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} {% set missing_policy_cli = missing_policy_cli ~ " include" %} {% if policy.include_community_list is arista.avd.defined(true) %} @@ -1128,7 +1145,7 @@ router bgp {{ router_bgp.as }} {% set dir = 'direction_' ~ direction %} {% set policy = neighbor.missing_policy[dir] %} {% if policy.action is arista.avd.defined %} -{% set missing_policy_cli = "neighbor " ~ neighbor.ip_address ~ " missing-policy address-family all" %} +{% set missing_policy_cli = "neighbor " ~ neighbor.ip_address ~ " missing-policy " %} {% if policy.include_community_list is arista.avd.defined(true) or policy.include_prefix_list is arista.avd.defined(true) or policy.include_sub_route_map is arista.avd.defined(true) %} {% set missing_policy_cli = missing_policy_cli ~ " include" %} {% if policy.include_community_list is arista.avd.defined(true) %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 2a3765e69c4..15a6ef83652 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -13179,19 +13179,56 @@ keys: max: 64 missing_policy: type: dict + description: Missing policy configuration for all address-families. keys: - direction_in_action: - type: str - valid_values: - - deny - - deny-in-out - - permit - direction_out_action: - type: str - valid_values: - - deny - - deny-in-out - - permit + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy + decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing + policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy + decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy + decision. next_hop_unchanged: type: bool graceful_restart: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 7af99b60dd7..66fd719bc7d 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1490,19 +1490,50 @@ keys: max: 64 missing_policy: type: dict + description: Missing policy configuration for all address-families. keys: - direction_in_action: - type: str - valid_values: - - "deny" - - "deny-in-out" - - "permit" - direction_out_action: - type: str - valid_values: - - "deny" - - "deny-in-out" - - "permit" + direction_in: + description: Missing policy inbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. + direction_out: + description: Missing policy outbound direction. + type: dict + keys: + action: + description: Missing policy action. + type: str + required: true + valid_values: + - deny + - permit + - deny-in-out + include_community_list: + type: bool + description: Include community-list references in missing policy decision. + include_prefix_list: + type: bool + description: Include prefix-list references in missing policy decision. + include_sub_route_map: + type: bool + description: Include sub-route-map references in missing policy decision. next_hop_unchanged: type: bool graceful_restart: From cc699078dcca858f455d326574b38a5272bb471b Mon Sep 17 00:00:00 2001 From: Colin MacGiollaEain Date: Fri, 6 Sep 2024 09:36:35 +0100 Subject: [PATCH 16/26] Fix GR ordering --- .../router-bgp-ipv4-labeled-unicast.md | 4 ++-- .../router-bgp-ipv4-labeled-unicast.cfg | 4 ++-- .../j2templates/eos/router-bgp.j2 | 24 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index c20e662a1f7..b8d29f2485c 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -156,13 +156,13 @@ router bgp 65101 neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive - neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 graceful-restart + neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 additional-paths send ecmp neighbor 198.51.100.1 maximum-advertised-routes 0 no neighbor 198.51.100.2 activate - neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE + neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 next-hop-unchanged neighbor 198.51.100.2 aigp-session neighbor 198.51.100.2 multi-path diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 6b44f13ceb2..2df110bfeb3 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -39,13 +39,13 @@ router bgp 65101 neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive - neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 graceful-restart + neighbor 198.51.100.1 rcf in RCF_TEST(ARGS) neighbor 198.51.100.1 additional-paths send ecmp neighbor 198.51.100.1 maximum-advertised-routes 0 no neighbor 198.51.100.2 activate - neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 graceful-restart-helper stale-route route-map RM_STALE + neighbor 198.51.100.2 route-map RM_OUT_TEST out neighbor 198.51.100.2 next-hop-unchanged neighbor 198.51.100.2 aigp-session neighbor 198.51.100.2 multi-path diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 002e42e514c..5c86e8ccb1a 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -1002,6 +1002,12 @@ router bgp {{ router_bgp.as }} {% if peer.additional_paths.receive is arista.avd.defined(true) %} neighbor {{ peer.name }} additional-paths receive {% endif %} +{% if peer.graceful_restart is arista.avd.defined(true) %} + neighbor {{ peer.name }} graceful-restart +{% endif %} +{% if peer.graceful_restart_helper.stale_route_map is arista.avd.defined %} + neighbor {{ peer.name }} graceful-restart-helper stale-route route-map {{ peer.graceful_restart_helper.stale_route_map }} +{% endif %} {% if peer.route_map_in is arista.avd.defined %} neighbor {{ peer.name }} route-map {{ peer.route_map_in }} in {% endif %} @@ -1014,12 +1020,6 @@ router bgp {{ router_bgp.as }} {% if peer.rcf_out is arista.avd.defined %} neighbor {{ peer.name }} rcf out {{ peer.rcf_out }} {% endif %} -{% if peer.graceful_restart is arista.avd.defined(true) %} - neighbor {{ peer.name }} graceful-restart -{% endif %} -{% if peer.graceful_restart_helper.stale_route_map is arista.avd.defined %} - neighbor {{ peer.name }} graceful-restart-helper stale-route route-map {{ peer.graceful_restart_helper.stale_route_map }} -{% endif %} {% if peer.additional_paths.send.any is arista.avd.defined(true) %} neighbor {{ peer.name }} additional-paths send any {% elif peer.additional_paths.send.backup is arista.avd.defined(true) %} @@ -1093,6 +1093,12 @@ router bgp {{ router_bgp.as }} {% if neighbor.additional_paths.receive is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} additional-paths receive {% endif %} +{% if neighbor.graceful_restart is arista.avd.defined(true) %} + neighbor {{ neighbor.ip_address }} graceful-restart +{% endif %} +{% if neighbor.graceful_restart_helper.stale_route_map is arista.avd.defined %} + neighbor {{ neighbor.ip_address }} graceful-restart-helper stale-route route-map {{ neighbor.graceful_restart_helper.stale_route_map }} +{% endif %} {% if neighbor.route_map_in is arista.avd.defined %} neighbor {{ neighbor.ip_address }} route-map {{ neighbor.route_map_in }} in {% endif %} @@ -1105,12 +1111,6 @@ router bgp {{ router_bgp.as }} {% if neighbor.rcf_out is arista.avd.defined %} neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} {% endif %} -{% if neighbor.graceful_restart is arista.avd.defined(true) %} - neighbor {{ neighbor.ip_address }} graceful-restart -{% endif %} -{% if neighbor.graceful_restart_helper.stale_route_map is arista.avd.defined %} - neighbor {{ neighbor.ip_address }} graceful-restart-helper stale-route route-map {{ neighbor.graceful_restart_helper.stale_route_map }} -{% endif %} {% if neighbor.additional_paths.send.any is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} additional-paths send any {% elif neighbor.additional_paths.send.backup is arista.avd.defined(true) %} From ed7197dcfb89175f36b18a77e4170dc116d9ce25 Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 6 Sep 2024 13:36:12 +0200 Subject: [PATCH 17/26] Apply suggestions from code review Co-authored-by: laxmikantchintakindi <159624484+laxmikantchintakindi@users.noreply.github.com> --- .../router-bgp-ipv4-labeled-unicast.yml | 8 +-- .../j2templates/eos/router-bgp.j2 | 60 +++++++++---------- .../schema_fragments/router_bgp.schema.yml | 33 +--------- 3 files changed, 34 insertions(+), 67 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 10f8cdc826b..16483d9d87d 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -50,9 +50,8 @@ router_bgp: bgp: additional_paths: receive: true - send: - ecmp: true - ecmp_limit: 20 + send: ecmp + send_ecmp_limit: 20 missing_policy: direction_in: action: deny @@ -72,8 +71,7 @@ router_bgp: activate: true additional_paths: receive: true - send: - ecmp: true + send: ecmp graceful_restart: true maximum_advertised_routes: 0 rcf_in: RCF_TEST(ARGS) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 5c86e8ccb1a..45f510058db 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -979,16 +979,16 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive is arista.avd.defined(true) %} bgp additional-paths receive {% endif %} -{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.any is arista.avd.defined(true) %} - bgp additional-paths send any -{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.backup is arista.avd.defined(true) %} - bgp additional-paths send backup -{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp is arista.avd.defined(true) %} - bgp additional-paths send ecmp -{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp_limit is arista.avd.defined %} - bgp additional-paths send ecmp limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.ecmp_limit }} -{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.limit is arista.avd.defined %} - bgp additional-paths send limit {{ router_bgp.address_family_path_selection.bgp.additional_paths.send.limit }} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send is arista.avd.defined %} +{% set ipv4lu_add_path = "bgp additional-paths send" %} +{% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit is arista.avd.defined and router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send == "ecmp" %} +{% set ipv4lu_add_path = ipv4lu_add_path ~ " ecmp limit " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit %} +{% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_limit is arista.avd.defined and router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send == "limit" %} +{% set ipv4lu_add_path = ipv4lu_add_path ~ " ecmp limit " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit %} +{% else %} +{% set ipv4lu_add_path = ipv4lu_add_path ~ ' ' ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send %} +{% endif %} + {{ ipv4lu_add_path }} {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} bgp next-hop-unchanged @@ -1020,16 +1020,16 @@ router bgp {{ router_bgp.as }} {% if peer.rcf_out is arista.avd.defined %} neighbor {{ peer.name }} rcf out {{ peer.rcf_out }} {% endif %} -{% if peer.additional_paths.send.any is arista.avd.defined(true) %} - neighbor {{ peer.name }} additional-paths send any -{% elif peer.additional_paths.send.backup is arista.avd.defined(true) %} - neighbor {{ peer.name }} additional-paths send backup -{% elif peer.additional_paths.send.ecmp is arista.avd.defined(true) %} - neighbor {{ peer.name }} additional-paths send ecmp -{% elif peer.additional_paths.send.ecmp_limit is arista.avd.defined %} - neighbor {{ peer.name }} additional-paths send ecmp limit {{ peer.additional_paths.send.ecmp_limit }} -{% elif peer.additional_paths.send.limit is arista.avd.defined %} - neighbor {{ peer.name }} additional-paths send limit {{ peer.additional_paths.send.limit }} +{% if peer.additional_paths.send is arista.avd.defined %} +{% set lu_peer_add_path = "neighbor " ~ peer.name ~ " additional-paths send" %} +{% if peer.additional_paths.send_ecmp_limit is arista.avd.defined and peer.additional_paths.send == "ecmp" %} +{% set lu_peer_add_path = lu_peer_add_path ~ " ecmp limit " ~ peer.additional_paths.send_ecmp_limit %} +{% elif peer.additional_paths.send_limit is arista.avd.defined and peer.additional_paths.send == "limit" %} +{% set lu_peer_add_path = lu_peer_add_path~ " ecmp limit " ~ peer.additional_paths.send_ecmp_limit %} +{% else %} +{% set lu_peer_add_path = lu_peer_add_path ~ ' ' ~ peer.additional_paths.send %} +{% endif %} + {{ lu_peer_add_path }} {% endif %} {% if peer.next_hop_unchanged is arista.avd.defined(true) %} neighbor {{ peer.name }} next-hop-unchanged @@ -1111,16 +1111,16 @@ router bgp {{ router_bgp.as }} {% if neighbor.rcf_out is arista.avd.defined %} neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} {% endif %} -{% if neighbor.additional_paths.send.any is arista.avd.defined(true) %} - neighbor {{ neighbor.ip_address }} additional-paths send any -{% elif neighbor.additional_paths.send.backup is arista.avd.defined(true) %} - neighbor {{ neighbor.ip_address }} additional-paths send backup -{% elif neighbor.additional_paths.send.ecmp is arista.avd.defined(true) %} - neighbor {{ neighbor.ip_address }} additional-paths send ecmp -{% elif neighbor.additional_paths.send.ecmp_limit is arista.avd.defined %} - neighbor {{ neighbor.ip_address }} additional-paths send ecmp limit {{ neighbor.additional_paths.send.ecmp_limit }} -{% elif neighbor.additional_paths.send.limit is arista.avd.defined %} - neighbor {{ neighbor.ip_address }} additional-paths send limit {{ neighbor.additional_paths.send.limit }} +{% if neighbor.additional_paths.send is arista.avd.defined %} +{% set lu_neighbor_add_path = "neighbor " ~ neighbor.ip_address ~ " additional-paths send" %} +{% if neighbor.additional_paths.send_ecmp_limit is arista.avd.defined and neighbor.additional_paths.send == "ecmp" %} +{% set lu_neighbor_add_path = lu_neighbor_add_path ~ " ecmp limit " ~ neighbor.additional_paths.send_ecmp_limit %} +{% elif neighbor.additional_paths.send_limit is arista.avd.defined and neighbor.additional_paths.send == "limit" %} +{% set lu_neighbor_add_path = lu_neighbor_add_path~ " ecmp limit " ~ neighbor.additional_paths.send_ecmp_limit %} +{% else %} +{% set lu_neighbor_add_path = lu_neighbor_add_path ~ ' ' ~ neighbor.additional_paths.send %} +{% endif %} + {{ lu_neighbor_add_path }} {% endif %} {% if neighbor.next_hop_unchanged is arista.avd.defined(true) %} neighbor {{ neighbor.ip_address }} next-hop-unchanged diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 66fd719bc7d..1d3bcce1dac 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1456,38 +1456,7 @@ keys: keys: additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: "eos_cli_config_gen#/$defs/bgp_additional_paths" missing_policy: type: dict description: Missing policy configuration for all address-families. From dbe5a41063d7af23aedf8d26319a25841ec9b37d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:44:08 +0000 Subject: [PATCH 18/26] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../schema/eos_cli_config_gen.schema.yml | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 15a6ef83652..6fc7dc2cd55 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -13145,38 +13145,7 @@ keys: keys: additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: eos_cli_config_gen#/$defs/bgp_additional_paths missing_policy: type: dict description: Missing policy configuration for all address-families. From 86a5ca23b9393a1e39a5c01e339bcd1ac337920b Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 6 Sep 2024 18:09:54 +0530 Subject: [PATCH 19/26] Adding new data model for bgp additional paths. --- .../router-bgp-ipv4-labeled-unicast.md | 2 +- .../router-bgp-ipv4-labeled-unicast.cfg | 2 +- .../docs/tables/router-bgp.md | 129 +++++++----------- .../j2templates/eos/router-bgp.j2 | 24 ++-- .../schema/eos_cli_config_gen.schema.yml | 108 ++++++--------- .../defs_bgp_additional_paths.schema.yml | 34 +++++ .../schema_fragments/router_bgp.schema.yml | 66 +-------- 7 files changed, 139 insertions(+), 226 deletions(-) create mode 100644 python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/defs_bgp_additional_paths.schema.yml diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index b8d29f2485c..b047c9f76c4 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -151,7 +151,7 @@ router bgp 65101 update wait-for-convergence bgp missing-policy include community-list direction in action deny bgp additional-paths receive - bgp additional-paths send ecmp + bgp additional-paths send ecmp limit 20 bgp next-hop-unchanged neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 2df110bfeb3..cdb0328f3b7 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -34,7 +34,7 @@ router bgp 65101 update wait-for-convergence bgp missing-policy include community-list direction in action deny bgp additional-paths receive - bgp additional-paths send ecmp + bgp additional-paths send ecmp limit 20 bgp next-hop-unchanged neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index 366c67868e4..d5d99b72918 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -391,14 +391,11 @@ | [      ebgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ebgp") | Boolean | | | | | | [      ibgp](## "router_bgp.address_family_ipv4_labeled_unicast.aigp_session.ibgp") | Boolean | | | | | | [    bgp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp") | Dictionary | | | | | - | [      additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths") | Dictionary | | | | BGP additional-paths commands. | - | [        receive](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive") | Boolean | | | | Receive multiple paths. | - | [        send](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send") | Dictionary | | | | Send multiple paths. | - | [          any](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.any") | Boolean | | | | Any eligible path. | - | [          backup](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | - | [          ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | - | [          ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | - | [          limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [      additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths") | Dictionary | | | | | + | [        receive](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.receive") | Boolean | | | | | + | [        send](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send") | String | | | Valid Values:
- any
- backup
- ecmp
- limit
- disabled | Select an option to send multiple paths for same prefix through bgp updates.
any: Send any eligible path.
backup: Best path and installed backup path.
ecmp: All paths in best path ECMP group.
limit: Limit to n eligible paths.
disabled: Disable sending any path. | + | [        send_ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. | + | [        send_limit](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_limit") | Integer | | | Min: 2
Max: 64 | Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. | | [      missing_policy](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy") | Dictionary | | | | Missing policy configuration for all address-families. | | [        direction_in](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in") | Dictionary | | | | Missing policy inbound direction. | | [          action](## "router_bgp.address_family_ipv4_labeled_unicast.bgp.missing_policy.direction_in.action") | String | Required | | Valid Values:
- deny
- permit
- deny-in-out | Missing policy action. | @@ -419,14 +416,11 @@ | [    peer_groups](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups") | List, items: Dictionary | | | | | | [      - name](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].name") | String | Required, Unique | | | Peer-group name. | | [        activate](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].activate") | Boolean | | | | | - | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths") | Dictionary | | | | BGP additional-paths commands. | - | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.receive") | Boolean | | | | Receive multiple paths. | - | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send") | Dictionary | | | | Send multiple paths. | - | [            any](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.any") | Boolean | | | | Any eligible path. | - | [            backup](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | - | [            ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | - | [            ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | - | [            limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths") | Dictionary | | | | | + | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.receive") | Boolean | | | | | + | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send") | String | | | Valid Values:
- any
- backup
- ecmp
- limit
- disabled | Select an option to send multiple paths for same prefix through bgp updates.
any: Send any eligible path.
backup: Best path and installed backup path.
ecmp: All paths in best path ECMP group.
limit: Limit to n eligible paths.
disabled: Disable sending any path. | + | [          send_ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send_ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. | + | [          send_limit](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].additional_paths.send_limit") | Integer | | | Min: 2
Max: 64 | Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. | | [        aigp_session](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].aigp_session") | Boolean | | | | | | [        graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].graceful_restart") | Boolean | | | | | | [        graceful_restart_helper](## "router_bgp.address_family_ipv4_labeled_unicast.peer_groups.[].graceful_restart_helper") | Dictionary | | | | | @@ -458,14 +452,11 @@ | [    neighbors](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors") | List, items: Dictionary | | | | | | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].ip_address") | String | Required, Unique | | | | | [        activate](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].activate") | Boolean | | | | | - | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths") | Dictionary | | | | BGP additional-paths commands. | - | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.receive") | Boolean | | | | Receive multiple paths. | - | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send") | Dictionary | | | | Send multiple paths. | - | [            any](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.any") | Boolean | | | | Any eligible path. | - | [            backup](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.backup") | Boolean | | | | Best path and installed backup path. | - | [            ecmp](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.ecmp") | Boolean | | | | All paths in best path ECMP group. | - | [            ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. | - | [            limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send.limit") | Integer | | | Min: 2
Max: 64 | Amount of paths to send. | + | [        additional_paths](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths") | Dictionary | | | | | + | [          receive](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.receive") | Boolean | | | | | + | [          send](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send") | String | | | Valid Values:
- any
- backup
- ecmp
- limit
- disabled | Select an option to send multiple paths for same prefix through bgp updates.
any: Send any eligible path.
backup: Best path and installed backup path.
ecmp: All paths in best path ECMP group.
limit: Limit to n eligible paths.
disabled: Disable sending any path. | + | [          send_ecmp_limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send_ecmp_limit") | Integer | | | Min: 2
Max: 64 | Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. | + | [          send_limit](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].additional_paths.send_limit") | Integer | | | Min: 2
Max: 64 | Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. | | [        aigp_session](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].aigp_session") | Boolean | | | | | | [        graceful_restart](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart") | Boolean | | | | | | [        graceful_restart_helper](## "router_bgp.address_family_ipv4_labeled_unicast.neighbors.[].graceful_restart_helper") | Dictionary | | | | | @@ -1737,30 +1728,22 @@ ebgp: ibgp: bgp: - - # BGP additional-paths commands. additional_paths: - - # Receive multiple paths. receive: - # Send multiple paths. - send: - - # Any eligible path. - any: - - # Best path and installed backup path. - backup: + # Select an option to send multiple paths for same prefix through bgp updates. + # any: Send any eligible path. + # backup: Best path and installed backup path. + # ecmp: All paths in best path ECMP group. + # limit: Limit to n eligible paths. + # disabled: Disable sending any path. + send: - # All paths in best path ECMP group. - ecmp: - - # Amount of ECMP paths to send. - ecmp_limit: + # Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. + send_ecmp_limit: - # Amount of paths to send. - limit: + # Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. + send_limit: # Missing policy configuration for all address-families. missing_policy: @@ -1807,30 +1790,22 @@ # Peer-group name. - name: activate: - - # BGP additional-paths commands. additional_paths: - - # Receive multiple paths. receive: - # Send multiple paths. - send: + # Select an option to send multiple paths for same prefix through bgp updates. + # any: Send any eligible path. + # backup: Best path and installed backup path. + # ecmp: All paths in best path ECMP group. + # limit: Limit to n eligible paths. + # disabled: Disable sending any path. + send: - # Any eligible path. - any: + # Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. + send_ecmp_limit: - # Best path and installed backup path. - backup: - - # All paths in best path ECMP group. - ecmp: - - # Amount of ECMP paths to send. - ecmp_limit: - - # Amount of paths to send. - limit: + # Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. + send_limit: aigp_session: graceful_restart: graceful_restart_helper: @@ -1903,30 +1878,22 @@ neighbors: - ip_address: activate: - - # BGP additional-paths commands. additional_paths: - - # Receive multiple paths. receive: - # Send multiple paths. - send: + # Select an option to send multiple paths for same prefix through bgp updates. + # any: Send any eligible path. + # backup: Best path and installed backup path. + # ecmp: All paths in best path ECMP group. + # limit: Limit to n eligible paths. + # disabled: Disable sending any path. + send: - # Any eligible path. - any: + # Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. + send_ecmp_limit: - # Best path and installed backup path. - backup: - - # All paths in best path ECMP group. - ecmp: - - # Amount of ECMP paths to send. - ecmp_limit: - - # Amount of paths to send. - limit: + # Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. + send_limit: aigp_session: graceful_restart: graceful_restart_helper: diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 45f510058db..c88f747ece2 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -980,13 +980,11 @@ router bgp {{ router_bgp.as }} bgp additional-paths receive {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send is arista.avd.defined %} -{% set ipv4lu_add_path = "bgp additional-paths send" %} +{% set ipv4lu_add_path = "bgp additional-paths send " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send %} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit is arista.avd.defined and router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send == "ecmp" %} -{% set ipv4lu_add_path = ipv4lu_add_path ~ " ecmp limit " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit %} +{% set ipv4lu_add_path = ipv4lu_add_path ~ " limit " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit %} {% elif router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_limit is arista.avd.defined and router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send == "limit" %} -{% set ipv4lu_add_path = ipv4lu_add_path ~ " ecmp limit " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_ecmp_limit %} -{% else %} -{% set ipv4lu_add_path = ipv4lu_add_path ~ ' ' ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send %} +{% set ipv4lu_add_path = ipv4lu_add_path ~ " " ~ router_bgp.address_family_ipv4_labeled_unicast.bgp.additional_paths.send_limit %} {% endif %} {{ ipv4lu_add_path }} {% endif %} @@ -1021,13 +1019,11 @@ router bgp {{ router_bgp.as }} neighbor {{ peer.name }} rcf out {{ peer.rcf_out }} {% endif %} {% if peer.additional_paths.send is arista.avd.defined %} -{% set lu_peer_add_path = "neighbor " ~ peer.name ~ " additional-paths send" %} +{% set lu_peer_add_path = "neighbor " ~ peer.name ~ " additional-paths send " ~ peer.additional_paths.send %} {% if peer.additional_paths.send_ecmp_limit is arista.avd.defined and peer.additional_paths.send == "ecmp" %} -{% set lu_peer_add_path = lu_peer_add_path ~ " ecmp limit " ~ peer.additional_paths.send_ecmp_limit %} +{% set lu_peer_add_path = lu_peer_add_path ~ " limit " ~ peer.additional_paths.send_ecmp_limit %} {% elif peer.additional_paths.send_limit is arista.avd.defined and peer.additional_paths.send == "limit" %} -{% set lu_peer_add_path = lu_peer_add_path~ " ecmp limit " ~ peer.additional_paths.send_ecmp_limit %} -{% else %} -{% set lu_peer_add_path = lu_peer_add_path ~ ' ' ~ peer.additional_paths.send %} +{% set lu_peer_add_path = lu_peer_add_path~ " " ~ peer.additional_paths.send_limit %} {% endif %} {{ lu_peer_add_path }} {% endif %} @@ -1112,13 +1108,11 @@ router bgp {{ router_bgp.as }} neighbor {{ neighbor.ip_address }} rcf out {{ neighbor.rcf_out }} {% endif %} {% if neighbor.additional_paths.send is arista.avd.defined %} -{% set lu_neighbor_add_path = "neighbor " ~ neighbor.ip_address ~ " additional-paths send" %} +{% set lu_neighbor_add_path = "neighbor " ~ neighbor.ip_address ~ " additional-paths send " ~ neighbor.additional_paths.send %} {% if neighbor.additional_paths.send_ecmp_limit is arista.avd.defined and neighbor.additional_paths.send == "ecmp" %} -{% set lu_neighbor_add_path = lu_neighbor_add_path ~ " ecmp limit " ~ neighbor.additional_paths.send_ecmp_limit %} +{% set lu_neighbor_add_path = lu_neighbor_add_path ~ " limit " ~ neighbor.additional_paths.send_ecmp_limit %} {% elif neighbor.additional_paths.send_limit is arista.avd.defined and neighbor.additional_paths.send == "limit" %} -{% set lu_neighbor_add_path = lu_neighbor_add_path~ " ecmp limit " ~ neighbor.additional_paths.send_ecmp_limit %} -{% else %} -{% set lu_neighbor_add_path = lu_neighbor_add_path ~ ' ' ~ neighbor.additional_paths.send %} +{% set lu_neighbor_add_path = lu_neighbor_add_path~ " " ~ neighbor.additional_paths.send_limit %} {% endif %} {{ lu_neighbor_add_path }} {% endif %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 6fc7dc2cd55..d489740f019 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -13228,38 +13228,7 @@ keys: type: bool additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: eos_cli_config_gen#/$defs/bgp_additional_paths aigp_session: type: bool graceful_restart: @@ -13386,38 +13355,7 @@ keys: type: bool additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: eos_cli_config_gen#/$defs/bgp_additional_paths aigp_session: type: bool graceful_restart: @@ -19714,6 +19652,48 @@ $defs: When the `protocols` list contain both `tcp` and `udp`, this key value must be the same as `udp_dest_port_set_name`.' + bgp_additional_paths: + type: dict + keys: + receive: + type: bool + send: + type: str + description: 'Select an option to send multiple paths for same prefix through + bgp updates. + + any: Send any eligible path. + + backup: Best path and installed backup path. + + ecmp: All paths in best path ECMP group. + + limit: Limit to n eligible paths. + + disabled: Disable sending any path.' + valid_values: + - any + - backup + - ecmp + - limit + - disabled + send_ecmp_limit: + type: int + description: Amount of ECMP paths to send. `send` must be set to `ecmp` for + this settings. If this key-value pair is not set, it will send all paths + in best ECMP group. + convert_types: + - str + min: 2 + max: 64 + send_limit: + type: int + description: Number of paths to send through bgp updates. `send` must be set + to `limit` for this setting. + convert_types: + - str + min: 2 + max: 64 flow_tracking: type: dict keys: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/defs_bgp_additional_paths.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/defs_bgp_additional_paths.schema.yml new file mode 100644 index 00000000000..eccf0ee83ba --- /dev/null +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/defs_bgp_additional_paths.schema.yml @@ -0,0 +1,34 @@ +# Copyright (c) 2024 Arista Networks, Inc. +# Use of this source code is governed by the Apache License 2.0 +# that can be found in the LICENSE file. +type: dict +$defs: + bgp_additional_paths: + type: dict + keys: + receive: + type: bool + send: + type: str + description: |- + Select an option to send multiple paths for same prefix through bgp updates. + any: Send any eligible path. + backup: Best path and installed backup path. + ecmp: All paths in best path ECMP group. + limit: Limit to n eligible paths. + disabled: Disable sending any path. + valid_values: [ 'any', 'backup', 'ecmp', 'limit', 'disabled' ] + send_ecmp_limit: + type: int + description: Amount of ECMP paths to send. `send` must be set to `ecmp` for this settings. If this key-value pair is not set, it will send all paths in best ECMP group. + convert_types: + - str + min: 2 + max: 64 + send_limit: + type: int + description: Number of paths to send through bgp updates. `send` must be set to `limit` for this setting. + convert_types: + - str + min: 2 + max: 64 diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 1d3bcce1dac..7bd149b59fd 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1533,38 +1533,7 @@ keys: type: bool additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: "eos_cli_config_gen#/$defs/bgp_additional_paths" aigp_session: type: bool graceful_restart: @@ -1679,38 +1648,7 @@ keys: type: bool additional_paths: type: dict - description: BGP additional-paths commands. - keys: - receive: - type: bool - description: Receive multiple paths. - send: - type: dict - description: Send multiple paths. - keys: - any: - type: bool - description: Any eligible path. - backup: - type: bool - description: Best path and installed backup path. - ecmp: - type: bool - description: All paths in best path ECMP group. - ecmp_limit: - type: int - description: Amount of ECMP paths to send. - convert_types: - - str - min: 2 - max: 64 - limit: - type: int - description: Amount of paths to send. - convert_types: - - str - min: 2 - max: 64 + $ref: "eos_cli_config_gen#/$defs/bgp_additional_paths" aigp_session: type: bool graceful_restart: From 8d49cbc53b2dfb1ea91a1ab84c109e326de2eaa1 Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Mon, 9 Sep 2024 13:30:49 +0200 Subject: [PATCH 20/26] Update ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml --- .../router-bgp-ipv4-labeled-unicast.yml | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 16483d9d87d..e2634ba58c4 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -1,47 +1,6 @@ router_bgp: as: 65101 router_id: 192.168.255.3 - bgp_defaults: - - no bgp default ipv4-unicast - - distance bgp 20 200 200 - - graceful-restart restart-time 300 - - graceful-restart - - maximum-paths 2 ecmp 2 - peer_groups: - - name: PG-BGP-LU - type: IPv4 Labeled-Unicast - remote_as: 65555 - update_source: Loopback0 - - name: EVPN-OVERLAY-PEERS - type: evpn - remote_as: 65001 - update_source: Loopback0 - bfd: true - ebgp_multihop: 3 - password: "q+VNViP5i4rVjW1cxFv2wA==" - send_community: all - maximum_routes: 0 - default_originate: - enabled: true - route_map: RM-FOO - always: true - rib_in_pre_policy_retain: - enabled: true - all: true - - name: MLAG-IPv4-UNDERLAY-PEER - type: ipv4 - remote_as: 65101 - # Test no config generation - default_originate: - # Test no config generation - rib_in_pre_policy_retain: - neighbors: - - ip_address: 192.168.255.1 - peer_group: EVPN-OVERLAY-PEERS - - ip_address: 192.168.255.2 - peer_group: EVPN-OVERLAY-PEERS - - ip_address: 198.51.100.3 - peer_group: PG-BGP-LU address_family_ipv4_labeled_unicast: update_wait_for_convergence: true aigp_session: From 33e822da9ccae0b7b2ac5f290eacca0eecee5e6d Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Mon, 9 Sep 2024 13:34:34 +0200 Subject: [PATCH 21/26] update CI artifacts --- .../router-bgp-ipv4-labeled-unicast.md | 73 +------------------ .../router-bgp-ipv4-labeled-unicast.cfg | 24 ------ .../router-bgp-ipv4-labeled-unicast.yml | 1 - 3 files changed, 1 insertion(+), 97 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index b047c9f76c4..1c8c3cf5b97 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -45,54 +45,7 @@ ASN Notation: asplain | BGP AS | Router ID | | ------ | --------- | -| 65101 | 192.168.255.3 | - -| BGP Tuning | -| ---------- | -| no bgp default ipv4-unicast | -| distance bgp 20 200 200 | -| graceful-restart restart-time 300 | -| graceful-restart | -| maximum-paths 2 ecmp 2 | - -#### Router BGP Peer Groups - -##### EVPN-OVERLAY-PEERS - -| Settings | Value | -| -------- | ----- | -| Address Family | evpn | -| Remote AS | 65001 | -| Source | Loopback0 | -| RIB Pre-Policy Retain | True (All) | -| BFD | True | -| Ebgp multihop | 3 | -| Default originate | True | -| Send community | all | -| Maximum routes | 0 (no limit) | - -##### MLAG-IPv4-UNDERLAY-PEER - -| Settings | Value | -| -------- | ----- | -| Address Family | ipv4 | -| Remote AS | 65101 | - -##### PG-BGP-LU - -| Settings | Value | -| -------- | ----- | -| Address Family | IPv4 Labeled-Unicast | -| Remote AS | 65555 | -| Source | Loopback0 | - -#### BGP Neighbors - -| Neighbor | Remote AS | VRF | Shutdown | Send-community | Maximum-routes | Allowas-in | BFD | RIB Pre-Policy Retain | Route-Reflector Client | Passive | TTL Max Hops | -| -------- | --------- | --- | -------- | -------------- | -------------- | ---------- | --- | --------------------- | ---------------------- | ------- | ------------ | -| 192.168.255.1 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | -| 192.168.255.2 | Inherited from peer group EVPN-OVERLAY-PEERS | default | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | Inherited from peer group EVPN-OVERLAY-PEERS | Inherited from peer group EVPN-OVERLAY-PEERS | - | - | - | -| 198.51.100.3 | Inherited from peer group PG-BGP-LU | default | - | - | - | - | - | - | - | - | - | +| 65101 | - | #### Router BGP IPv4 Labeled Unicast @@ -122,30 +75,6 @@ ASN Notation: asplain ```eos ! router bgp 65101 - router-id 192.168.255.3 - no bgp default ipv4-unicast - distance bgp 20 200 200 - graceful-restart restart-time 300 - graceful-restart - maximum-paths 2 ecmp 2 - neighbor EVPN-OVERLAY-PEERS peer group - neighbor EVPN-OVERLAY-PEERS remote-as 65001 - neighbor EVPN-OVERLAY-PEERS update-source Loopback0 - neighbor EVPN-OVERLAY-PEERS bfd - neighbor EVPN-OVERLAY-PEERS rib-in pre-policy retain all - neighbor EVPN-OVERLAY-PEERS ebgp-multihop 3 - neighbor EVPN-OVERLAY-PEERS password 7 - neighbor EVPN-OVERLAY-PEERS default-originate route-map RM-FOO always - neighbor EVPN-OVERLAY-PEERS send-community - neighbor EVPN-OVERLAY-PEERS maximum-routes 0 - neighbor MLAG-IPv4-UNDERLAY-PEER peer group - neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 - neighbor PG-BGP-LU peer group - neighbor PG-BGP-LU remote-as 65555 - neighbor PG-BGP-LU update-source Loopback0 - neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS - neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS - neighbor 198.51.100.3 peer group PG-BGP-LU ! address-family ipv4 labeled-unicast update wait-for-convergence diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index cdb0328f3b7..547cce599bd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -5,30 +5,6 @@ interface Management1 ip address 10.73.255.122/24 ! router bgp 65101 - router-id 192.168.255.3 - no bgp default ipv4-unicast - distance bgp 20 200 200 - graceful-restart restart-time 300 - graceful-restart - maximum-paths 2 ecmp 2 - neighbor EVPN-OVERLAY-PEERS peer group - neighbor EVPN-OVERLAY-PEERS remote-as 65001 - neighbor EVPN-OVERLAY-PEERS update-source Loopback0 - neighbor EVPN-OVERLAY-PEERS bfd - neighbor EVPN-OVERLAY-PEERS rib-in pre-policy retain all - neighbor EVPN-OVERLAY-PEERS ebgp-multihop 3 - neighbor EVPN-OVERLAY-PEERS password 7 q+VNViP5i4rVjW1cxFv2wA== - neighbor EVPN-OVERLAY-PEERS default-originate route-map RM-FOO always - neighbor EVPN-OVERLAY-PEERS send-community - neighbor EVPN-OVERLAY-PEERS maximum-routes 0 - neighbor MLAG-IPv4-UNDERLAY-PEER peer group - neighbor MLAG-IPv4-UNDERLAY-PEER remote-as 65101 - neighbor PG-BGP-LU peer group - neighbor PG-BGP-LU remote-as 65555 - neighbor PG-BGP-LU update-source Loopback0 - neighbor 192.168.255.1 peer group EVPN-OVERLAY-PEERS - neighbor 192.168.255.2 peer group EVPN-OVERLAY-PEERS - neighbor 198.51.100.3 peer group PG-BGP-LU ! address-family ipv4 labeled-unicast update wait-for-convergence diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index e2634ba58c4..18bc655521d 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -1,6 +1,5 @@ router_bgp: as: 65101 - router_id: 192.168.255.3 address_family_ipv4_labeled_unicast: update_wait_for_convergence: true aigp_session: From d26e42c00b4c63b9341fb66bba4b7ced102b511b Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 18 Sep 2024 16:04:41 +0530 Subject: [PATCH 22/26] Fix tunnel-rib-colored to tunnel-rib colored --- .../documentation/devices/router-bgp-ipv4-labeled-unicast.md | 1 + .../intended/configs/router-bgp-ipv4-labeled-unicast.cfg | 1 + .../inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml | 5 +++++ .../avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md | 4 ++-- .../pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 | 4 ++-- .../_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml | 2 +- .../schema/schema_fragments/router_bgp.schema.yml | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 1c8c3cf5b97..741e5d88e38 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -98,6 +98,7 @@ router bgp 65101 network 203.0.113.0/25 route-map RM-TEST network 203.0.113.128/25 label local-termination implicit-null + next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected tunnel source-protocol isis segment-routing tunnel source-protocol ldp rcf TEST(ARGS) aigp-session confederation diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 547cce599bd..8faf95ce029 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -28,6 +28,7 @@ router bgp 65101 network 203.0.113.0/25 route-map RM-TEST network 203.0.113.128/25 label local-termination implicit-null + next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected tunnel source-protocol isis segment-routing tunnel source-protocol ldp rcf TEST(ARGS) aigp-session confederation diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 18bc655521d..72472339a7b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -15,6 +15,11 @@ router_bgp: action: deny include_community_list: true next_hop_unchanged: true + next_hop_resolution_ribs: + - rib_type: "tunnel-rib colored" + - rib_type: "tunnel-rib" + rib_name: "test-rib" + - rib_type: "system-connected" label_local_termination: implicit-null networks: - prefix: 203.0.113.0/25 diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index d5d99b72918..271bf1e675a 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -492,7 +492,7 @@ | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].ip_address") | String | Required, Unique | | | | | [        lfib_backup_ip_forwarding](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].lfib_backup_ip_forwarding") | Boolean | | | | | | [    next_hop_resolution_ribs](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs") | List, items: Dictionary | | | Min Length: 1
Max Length: 3 | Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. | - | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib-colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | + | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | | [        rib_name](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. | | [    tunnel_source_protocols](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].protocol") | String | Required, Unique | | Valid Values:
- isis segment-routing
- ldp | | @@ -1978,7 +1978,7 @@ next_hop_resolution_ribs: # 1-3 items # Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. - - rib_type: + - rib_type: # The name of the tunnel-rib to use when using 'tunnel-rib' type. rib_name: diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index c88f747ece2..efed723a474 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -1202,8 +1202,8 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} {% set v4_bgp_lu_resolution_ribs = [] %} {% for rib in router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs %} -{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} -{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib-colored system-colored-tunnel-rib") %} +{% if rib.rib_type is arista.avd.defined("tunnel-rib colored") %} +{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib colored system-colored-tunnel-rib") %} {% elif rib.rib_type is arista.avd.defined("tunnel-rib") and rib.rib_name is arista.avd.defined() %} {% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} {% elif rib.rib_type is arista.avd.defined %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index a38aeff1038..44d06bf2214 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -13582,7 +13582,7 @@ keys: required: true valid_values: - system-connected - - tunnel-rib-colored + - tunnel-rib colored - tunnel-rib description: Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index 7bd149b59fd..e12880e8804 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1788,7 +1788,7 @@ keys: required: true valid_values: - "system-connected" - - "tunnel-rib-colored" + - "tunnel-rib colored" - "tunnel-rib" description: "Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use." rib_name: From c44bf4bcf2e8888545263f054eca7c1f67dab123 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 18 Sep 2024 16:44:19 +0530 Subject: [PATCH 23/26] Fixing inputs. --- .../devices/router-bgp-ipv4-labeled-unicast.md | 6 +++--- .../intended/configs/router-bgp-ipv4-labeled-unicast.cfg | 2 +- .../inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml | 2 +- .../avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md | 4 ++-- .../pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 | 2 +- .../schema/eos_cli_config_gen.schema.yml | 2 +- .../schema/schema_fragments/router_bgp.schema.yml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 741e5d88e38..bade1669056 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -17,20 +17,20 @@ | Management Interface | Description | Type | VRF | IP Address | Gateway | | -------------------- | ----------- | ---- | --- | ---------- | ------- | -| Management1 | oob_management | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 | +| Management1 | OOB_MANAGEMENT | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 | ##### IPv6 | Management Interface | Description | Type | VRF | IPv6 Address | IPv6 Gateway | | -------------------- | ----------- | ---- | --- | ------------ | ------------ | -| Management1 | oob_management | oob | MGMT | - | - | +| Management1 | OOB_MANAGEMENT | oob | MGMT | - | - | #### Management Interfaces Device Configuration ```eos ! interface Management1 - description oob_management + description OOB_MANAGEMENT vrf MGMT ip address 10.73.255.122/24 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 8faf95ce029..8072b3198a1 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -1,6 +1,6 @@ ! interface Management1 - description oob_management + description OOB_MANAGEMENT vrf MGMT ip address 10.73.255.122/24 ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml index 72472339a7b..912999844e5 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-ipv4-labeled-unicast.yml @@ -16,7 +16,7 @@ router_bgp: include_community_list: true next_hop_unchanged: true next_hop_resolution_ribs: - - rib_type: "tunnel-rib colored" + - rib_type: "tunnel-rib-colored" - rib_type: "tunnel-rib" rib_name: "test-rib" - rib_type: "system-connected" diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md index 271bf1e675a..d5d99b72918 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-bgp.md @@ -492,7 +492,7 @@ | [      - ip_address](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].ip_address") | String | Required, Unique | | | | | [        lfib_backup_ip_forwarding](## "router_bgp.address_family_ipv4_labeled_unicast.next_hops.[].lfib_backup_ip_forwarding") | Boolean | | | | | | [    next_hop_resolution_ribs](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs") | List, items: Dictionary | | | Min Length: 1
Max Length: 3 | Specify the RIBs used to resolve next-hops. The order of this list determines the order of RIB lookups. | - | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | + | [      - rib_type](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_type") | String | Required | | Valid Values:
- system-connected
- tunnel-rib-colored
- tunnel-rib | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. | | [        rib_name](## "router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. | | [    tunnel_source_protocols](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols") | List, items: Dictionary | | | Min Length: 1
Max Length: 2 | | | [      - protocol](## "router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols.[].protocol") | String | Required, Unique | | Valid Values:
- isis segment-routing
- ldp | | @@ -1978,7 +1978,7 @@ next_hop_resolution_ribs: # 1-3 items # Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. - - rib_type: + - rib_type: # The name of the tunnel-rib to use when using 'tunnel-rib' type. rib_name: diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index efed723a474..8673c9a7a67 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -1202,7 +1202,7 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} {% set v4_bgp_lu_resolution_ribs = [] %} {% for rib in router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs %} -{% if rib.rib_type is arista.avd.defined("tunnel-rib colored") %} +{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} {% do v4_bgp_lu_resolution_ribs.append("tunnel-rib colored system-colored-tunnel-rib") %} {% elif rib.rib_type is arista.avd.defined("tunnel-rib") and rib.rib_name is arista.avd.defined() %} {% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index b8fa717391c..a3ff942d7b0 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -13584,7 +13584,7 @@ keys: required: true valid_values: - system-connected - - tunnel-rib colored + - tunnel-rib-colored - tunnel-rib description: Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml index e12880e8804..7bd149b59fd 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_bgp.schema.yml @@ -1788,7 +1788,7 @@ keys: required: true valid_values: - "system-connected" - - "tunnel-rib colored" + - "tunnel-rib-colored" - "tunnel-rib" description: "Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use." rib_name: From 6a9994ea69d59305b175f01f3baaec74c7f15a29 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar <122076792+MaheshGSLAB@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:47:26 +0530 Subject: [PATCH 24/26] Apply suggestions from code review --- .../j2templates/eos/router-bgp.j2 | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index e1ece0b8061..8b8d39ffc35 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -991,6 +991,23 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} bgp next-hop-unchanged {% endif %} +{% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} +{% set v4_bgp_lu_resolution_ribs = [] %} +{% for rib in router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs %} +{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} +{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib colored system-colored-tunnel-rib") %} +{% elif rib.rib_type is arista.avd.defined("tunnel-rib") %} +{%. if rib.rib_name is arista.avd.defined %} +{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} +{%. endif %} +{% elif rib.rib_type is arista.avd.defined %} +{% do v4_bgp_lu_resolution_ribs.append(rib.rib_type) %} +{% endif %} +{% endfor %} +{% if v4_bgp_lu_resolution_ribs %} + next-hop resolution ribs {{ v4_bgp_lu_resolution_ribs | join(" ") }} +{% endif %} +{% endif %} {% for peer in router_bgp.address_family_ipv4_labeled_unicast.peer_groups | arista.avd.natural_sort('name') %} {% if peer.activate is arista.avd.defined(true) %} neighbor {{ peer.name }} activate @@ -1199,21 +1216,6 @@ router bgp {{ router_bgp.as }} {% if router_bgp.address_family_ipv4_labeled_unicast.neighbor_default.next_hop_self is arista.avd.defined(true) %} neighbor default next-hop-self {% endif %} -{% if router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs is arista.avd.defined %} -{% set v4_bgp_lu_resolution_ribs = [] %} -{% for rib in router_bgp.address_family_ipv4_labeled_unicast.next_hop_resolution_ribs %} -{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} -{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib colored system-colored-tunnel-rib") %} -{% elif rib.rib_type is arista.avd.defined("tunnel-rib") and rib.rib_name is arista.avd.defined() %} -{% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} -{% elif rib.rib_type is arista.avd.defined %} -{% do v4_bgp_lu_resolution_ribs.append(rib.rib_type) %} -{% endif %} -{% endfor %} -{% if v4_bgp_lu_resolution_ribs %} - next-hop resolution ribs {{ v4_bgp_lu_resolution_ribs | join(" ") }} -{% endif %} -{% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols is arista.avd.defined %} {% for tunnel_source_protocol in router_bgp.address_family_ipv4_labeled_unicast.tunnel_source_protocols %} {% set tunnel_source_protocol_cli = "tunnel source-protocol " ~ tunnel_source_protocol.protocol %} From 468fedd76519e829ee7715f0a1d9953b6848c19f Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Mon, 23 Sep 2024 13:01:52 +0530 Subject: [PATCH 25/26] Fix order --- .../documentation/devices/router-bgp-ipv4-labeled-unicast.md | 2 +- .../intended/configs/router-bgp-ipv4-labeled-unicast.cfg | 2 +- .../pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index bade1669056..87c33b811fd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -82,6 +82,7 @@ router bgp 65101 bgp additional-paths receive bgp additional-paths send ecmp limit 20 bgp next-hop-unchanged + next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive @@ -98,7 +99,6 @@ router bgp 65101 network 203.0.113.0/25 route-map RM-TEST network 203.0.113.128/25 label local-termination implicit-null - next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected tunnel source-protocol isis segment-routing tunnel source-protocol ldp rcf TEST(ARGS) aigp-session confederation diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg index 8072b3198a1..6edb13b7e19 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-ipv4-labeled-unicast.cfg @@ -12,6 +12,7 @@ router bgp 65101 bgp additional-paths receive bgp additional-paths send ecmp limit 20 bgp next-hop-unchanged + next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected neighbor PG-BGP-LU activate neighbor 198.51.100.1 activate neighbor 198.51.100.1 additional-paths receive @@ -28,7 +29,6 @@ router bgp 65101 network 203.0.113.0/25 route-map RM-TEST network 203.0.113.128/25 label local-termination implicit-null - next-hop resolution ribs tunnel-rib colored system-colored-tunnel-rib tunnel-rib test-rib system-connected tunnel source-protocol isis segment-routing tunnel source-protocol ldp rcf TEST(ARGS) aigp-session confederation diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 index 8b8d39ffc35..de58c0407fe 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2 @@ -997,9 +997,9 @@ router bgp {{ router_bgp.as }} {% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %} {% do v4_bgp_lu_resolution_ribs.append("tunnel-rib colored system-colored-tunnel-rib") %} {% elif rib.rib_type is arista.avd.defined("tunnel-rib") %} -{%. if rib.rib_name is arista.avd.defined %} +{% if rib.rib_name is arista.avd.defined %} {% do v4_bgp_lu_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %} -{%. endif %} +{% endif %} {% elif rib.rib_type is arista.avd.defined %} {% do v4_bgp_lu_resolution_ribs.append(rib.rib_type) %} {% endif %} From 93a1b2b1b4f53685b33623c777f97bc3e67ff17c Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 27 Sep 2024 11:43:46 +0200 Subject: [PATCH 26/26] Apply suggestions from code review Co-authored-by: Mahesh Kumar <122076792+MaheshGSLAB@users.noreply.github.com> --- .../documentation/devices/router-bgp-ipv4-labeled-unicast.md | 2 +- .../_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md index 87c33b811fd..a416c8b5e0a 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-ipv4-labeled-unicast.md @@ -53,7 +53,7 @@ ASN Notation: asplain | Settings | Value | | -------- | ----- | -| Update - wait-for-convergence | Enabled | +| Update wait-for-convergence | Enabled | | Next-hop Unchanged | True | | Label local-termination | implicit-null | diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 index 853850d337a..49a4adf0130 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-bgp.j2 @@ -643,7 +643,7 @@ ASN Notation: {{ router_bgp.as_notation | arista.avd.default('asplain') }} | Settings | Value | | -------- | ----- | {% if router_bgp.address_family_ipv4_labeled_unicast.update_wait_for_convergence is arista.avd.defined(true) %} -| Update - wait-for-convergence | Enabled | +| Update wait-for-convergence | Enabled | {% endif %} {% if router_bgp.address_family_ipv4_labeled_unicast.bgp.next_hop_unchanged is arista.avd.defined(true) %} | Next-hop Unchanged | True |