From e0e579245785c8454101672243cc4e24473367c8 Mon Sep 17 00:00:00 2001 From: Ivan Pepelnjak Date: Mon, 22 Aug 2022 19:10:44 +0200 Subject: [PATCH] Make EVPN VLAN-Aware Bundle Service configurable (implements #344) --- docs/module/evpn.md | 3 +++ netsim/modules/evpn.py | 10 +++++++--- netsim/topology-defaults.yml | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/module/evpn.md b/docs/module/evpn.md index a1b158727..b629a74eb 100644 --- a/docs/module/evpn.md +++ b/docs/module/evpn.md @@ -51,6 +51,7 @@ EVPN module supports three design paradigms: EVPN module supports these default/global/node parameters: * **evpn.session** (global or node parameter): A list of BGP session types on which the EVPN address family is enabled (default: `ibgp`) +* **evpn.vlan_bundle_service** (global or node parameter): Use VLAN bundle service for VLANs within a VRF (default: `False`) * **evpn.start_transit_vni** (system default parameter) -- the first symmetric IRB transit VNI ### VLAN-Based Service Parameters @@ -69,6 +70,8 @@ EVPN configuration module sets the following default EVI/RD/RT values for [VXLAN ### VLAN-Aware Bundle Service +VLAN-Aware Bundle Service is disabled by default and has to be enabled by setting **evpn.vlan_bundle_service** parameter to _True_. Although that parameter is a global/node parameter, it might not be a good idea to use different settings on different nodes. + VLAN-Aware Bundle Service uses VRF configuration (and thus requires [VRF configuration module](vrf.md)). All VLANs belonging to a single VRF are configured as a VLAN bundle. [RD and RT values assigned by VRF module](vrf.md#rd-and-rt-values) are used to configure the VLAN bundle; you can set **evpn.evi** VRF parameter to set the EVPN Instance identifier. The default value of VRF EVPN Instance identifier is the VLAN ID of the first VLAN in that VRF. diff --git a/netsim/modules/evpn.py b/netsim/modules/evpn.py index b4a0589f1..532e96d70 100644 --- a/netsim/modules/evpn.py +++ b/netsim/modules/evpn.py @@ -166,9 +166,13 @@ def node_post_transform(self, node: Box, topology: Box) -> None: for vname in vlan_list: vlan = node.vlans[vname] - if not 'vrf' in vlan: # VLAN-Based Service + # + # VLAN based service is used for VLANs that are not in a VRF or when the EVPN VLAN-Aware Bundle + # Service is disabled (default) + # + if not 'vrf' in vlan or not data.get_from_box(node,'evpn.vlan_bundle_service'): vlan_based_service(vlan,vname,node,topology) - else: # VLAN-Aware Bundle Service or IRB - vlan_aware_bundle_service(vlan,vname,node,topology) # ... configure VLAN bundle to cope with bridging part of IRB + else: + vlan_aware_bundle_service(vlan,vname,node,topology) vrf_irb_setup(node,topology) diff --git a/netsim/topology-defaults.yml b/netsim/topology-defaults.yml index 23aaee78f..cea11dc10 100644 --- a/netsim/topology-defaults.yml +++ b/netsim/topology-defaults.yml @@ -119,9 +119,10 @@ evpn: # Enables the EVPN address family towards BGP peers transform_after: [ vlan, vxlan, vrf ] session: [ ibgp ] start_transit_vni: 200000 + vlan_bundle_service: False attributes: - global: [ use_ibgp, session, start_transit_vni ] - node: [ use_ibgp, session ] + global: [ use_ibgp, session, start_transit_vni, vlan_bundle_service ] + node: [ use_ibgp, session, vlan_bundle_service ] vlans: [ evpn.evi ] vrf: # Basic VRF support