question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arista AVD Bug -MLAG iBGP VLAN ID Allocation Issue - Day One Bug

See original GitHub issue

Issue Summary

The issue appears to be a day one BUG in the VLAN-ID calculation done in the MLAG VLAN jinja template.

Below is the current formula used to derive the iBGP MLAG VLAN in the latest AVD:

  {{ vrf.mlag_ibgp_peering_vlan | arista.avd.default(mlag_ibgp_peering_vrfs.base_vlan + (vrf.vrf_vni - 1)) }}:

From above you are using the Base VLAN = 3000, then add it to the VRF VNI ID (this is customer configurable value and as per rfc a 24bits value), then you subtract 1, meaning if VRF VNI ID is set to 5001 as an example, the allocated VLAN ID for the mlag BGP peering would be 3000 + 5001 -1 =8000, which breaks the maximum supported VLAN number of 4094.

The above formula is wrong and it is bug in AVD.

In the previous AVD version, below is the formula used:

mlag_ibgp_peering_vrfs.base_vlan + vrf_vni

Both formulas constraint users to a maximum value of 1093 to be used for the VRF VNI which should be a 24bits value.

Can this formulas be changed please?

Cheers, jide

Which component(s) of AVD impacted

No response

How do you run AVD ?

No response

Steps to reproduce

set VRF VNI value to any value greater than 1093 in the tenant template file in AVD.

Relevant log output

Leaf config output:

!
vlan 8000
   name MLAG_iBGP_xxx
   trunk group LEAF_PEER_L3
!

Contributing Guide

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
gmuloccommented, Jun 7, 2022

Hello @smeo83,

There was a modification made that should lift this limitation: https://github.com/aristanetworks/ansible-avd/pull/1488 (in AVD 3.3.0) with the introdiction of a vrf_id. Indeed in 2.2.1 you are not able to achieve this.

Basically the formula would now work as described in the doc:

The SVI id will be derived from the base vlan defined: mlag_ibgp_peering_vrfs.base_vlan + (vrf_id or vrf_vni) - 1

Where the vrf_id takes precedence over the vrf_vni for the computation of the VLAN which gives you some freedom to set the vrf_vni you want.

# The VRF VNI range is not limited, but if vrf_id is not set, "vrf_vni" is used for calculating MLAG IBGP peering vlan id.

As an example, if you want vrf_vni = 50000 is the following (using AVD 3.4.0 in my case):


# mlag_ibgp_peering_vrfs.base_vlan is the default 3000

  tenants:
    TENANT_GREEN:
      mac_vrf_vni_base: 1000
      vrfs:
        green:
          vrf_id: 42
          vrf_vni: 50000
          [...]

Renders on a leaf with the VRF:

[...]
# Notice this is 3000 + 42 (vrf_id) -1
vlan 3041
   name MLAG_iBGP_green
   trunk group LEAF_PEER_L3
!
[...]
# Notice the VRF green VNI is 50000 (vrf_vni)
interface Vxlan1
   description DC1-LEAF1A_VTEP
   vxlan source-interface Loopback0
   vxlan virtual-router encapsulation mac-address mlag-system-id
   vxlan udp-port 4789
   vxlan vlan 10 vni 1010
   vxlan vlan 100 vni 1100
   vxlan vrf green vni 50000
   vxlan mlag source-interface Loopback1
!

[...]
router bgp xxx
[...]
# the vrf_id is used in the rts
   vrf green
      rd 192.168.100.1:42
      evpn multicast
      route-target import evpn 42:42
      route-target export evpn 42:42
      router-id 192.168.100.1
      neighbor 10.255.251.1 peer group MLAG-IPv4-UNDERLAY-PEER
      redistribute connected
   !
1reaction
ClausHolbechAristacommented, Jun 7, 2022

Thanks @ClausHolbechArista tested version is 2.2.1. I do note the constrain you put in the network service documentation, but this is limiting the enterprise to using certain value for the vrf_vni to be able to leverage AVD. Is there no way to change this formula to be based on other algorithm instead that would provide better flexibility?

Thank you for the details @smeo83.

To add to the answer from @gmuloc, I don’t think we can write an algorithm that will suite everyone. Instead we chose to document this limitation, and expose a direct per-vrf setting, to allow you to set the vlan id yourself. I Checked v2.2.1, and this knob is also available in that version. Check under the network-services documentation.

tenants:
  <tenant>:
    vrfs:
      <vrf>:
        # Manually define the VLAN used on the MLAG pair for the iBGP session. | Optional
        # By default this parameter is calculated using the following formula: <mlag_ibgp_peering_vrfs.base_vlan> + <vrf_id> - 1
        mlag_ibgp_peering_vlan: <1-4096>

HTH.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EOS 4.29.0F - Multi-Chassis Link Aggregation
When implementing MLAG in a spanning tree network, spanning tree must be configured globally and on port-channels configured with an MLAG ID.
Read more >
Release Notes for Ansible AVD 2.xx
Fix issue with lldp topology tests reporting false error ... Options to change MLAG vlan ids; Support multiple keys support for connected ...
Read more >
Disable STP for MLAG iBGP VLAN 4093 · Issue #358
Issue Type EOS Configuration error Summary We should disable STP for MLAG iBGP VLAN 4093, as it is in a trunk group and...
Read more >
Using Ansible and NetBox to deploy EVPN on Arista - /overlaid
Does my Ansible inventory include all of my Data Center switches or did we add any new ones since I last executed this...
Read more >
Cumulus Linux 4.4 Release Notes
Issue ID Description Affects Fixed 3163845 4.3.1‑4.4.5 2943080 The overlay ASN is removed after a route flap. 4.4.0‑5.0.1 5.1.0‑5.3.1 2913859 4.4.0‑5.0.1 5.1.0‑5.3.1
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found