Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_cli_config_gen): Add support for MPLS resolution RIBs #3592

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ interface Management1

#### Router BGP EVPN Address Family

- Next-hop MPLS resolution Primary-RIB : tunnel-rib-colored system-colored-tunnel-rib
- Next-hop MPLS resolution Secondary-RIB : tunnel-rib test-rib
- Next-hop MPLS resolution Tertiary-RIB : system-connected

##### EVPN Peer Groups

| Peer Group | Activate | Encapsulation |
Expand Down Expand Up @@ -125,5 +129,6 @@ router bgp 65101
!
address-family evpn
neighbor default encapsulation mpls next-hop-self source-interface Loopback0
next-hop mpls resolution ribs tunnel-rib-colored system-colored-tunnel-rib tunnel-rib test-rib system-connected
neighbor EVPN-OVERLAY-PEERS activate
```
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ router bgp 65101
!
address-family evpn
neighbor default encapsulation mpls next-hop-self source-interface Loopback0
next-hop mpls resolution ribs tunnel-rib-colored system-colored-tunnel-rib tunnel-rib test-rib system-connected
neighbor EVPN-OVERLAY-PEERS activate
!
end
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ router_bgp:
- ip_address: 192.168.255.2
peer_group: EVPN-OVERLAY-PEERS
address_family_evpn:
next_hop_mpls_resolution_ribs:
chetryan marked this conversation as resolved.
Show resolved Hide resolved
- rib_type: "tunnel-rib-colored"
- rib_type: "tunnel-rib"
rib_name: "test-rib"
- rib_type: "system-connected"
neighbor_default:
encapsulation: mpls
next_hop_self_source_interface: Loopback0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next_hop_self_received_evpn_routes</samp>](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enable</samp>](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.enable") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inter_domain</samp>](## "router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.inter_domain") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;next_hop_mpls_resolution_ribs</samp>](## "router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs") | List, items: Dictionary | | | Min Length: 1<br>Max Length: 3 | Specify the RIBs used to resolve MPLS next-hops. The order of this list determines the order of RIB lookups. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;rib_type</samp>](## "router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs.[].rib_type") | String | Required | | Valid Values:<br>- <code>system-connected</code><br>- <code>tunnel-rib-colored</code><br>- <code>tunnel-rib</code> | Type of RIB. For 'tunnel-rib', use 'rib_name' to specify the name of the Tunnel-RIB to use. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rib_name</samp>](## "router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs.[].rib_name") | String | | | | The name of the tunnel-rib to use when using 'tunnel-rib' type. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;peer_groups</samp>](## "router_bgp.address_family_evpn.peer_groups") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "router_bgp.address_family_evpn.peer_groups.[].name") | String | Required, Unique | | | Peer-group name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;activate</samp>](## "router_bgp.address_family_evpn.peer_groups.[].activate") | Boolean | | | | |
Expand Down Expand Up @@ -1172,6 +1175,15 @@
next_hop_self_received_evpn_routes:
enable: <bool>
inter_domain: <bool>

# Specify the RIBs used to resolve MPLS next-hops. The order of this list determines the order of RIB lookups.
next_hop_mpls_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: <str; "system-connected" | "tunnel-rib-colored" | "tunnel-rib"; required>

# The name of the tunnel-rib to use when using 'tunnel-rib' type.
rib_name: <str>
peer_groups:

# Peer-group name
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,25 @@ keys:
type: bool
inter_domain:
type: bool
next_hop_mpls_resolution_ribs:
type: list
min_length: 1
max_length: 3
description: "Specify the RIBs used to resolve MPLS 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."
peer_groups:
type: list
primary_key: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,20 @@
{% if router_bgp.address_family_evpn.next_hop_unchanged is arista.avd.defined(true) %}
- Next-hop-unchanged is explicitly configured (default behaviour)
{% endif %}
{% if router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs is arista.avd.defined() %}

{% set rib_position = ["Primary", "Secondary", "Tertiary" ] %}
{% for rib in router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs %}
{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %}
{% set evpn_mpls_resolution_rib = "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 %}
{% set evpn_mpls_resolution_rib = "tunnel-rib " ~ rib.rib_name %}
{% elif rib.rib_type is arista.avd.defined %}
{% set evpn_mpls_resolution_rib = rib.rib_type %}
{% endif %}
- Next-hop MPLS resolution {{ rib_position[loop.index0] }}-RIB : {{ evpn_mpls_resolution_rib }}
{% endfor %}
{% endif %}
{% if router_bgp.address_family_evpn.peer_groups is arista.avd.defined %}

##### EVPN Peer Groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,21 @@ router bgp {{ router_bgp.as }}
{% endif %}
{{ evpn_neighbor_default_encap_cli }}
{% endif %}
{% if router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs is arista.avd.defined %}
{% set evpn_mpls_resolution_ribs = [] %}
{% for rib in router_bgp.address_family_evpn.next_hop_mpls_resolution_ribs %}
{% if rib.rib_type is arista.avd.defined("tunnel-rib-colored") %}
{% do evpn_mpls_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 evpn_mpls_resolution_ribs.append("tunnel-rib " ~ rib.rib_name) %}
{% elif rib.rib_type is arista.avd.defined %}
{% do evpn_mpls_resolution_ribs.append(rib.rib_type) %}
{% endif %}
{% endfor %}
{% if evpn_mpls_resolution_ribs %}
next-hop mpls resolution ribs {{ evpn_mpls_resolution_ribs | join(" ") }}
{% endif %}
{% endif %}
{% for peer_group in router_bgp.address_family_evpn.peer_groups | arista.avd.natural_sort('name') %}
{% if peer_group.route_map_in is arista.avd.defined %}
neighbor {{ peer_group.name }} route-map {{ peer_group.route_map_in }} in
Expand Down
Loading