Skip to content

Commit

Permalink
Feat(eos_designs): Allow 'evpn_vlan_bundle' to be set up at tenant le…
Browse files Browse the repository at this point in the history
…vel (#4093)
  • Loading branch information
laxmikantchintakindi authored Jun 17, 2024
1 parent 36224dc commit 216934f
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ vlan 90
vlan 100
name vlan100
!
vlan 110
name research1
!
vlan 120
name research2
!
vlan 1008
name SVI_1
!
Expand All @@ -59,8 +65,16 @@ vlan 1014
vlan 1015
name SVI_8
!
vlan 1016
name SVI_9
!
vlan 1017
name SVI_10
!
vrf instance MGMT
!
vrf instance research1
!
vrf instance SIT2
!
vrf instance SIT3
Expand Down Expand Up @@ -117,6 +131,16 @@ interface Vlan1015
no shutdown
vrf SIT3
!
interface Vlan1016
description SVI_9
no shutdown
vrf research1
!
interface Vlan1017
description SVI_10
no shutdown
vrf research1
!
interface Vxlan1
description evpn_vlan_bundle_VTEP
vxlan source-interface Loopback1
Expand All @@ -129,6 +153,8 @@ interface Vxlan1
vxlan vlan 80 vni 10080
vxlan vlan 90 vni 20090
vxlan vlan 100 vni 20100
vxlan vlan 110 vni 10110
vxlan vlan 120 vni 10120
vxlan vlan 1008 vni 21008
vxlan vlan 1009 vni 21009
vxlan vlan 1010 vni 21010
Expand All @@ -137,12 +163,16 @@ interface Vxlan1
vxlan vlan 1013 vni 21013
vxlan vlan 1014 vni 21014
vxlan vlan 1015 vni 21015
vxlan vlan 1016 vni 11016
vxlan vlan 1017 vni 11017
vxlan vrf research1 vni 654556
vxlan vrf SIT2 vni 654789
vxlan vrf SIT3 vni 654555
vxlan vrf SIT_VRF vni 789654
!
ip routing
no ip routing vrf MGMT
ip routing vrf research1
ip routing vrf SIT2
ip routing vrf SIT3
ip routing vrf SIT_VRF
Expand Down Expand Up @@ -200,6 +230,18 @@ router bgp 65101
redistribute learned
vlan 1014-1015
!
vlan-aware-bundle bundle5
rd 1.1.1.1:555
route-target both 405:555
redistribute learned
vlan 120,1017
!
vlan-aware-bundle bundle6
rd 1.1.1.1:666
route-target both 406:666
redistribute learned
vlan 110,1016
!
vlan-aware-bundle SIT2
rd 10.10.0.3:655089
route-target both 655089:655089
Expand All @@ -225,6 +267,13 @@ router bgp 65101
no neighbor EVPN-OVERLAY-PEERS activate
neighbor IPv4-UNDERLAY-PEERS activate
!
vrf research1
rd 10.10.0.3:654556
route-target import evpn 654556:654556
route-target export evpn 654556:654556
router-id 10.10.0.3
redistribute connected
!
vrf SIT2
rd 10.10.0.3:654789
route-target import evpn 654789:654789
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ router_bgp:
- name: EVPN-OVERLAY-PEERS
activate: true
vrfs:
- name: research1
router_id: 10.10.0.3
rd: 10.10.0.3:654556
route_targets:
import:
- address_family: evpn
route_targets:
- 654556:654556
export:
- address_family: evpn
route_targets:
- 654556:654556
redistribute_routes:
- source_protocol: connected
- name: SIT2
router_id: 10.10.0.3
rd: 10.10.0.3:654789
Expand Down Expand Up @@ -99,6 +113,22 @@ router_bgp:
redistribute_routes:
- learned
vlan: 70,80
- name: bundle5
rd: 1.1.1.1:555
route_targets:
both:
- 405:555
redistribute_routes:
- learned
vlan: 120,1017
- name: bundle6
rd: 1.1.1.1:666
route_targets:
both:
- 406:666
redistribute_routes:
- learned
vlan: 110,1016
- name: SIT2
rd: 10.10.0.3:655089
route_targets:
Expand Down Expand Up @@ -150,6 +180,9 @@ vlan_internal_order:
vrfs:
- name: MGMT
ip_routing: false
- name: research1
tenant: research
ip_routing: true
- name: SIT2
tenant: SIT
ip_routing: true
Expand Down Expand Up @@ -204,6 +237,18 @@ vlans:
- id: 80
name: vstorage
tenant: FABRIC
- id: 1016
name: SVI_9
tenant: research
- id: 1017
name: SVI_10
tenant: research
- id: 110
name: research1
tenant: research
- id: 120
name: research2
tenant: research
- id: 1011
name: SVI_4
tenant: SIT
Expand Down Expand Up @@ -243,6 +288,20 @@ vlans:
ip_igmp_snooping:
globally_enabled: true
vlan_interfaces:
- name: Vlan1016
tenant: research
tags:
- research
description: SVI_9
shutdown: false
vrf: research1
- name: Vlan1017
tenant: research
tags:
- research
description: SVI_10
shutdown: false
vrf: research1
- name: Vlan1011
tenant: SIT
tags:
Expand Down Expand Up @@ -314,6 +373,14 @@ vxlan_interface:
vni: 10070
- id: 80
vni: 10080
- id: 1016
vni: 11016
- id: 1017
vni: 11017
- id: 110
vni: 10110
- id: 120
vni: 10120
- id: 1011
vni: 21011
- id: 1012
Expand All @@ -339,6 +406,8 @@ vxlan_interface:
- id: 20
vni: 10020
vrfs:
- name: research1
vni: 654556
- name: SIT2
vni: 654789
- name: SIT3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ l3leaf:
id: 3
bgp_as: 65101
filter:
tags: [fabric, ipmi, storageProd, sit]
tags: [fabric, ipmi, storageProd, sit, research]

tenants:
- name: StorageProd
Expand Down Expand Up @@ -109,6 +109,33 @@ tenants:
enabled: true
evpn_vlan_bundle: bundle4
tags: ['sit']
# Test evpn_vlan_bundle setting on tenant level.
- name: research
vlan_aware_bundle_number_base: 400
mac_vrf_vni_base: 10000
evpn_vlan_bundle: bundle5
l2vlans:
- id: 110
name: research1
tags: ['research']
# Test override evpn_vlan_bundle setting under tenant.
evpn_vlan_bundle: bundle6
- id: 120
name: research2
tags: ['research']
vrfs:
- name: research1
vrf_vni: 654556
svis:
- id: 1016
name: SVI_9
enabled: true
tags: ['research']
evpn_vlan_bundle: bundle6
- id: 1017
name: SVI_10
enabled: true
tags: ['research']

evpn_vlan_bundles:
- name: bundle1
Expand All @@ -128,3 +155,11 @@ evpn_vlan_bundles:
id: 4
rt_override: 444
rd_override: 1.1.1.1:444
- name: bundle5
id: 5
rt_override: 555
rd_override: 1.1.1.1:555
- name: bundle6
id: 6
rt_override: 666
rd_override: 1.1.1.1:666
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def filtered_l2vlans(self: SharedUtils, tenant: dict) -> list[dict]:
return []

l2vlans: list[dict] = natural_sort(convert_dicts(tenant["l2vlans"], "id"), "id")

if tenant_evpn_vlan_bundle := get(tenant, "evpn_vlan_bundle"):
for l2vlan in l2vlans:
l2vlan["evpn_vlan_bundle"] = get(l2vlan, "evpn_vlan_bundle", default=tenant_evpn_vlan_bundle)

l2vlans = [
# Copy and set tenant key on all l2vlans
{**l2vlan, "tenant": tenant["name"]}
Expand Down Expand Up @@ -267,6 +272,10 @@ def filtered_vrfs(self: SharedUtils, tenant: dict) -> list[dict]:
if vrf["svis"] or vrf["l3_interfaces"] or vrf["loopbacks"] or self.is_forced_vrf(vrf):
filtered_vrfs.append(vrf)

if tenant_evpn_vlan_bundle := get(tenant, "evpn_vlan_bundle"):
for svi in vrf["svis"]:
svi["evpn_vlan_bundle"] = get(svi, "evpn_vlan_bundle", default=tenant_evpn_vlan_bundle)

return filtered_vrfs

@cached_property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "<network_services_keys.name>.[].l2vlans.[].tags.[]") | String | | `all` | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vxlan</samp>](## "<network_services_keys.name>.[].l2vlans.[].vxlan") | Boolean | | `True` | | Extend this L2VLAN over VXLAN. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;spanning_tree_priority</samp>](## "<network_services_keys.name>.[].l2vlans.[].spanning_tree_priority") | Integer | | | | Setting spanning-tree priority per VLAN is only supported with `spanning_tree_mode: rapid-pvst` under node type settings.<br>The default priority for rapid-PVST is set under the node type settings with `spanning_tree_priority` (default=32768). |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evpn_vlan_bundle</samp>](## "<network_services_keys.name>.[].l2vlans.[].evpn_vlan_bundle") | String | | | | Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.<br>The common option "evpn_vlan_aware_bundles" is disregarded for this option.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evpn_vlan_bundle</samp>](## "<network_services_keys.name>.[].l2vlans.[].evpn_vlan_bundle") | String | | | | Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.<br>This setting overrides "evpn_vlan_bundle" set at tenant level.<br>The common option "evpn_vlan_aware_bundles" is disregarded for this option.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trunk_groups</samp>](## "<network_services_keys.name>.[].l2vlans.[].trunk_groups") | List, items: String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "<network_services_keys.name>.[].l2vlans.[].trunk_groups.[]") | String | | | | Trunk groups are used for limiting vlans to trunk ports assigned to the same trunk group.<br>Requires enable_trunk_groups: true.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgp</samp>](## "<network_services_keys.name>.[].l2vlans.[].bgp") | Dictionary | | | | |
Expand Down Expand Up @@ -81,6 +81,7 @@
spanning_tree_priority: <int>

# Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.
# This setting overrides "evpn_vlan_bundle" set at tenant level.
# The common option "evpn_vlan_aware_bundles" is disregarded for this option.
evpn_vlan_bundle: <str>
trunk_groups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;profile</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].profile") | String | | | | SVI profile name to apply.<br>SVI can refer to one svi_profile which again can refer to another svi_profile to inherit settings in up to two levels (svi -> svi_profile -> svi_parent_profile).<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tags</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].tags") | List, items: String | | `['all']` | | Tags leveraged for networks services filtering.<br>Tags are matched against "filter.tags" defined under node type settings.<br>Tags are also matched against the "node_group" name under node type settings.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].tags.[]") | String | | | | Tag value. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evpn_vlan_bundle</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].evpn_vlan_bundle") | String | | | | Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.<br>The common option "evpn_vlan_aware_bundles" is disregarded for this option.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evpn_vlan_bundle</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].evpn_vlan_bundle") | String | | | | Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.<br>This setting overrides "evpn_vlan_bundle" set at tenant level.<br>The common option "evpn_vlan_aware_bundles" is disregarded for this option.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nodes</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].nodes") | List, items: Dictionary | | | | Define node specific configuration, such as unique IP addresses.<br>Any keys set here will be merged onto the SVI config, except `structured_config` keys which will replace the `structured_config` set on SVI level.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;node</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].nodes.[].node") | String | Required, Unique | | | l3_leaf inventory hostname. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tags</samp>](## "<network_services_keys.name>.[].vrfs.[].svis.[].nodes.[].tags") | List, items: String | | `['all']` | | Tags leveraged for networks services filtering.<br>Tags are matched against "filter.tags" defined under node type settings.<br>Tags are also matched against the "node_group" name under node type settings.<br> |
Expand Down Expand Up @@ -136,6 +136,7 @@
- <str>

