netlab icon indicating copy to clipboard operation
netlab copied to clipboard

[BUG] Inconsistent resolution of EVPN AS

Open jbemmel opened this issue 1 year ago • 2 comments

Describe the bug

When playing around with https://bgplabs.net/challenge/40-mpls-core/ and trying to add EVPN VXLAN, I get a warning:

[ERRORS]  Errors found in evpn-topology.yml
[VALUE]   evpn: Cannot get a usable global AS number to use in EVPN route targets
[HINT]    You could use 'bgp.as' parameter to specify the global AS. Otherwise, specify the global AS used by
          EVPN in 'vrf.as' parameter if you use VRFs, or in 'evpn.as' parameter if you use EVPN in bridging-
          only scenarios.

In spite of the fact that the PE node group has bgp.as: 65000

I can add evpn.as: 65001 to remove the warning, but the PEs get configured with AS 65000, not 65001 as intended

To Reproduce

Modify the BGP Free MPLS core example to add evpn:

groups:
  external:
    members: [ e1, e2 ]
    module: [ bgp ]
  pe:
    members: [ pe1, pe2 ]
    module: [ bgp, ospf, vlan, evpn, vxlan ]
    bgp.as: 65000
  p:
    members: [ core ]
    module: [ ospf ]

Expected behavior

I would expect AS 65000 to be used for the overlay, configured only on PE1 and PE2. It's somewhat nit picking and there are other ways to solve the issue, just wanted to flag for discussion

Lab topology

# Configure a BGP route server
---
defaults.sources.extra: [ ../../defaults.yml ]
plugin: [ fix_frr ]
name: mplscore

groups:
  external:
    members: [ e1, e2 ]
    module: [ bgp ]
  pe:
    members: [ pe1, pe2 ]
    module: [ bgp, ospf, vlan, evpn, vxlan ]
    bgp.as: 65000
  p:
    members: [ core ]
    module: [ ospf ]

nodes:
  pe1:
  pe2:
  core:
  e1:
    id: 11
    bgp.as: 65101
    loopback.ipv4: 192.168.101.1/24
  e2:
    id: 12
    bgp.as: 65102
    loopback.ipv4: 192.168.102.1/24

vlans:
  evpn-vxlan:

# evpn.as: 65001  # This removes the error message, but does not get used

links:
  - e1:
    pe1:
      vlan.access: evpn-vxlan
  - pe1-core
  - core-pe2
  - pe2:
      vlan.access: evpn-vxlan
    e2:

Output

jeroen@jvb-vm:~/srlinux/bgplab/challenge/40-mpls-core$ netlab create evpn-topology.yml 
[ERRORS]  Errors found in evpn-topology.yml
[VALUE]   evpn: Cannot get a usable global AS number to use in EVPN route targets
[HINT]    You could use 'bgp.as' parameter to specify the global AS. Otherwise, specify the global AS used by
          EVPN in 'vrf.as' parameter if you use VRFs, or in 'evpn.as' parameter if you use EVPN in bridging-
          only scenarios.
[FATAL]   Cannot proceed beyond this point due to errors, exiting

Version

netlab version 1.8.0-post2

jbemmel avatar Apr 04 '24 16:04 jbemmel

What's bothering me here, is that it says it "cannot get a usable global AS number", but then ends up not using the one I specify.

It's 'works as designed' but still annoying ;)

jbemmel avatar Apr 04 '24 17:04 jbemmel

The way I read the error message, it's saying "I don't have a usable AS number to use in EVPN route targets" ;)

Due to the various creative ways people want to deploy EVPN, I decided not to rely on auto RT/RD, but to specify a consistent value on all devices in a lab. That consistent value has to be global, ergo a need for a global AS that can be specified in BGP, VRF, or EVPN parameter.

That AS is used solely to generate EVPN RT/RD values, not in BGP configuration, so of course you'd get BGP AS 65000 and EVPN RT 65001:1.

If you find a better way of explaining what's going on in that error message, please let me know.

ipspace avatar Apr 04 '24 17:04 ipspace