diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-evpn-mpls.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-evpn-mpls.md index a4b663331bd..37075e00f17 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-evpn-mpls.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/router-bgp-evpn-mpls.md @@ -103,7 +103,7 @@ ASN Notation: asplain | Neighbor | Activate | Encapsulation | | -------- | -------- | ------------- | | 192.168.255.3 | True | default | -| 192.168.255.4 | False | default | +| 192.168.255.4 | False | mpls | ##### EVPN Neighbor Default Encapsulation @@ -145,5 +145,6 @@ router bgp 65101 neighbor 192.168.255.3 activate neighbor 192.168.255.4 rcf in Address_Family_EVPN_In() neighbor 192.168.255.4 rcf out Address_Family_EVPN_Out() + neighbor 192.168.255.4 encapsulation mpls next-hop-self source-interface Ethernet1 layer-2 fec in-place update timeout 100 seconds ``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-evpn-mpls.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-evpn-mpls.cfg index 8dc866980e4..fbd0ce41546 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-evpn-mpls.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/router-bgp-evpn-mpls.cfg @@ -34,4 +34,5 @@ router bgp 65101 neighbor 192.168.255.3 activate neighbor 192.168.255.4 rcf in Address_Family_EVPN_In() neighbor 192.168.255.4 rcf out Address_Family_EVPN_Out() + neighbor 192.168.255.4 encapsulation mpls next-hop-self source-interface Ethernet1 layer-2 fec in-place update timeout 100 seconds diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-evpn-mpls.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-evpn-mpls.yml index 739bf7afadb..7aa5a5372e4 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-evpn-mpls.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/router-bgp-evpn-mpls.yml @@ -55,6 +55,8 @@ router_bgp: - ip_address: 192.168.255.4 rcf_in: Address_Family_EVPN_In() rcf_out: Address_Family_EVPN_Out() + encapsulation: mpls + next_hop_self_source_interface: Ethernet1 peer_groups: - name: EVPN-OVERLAY-PEERS activate: true 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 9f43aa3b84c..0f3091c59ad 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 @@ -347,7 +347,7 @@ | [    domain_identifier](## "router_bgp.address_family_evpn.domain_identifier") | String | | | | | | [    neighbor_default](## "router_bgp.address_family_evpn.neighbor_default") | Dictionary | | | | | | [      encapsulation](## "router_bgp.address_family_evpn.neighbor_default.encapsulation") | String | | | Valid Values:
- vxlan
- mpls
- path-selection | Transport encapsulation for neighbor. | - | [      next_hop_self_source_interface](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_source_interface") | String | | | | Source interface name. | + | [      next_hop_self_source_interface](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_source_interface") | String | | | | Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. | | [      next_hop_self_received_evpn_routes](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes") | Dictionary | | | | | | [        enable](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.enable") | Boolean | | | | | | [        inter_domain](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.inter_domain") | Boolean | | | | | @@ -368,6 +368,7 @@ | [          send](## "router_bgp.address_family_evpn.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 paths. | | [          send_limit](## "router_bgp.address_family_evpn.neighbors.[].additional_paths.send_limit") | Integer | | | Min: 2
Max: 64 | Number of paths to send through bgp updates. For this setting, `send` must be set to `limit` or `ecmp`. | | [        encapsulation](## "router_bgp.address_family_evpn.neighbors.[].encapsulation") | String | | | Valid Values:
- vxlan
- mpls
- path-selection | Transport encapsulation for the neighbor. | + | [        next_hop_self_source_interface](## "router_bgp.address_family_evpn.neighbors.[].next_hop_self_source_interface") | String | | | | Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. | | [    peer_groups](## "router_bgp.address_family_evpn.peer_groups") | List, items: Dictionary | | | | | | [      - name](## "router_bgp.address_family_evpn.peer_groups.[].name") | String | Required, Unique | | | Peer-group name. | | [        activate](## "router_bgp.address_family_evpn.peer_groups.[].activate") | Boolean | | | | | @@ -2239,7 +2240,7 @@ # Transport encapsulation for neighbor. encapsulation: - # Source interface name. + # Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. next_hop_self_source_interface: next_hop_self_received_evpn_routes: enable: @@ -2289,6 +2290,9 @@ # Transport encapsulation for the neighbor. encapsulation: + + # Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. + next_hop_self_source_interface: peer_groups: # Peer-group 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 9e47af631a7..45dac894796 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 @@ -924,8 +924,12 @@ router bgp {{ router_bgp.as }} neighbor {{ neighbor.ip_address }} additional-paths send {{ neighbor.additional_paths.send }} {% endif %} {% endif %} -{% if neighbor.encapsulation is arista.avd.defined %} - neighbor {{ neighbor.ip_address }} encapsulation {{ neighbor.encapsulation }} +{% if neighbor.encapsulation is arista.avd.defined %} +{% set encapsulation_cli = "neighbor " ~ neighbor.ip_address ~ " encapsulation " ~ neighbor.encapsulation %} +{% if neighbor.encapsulation == "mpls" and neighbor.next_hop_self_source_interface is arista.avd.defined %} +{% set encapsulation_cli = encapsulation_cli ~ " next-hop-self source-interface " ~ neighbor.next_hop_self_source_interface %} +{% endif %} + {{ encapsulation_cli }} {% endif %} {% endfor %} {% if router_bgp.address_family_evpn.domain_identifier 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 0fde1a7c9fa..cfdc879525f 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 @@ -13128,7 +13128,8 @@ keys: - path-selection description: Transport encapsulation for neighbor. next_hop_self_source_interface: - description: Source interface name. + description: Source interface name for MPLS encapsulation. Requires + `encapsulation` to be set as `mpls`. type: str next_hop_self_received_evpn_routes: type: dict @@ -13201,6 +13202,10 @@ keys: - mpls - path-selection description: Transport encapsulation for the neighbor. + next_hop_self_source_interface: + type: str + description: Source interface name for MPLS encapsulation. Requires + `encapsulation` to be set as `mpls`. peer_groups: type: list primary_key: name 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 219ed524284..c978278ba50 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 @@ -1259,7 +1259,7 @@ keys: - "path-selection" description: Transport encapsulation for neighbor. next_hop_self_source_interface: - description: Source interface name. + description: Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. type: str next_hop_self_received_evpn_routes: type: dict @@ -1329,6 +1329,9 @@ keys: - "mpls" - "path-selection" description: Transport encapsulation for the neighbor. + next_hop_self_source_interface: + type: str + description: Source interface name for MPLS encapsulation. Requires `encapsulation` to be set as `mpls`. peer_groups: type: list primary_key: name