# Name of a bundle defined under 'evpn_vlan_bundles' to inherit configuration.
# This setting overrides "evpn_vlan_bundle" set at tenant level.
# The common option "evpn_vlan_aware_bundles" is disregarded for this option.
evpn_vlan_bundle: <str>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;mac_vrf_vni_base</samp>](## "<network_services_keys.name>.[].mac_vrf_vni_base") | Integer | | | Min: 0<br>Max: 16770000 | Base number for MAC VRF VXLAN Network Identifier (required with VXLAN).<br>VXLAN VNI is derived from the base number with simple addition.<br>i.e. mac_vrf_vni_base = 10000, svi 100 = VNI 10100, svi 300 = VNI 10300.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;mac_vrf_id_base</samp>](## "<network_services_keys.name>.[].mac_vrf_id_base") | Integer | | | Min: 0<br>Max: 16770000 | If not set, "mac_vrf_vni_base" will be used.<br>Base number for MAC VRF RD/RT ID (Required unless mac_vrf_vni_base is set)<br>ID is derived from the base number with simple addition.<br>i.e. mac_vrf_id_base = 10000, svi 100 = RD/RT 10100, svi 300 = RD/RT 10300.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;vlan_aware_bundle_number_base</samp>](## "<network_services_keys.name>.[].vlan_aware_bundle_number_base") | Integer | | `0` | | Base number for VLAN aware bundle RD/RT.<br>The "Assigned Number" part of RD/RT is derived from vrf_vni + vlan_aware_bundle_number_base.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;evpn_vlan_bundle</samp>](## "<network_services_keys.name>.[].evpn_vlan_bundle") | String | | | | Enable `evpn_vlan_bundle` for all l2vlans and SVIs under the tenant. This `evpn_vlan_bundle` should be present in `evpn_vlan_bundles`. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;evpn_l2_multi_domain</samp>](## "<network_services_keys.name>.[].evpn_l2_multi_domain") | Boolean | | `True` | | Explicitly extend all VLANs/VLAN-Aware Bundles inside the tenant to remote EVPN domains. |

=== "YAML"
Expand Down Expand Up @@ -39,6 +40,9 @@
# The "Assigned Number" part of RD/RT is derived from vrf_vni + vlan_aware_bundle_number_base.
vlan_aware_bundle_number_base: <int; default=0>

# Enable `evpn_vlan_bundle` for all l2vlans and SVIs under the tenant. This `evpn_vlan_bundle` should be present in `evpn_vlan_bundles`.
evpn_vlan_bundle: <str>

# Explicitly extend all VLANs/VLAN-Aware Bundles inside the tenant to remote EVPN domains.
evpn_l2_multi_domain: <bool; default=True>
```

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

Loading

0 comments on commit 216934f

Please sign in to comment.