Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add EVPN DCI Gateway Support (#1391)
Browse files Browse the repository at this point in the history
Co-authored-by: ClausHolbechArista <48674677+ClausHolbechArista@users.noreply.github.com>
  • Loading branch information
emilarista and ClausHolbechArista authored Dec 16, 2021
1 parent 6b1af0a commit dd1d46d
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,21 @@ interface Management1
| ----- | ------ | --------- |
| Enabled | 10 | 1 |

#### EVPN DCI Gateway Summary

| Settings | Value |
| -------- | ----- |
| Remote Domain Peer Groups | EVPN-OVERLAY-PEERS |
| L3 Gateway Configured | True |
| L3 Gateway Inter-domain | True |

### Router BGP VLAN Aware Bundles

| VLAN Aware Bundle | Route-Distinguisher | Both Route-Target | Import Route Target | Export Route-Target | Redistribute | VLANs |
| ----------------- | ------------------- | ----------------- | ------------------- | ------------------- | ------------ | ----- |
| B-ELAN-201 | 192.168.255.3:20201 | 20201:20201 | - | - | learned | 201 |
| TENANT_A_PROJECT01 | 192.168.255.3:11 | 11:11 | - | - | learned<br>igmp | 110 |
| TENANT_A_PROJECT02 | 192.168.255.3:12 | 12:12 | - | - | learned | 112 |
| TENANT_A_PROJECT01 | 192.168.255.3:11 | 11:11<br>remote 2:11 | - | - | learned<br>igmp | 110 |
| TENANT_A_PROJECT02 | 192.168.255.3:12 | 12:12 | remote 2:12 | remote 2:12 | learned | 112 |

### Router BGP VRFs

Expand Down Expand Up @@ -200,22 +208,28 @@ router bgp 65101
vlan-aware-bundle TENANT_A_PROJECT01
rd 192.168.255.3:11
route-target both 11:11
route-target import export evpn domain remote 2:11
redistribute igmp
redistribute learned
vlan 110
!
vlan-aware-bundle TENANT_A_PROJECT02
rd 192.168.255.3:12
rd evpn domain remote 192.168.255.3:12
route-target both 12:12
route-target import evpn domain remote 2:12
route-target export evpn domain remote 2:12
redistribute learned
vlan 112
!
address-family evpn
host-flap detection window 10
host-flap detection threshold 1
domain identifier 3906060
domain identifier 65101:0
neighbor EVPN-OVERLAY-PEERS activate
neighbor EVPN-OVERLAY-PEERS domain remote
no neighbor MLAG-IPv4-UNDERLAY-PEER activate
neighbor default next-hop-self received-evpn-routes route-type ip-prefix inter-domain
!
address-family ipv4
no neighbor EVPN-OVERLAY-PEERS activate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,28 @@ router bgp 65101
vlan-aware-bundle TENANT_A_PROJECT01
rd 192.168.255.3:11
route-target both 11:11
route-target import export evpn domain remote 2:11
redistribute igmp
redistribute learned
vlan 110
!
vlan-aware-bundle TENANT_A_PROJECT02
rd 192.168.255.3:12
rd evpn domain remote 192.168.255.3:12
route-target both 12:12
route-target import evpn domain remote 2:12
route-target export evpn domain remote 2:12
redistribute learned
vlan 112
!
address-family evpn
host-flap detection window 10
host-flap detection threshold 1
domain identifier 3906060
domain identifier 65101:0
neighbor EVPN-OVERLAY-PEERS activate
neighbor EVPN-OVERLAY-PEERS domain remote
no neighbor MLAG-IPv4-UNDERLAY-PEER activate
neighbor default next-hop-self received-evpn-routes route-type ip-prefix inter-domain
!
address-family ipv4
no neighbor EVPN-OVERLAY-PEERS activate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ router_bgp:
peer_group: EVPN-OVERLAY-PEERS
redistribute_routes:
address_family_evpn:
domain_identifier: 65101:0
neighbor_default:
next_hop_self_received_evpn_routes:
enable: true
inter_domain: true
domain_identifier: "65101:0"
peer_groups:
EVPN-OVERLAY-PEERS:
activate: true
domain_remote: true
MLAG-IPv4-UNDERLAY-PEER:
activate: false
evpn_hostflap_detection:
Expand All @@ -54,15 +59,27 @@ router_bgp:
route_targets:
both:
- "11:11"
import_export_evpn_domains:
- domain: remote
route_target: "2:11"
redistribute_routes:
- learned
- igmp
vlan: 110
TENANT_A_PROJECT02:
rd: "192.168.255.3:12"
rd_evpn_domain:
domain: remote
rd: "192.168.255.3:12"
route_targets:
both:
- "12:12"
import_evpn_domains:
- domain: remote
route_target: "2:12"
export_evpn_domains:
- domain: remote
route_target: "2:12"
redistribute_routes:
- learned
vlan: 112
Expand Down
40 changes: 40 additions & 0 deletions ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,9 @@ router_bgp:
vlan_aware_bundles:
< vlan_aware_bundle_name_1 >:
rd: "< route distinguisher >"
rd_evpn_domain:
domain: < all | remote >
rd: "< route distinguisher >"
route_targets:
both:
- "< route_target >"
Expand All @@ -2295,6 +2298,15 @@ router_bgp:
export:
- "< route_target >"
- "< route_target >"
import_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
export_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
import_export_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
redistribute_routes:
- < learned >
vlan: < vlan_range >
Expand All @@ -2309,16 +2321,40 @@ router_bgp:
export:
- "< route_target >"
- "< route_target >"
import_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
export_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
redistribute_routes:
- < connected >
- < learned >
vlan: < vlan_range >
vlans:
< vlan_id_1>:
rd: "< route distinguisher >"
rd_evpn_domain:
domain: < all | remote >
rd: "< route distinguisher >"
route_targets:
both:
- "< route_target >"
import:
- "< route_target >"
- "< route_target >"
export:
- "< route_target >"
- "< route_target >"
import_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
export_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
import_export_evpn_domains:
- domain: < all | remote >
route_target: "< route_target >"
redistribute_routes:
- < connected >
- < learned >
Expand Down Expand Up @@ -2348,11 +2384,15 @@ router_bgp:
neighbor_default:
encapsulation: < vxlan | mpls >
next_hop_self_source_interface: < source interface >
next_hop_self_received_evpn_routes:
enable: < true | false >
inter_domain: < true | false >
peer_groups:
< peer_group_name >:
activate: < true | false >
route_map_in: < route_map_name >
route_map_out: < route_map_name >
domain_remote: < true | false >
evpn_hostflap_detection:
enabled: < true | false >
threshold: < integer >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,35 @@
| {{ evpn_hostflap_detection_state }} | {{ evpn_hostflap_detection_window }} | {{ evpn_hostflap_detection_threshold }} |
{% endif %}
{% endif %}
{% set evpn_gw_config = namespace(peer_groups = [], configured = false) %}
{% for peer_group in router_bgp.peer_groups | arista.avd.natural_sort %}
{% if router_bgp.address_family_evpn.peer_groups[peer_group].domain_remote is arista.avd.defined(true) %}
{% do evpn_gw_config.peer_groups.append(peer_group) %}
{% set evpn_gw_config.configured = true %}
{% endif %}
{% endfor %}
{% if router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.enable is arista.avd.defined(true) %}
{% set evpn_gw_config.configured = true %}
{% endif %}
{% if router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.inter_domain is arista.avd.defined(true) %}
{% set evpn_gw_config.configured = true %}
{% endif %}
{% if evpn_gw_config.configured is arista.avd.defined(true) %}

#### EVPN DCI Gateway Summary

| Settings | Value |
| -------- | ----- |
{% if evpn_gw_config.peer_groups | length > 0 %}
| Remote Domain Peer Groups | {{ evpn_gw_config.peer_groups | join(", ") }} |
{% endif %}
{% if router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.enable is arista.avd.defined(true) %}
| L3 Gateway Configured | True |
{% endif %}
{% if router_bgp.address_family_evpn.neighbor_default.next_hop_self_received_evpn_routes.inter_domain is arista.avd.defined(true) %}
| L3 Gateway Inter-domain | True |
{% endif %}
{% endif %}
{% if router_bgp.vlan_aware_bundles is arista.avd.defined %}

### Router BGP VLAN Aware Bundles
Expand All @@ -234,11 +263,26 @@
{% for vlan_aware_bundle in router_bgp.vlan_aware_bundles | arista.avd.natural_sort %}
{% set route_distinguisher = router_bgp.vlan_aware_bundles[vlan_aware_bundle].rd | arista.avd.default("-") %}
{% set vlans = router_bgp.vlan_aware_bundles[vlan_aware_bundle].vlan | arista.avd.default("-") %}
{% set both_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.both | arista.avd.default("-") %}
{% set import_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import | arista.avd.default("-") %}
{% set export_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.export | arista.avd.default("-") %}
{% if router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.both is arista.avd.defined or router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import_export_evpn_domains is arista.avd.defined %}
{% set both_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.both | arista.avd.default([]) %}
{% for rt in router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import_export_evpn_domains | arista.avd.natural_sort %}
{% do both_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% if router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import is arista.avd.defined or router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import_evpn_domains is arista.avd.defined %}
{% set import_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import | arista.avd.default([]) %}
{% for rt in router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.import_evpn_domains | arista.avd.natural_sort %}
{% do import_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% if router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.export is arista.avd.defined or router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.export_evpn_domains is arista.avd.defined %}
{% set export_route_target = router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.export | arista.avd.default([]) %}
{% for rt in router_bgp.vlan_aware_bundles[vlan_aware_bundle].route_targets.export_evpn_domains | arista.avd.natural_sort %}
{% do export_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% set redistribute_route = router_bgp.vlan_aware_bundles[vlan_aware_bundle].redistribute_routes | arista.avd.default("-") %}
| {{ vlan_aware_bundle }} | {{ route_distinguisher }} | {{ both_route_target | join("<br>") }} | {{ import_route_target | join("<br>") }} | {{ export_route_target | join("<br>") }} | {{ redistribute_route | join("<br>") }} | {{ vlans }} |
| {{ vlan_aware_bundle }} | {{ route_distinguisher }} | {{ both_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ import_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ export_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ redistribute_route | join("<br>") }} | {{ vlans }} |
{% endfor %}
{% endif %}
{% if router_bgp.vlans is arista.avd.defined %}
Expand All @@ -248,12 +292,27 @@
| VLAN | Route-Distinguisher | Both Route-Target | Import Route Target | Export Route-Target | Redistribute |
| ---- | ------------------- | ----------------- | ------------------- | ------------------- | ------------ |
{% for vlan in router_bgp.vlans | arista.avd.natural_sort %}
{% set route_distinguisher = router_bgp.vlans[vlan].rd | arista.avd.default("-") %}
{% set both_route_target = router_bgp.vlans[vlan].route_targets.both | arista.avd.default("-") %}
{% set import_route_target = router_bgp.vlans[vlan].route_targets.import | arista.avd.default("-") %}
{% set export_route_target = router_bgp.vlans[vlan].route_targets.export | arista.avd.default("-") %}
{% set route_distinguisher = router_bgp.vlans[vlan].rd | arista.avd.default("-") %}
{% if router_bgp.vlans[vlan].route_targets.both is arista.avd.defined or router_bgp.vlans[vlan].route_targets.import_export_evpn_domains is arista.avd.defined %}
{% set both_route_target = router_bgp.vlans[vlan].route_targets.both | arista.avd.default([]) %}
{% for rt in router_bgp.vlans[vlan].route_targets.import_export_evpn_domains | arista.avd.natural_sort %}
{% do both_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% if router_bgp.vlans[vlan].route_targets.import is arista.avd.defined or router_bgp.vlans[vlan].route_targets.import_evpn_domains is arista.avd.defined %}
{% set import_route_target = router_bgp.vlans[vlan].route_targets.import | arista.avd.default([]) %}
{% for rt in router_bgp.vlans[vlan].route_targets.import_evpn_domains | arista.avd.natural_sort %}
{% do import_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% if router_bgp.vlans[vlan].route_targets.export is arista.avd.defined or router_bgp.vlans[vlan].route_targets.export_evpn_domains is arista.avd.defined %}
{% set export_route_target = router_bgp.vlans[vlan].route_targets.export | arista.avd.default([]) %}
{% for rt in router_bgp.vlans[vlan].route_targets.export_evpn_domains | arista.avd.natural_sort %}
{% do export_route_target.append(rt.domain ~ " " ~ rt.route_target) %}
{% endfor %}
{% endif %}
{% set redistribute = router_bgp.vlans[vlan].redistribute_routes | arista.avd.default("-") %}
| {{ vlan }} | {{ route_distinguisher }} | {{ both_route_target | join("<br>") }} | {{ import_route_target | join("<br>") }} | {{ export_route_target | join("<br>") }} | {{ redistribute | join("<br>") }} |
| {{ vlan }} | {{ route_distinguisher }} | {{ both_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ import_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ export_route_target | arista.avd.default(["-"]) | join("<br>") }} | {{ redistribute | join("<br>") }} |
{% endfor %}
{% endif %}
{% if router_bgp.vpws is arista.avd.defined %}
Expand Down
Loading

0 comments on commit dd1d46d

Please sign in to comment.