aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
295 stars 212 forks source link

Feat: Support l2 subinterfaces on eos_designs and on only_vlans_in_use filter #4189

Open pmprado opened 4 months ago

pmprado commented 4 months ago

Enhancement summary

Today we can use L3 subinterfaces to establish multiple IP peerings over the same physical interface. However if a L2 peering is needed, we need to trunk a VLAN and the main interface becomes a L2 port, forcing the L3 subinterfaces to be converted to SVIs. This request is to support L2 subints in eos_designs and in the only_vlans_in_use filter.

Which component of AVD is impacted

eos_designs

Use case example

- name: EQUINIX-123
  adapters:
    - endpoint_ports: [Equinix-123]
      switch_ports: [Ethernet21.123]
      switches: [BORDER-A]
      type: l2dot1q
      encapsulation_dot1q_vlan: 123  # needed only if different from the subint ID
      vlan_id: 123                   # needed only if different from the subint ID
      enabled: true

Describe the solution you would like

Understand L2 subinterface adapters, and configure the main interface as routed automatically with a proper description. Raise an error if there is conflicting information. Update the logic on the only_vlans_in_use filter to consider L2 subinterfaces.

Describe alternatives you have considered

Today this is possible only by using structured configs and tags, but that's not convenient for a network that is leveraging only_vlans_in_use

Additional context

No response

Contributing Guide

ZoeyFahner-Arista commented 4 months ago

I suggest that the Ethernet definition for this match the Port-Channel sub-interfaces model for consistency as well as ensuring we have the ability to set the ESI short-name on the sub-interface(s).

Here is how it's done on a port-channel connected endpoint (AVD 4.9.0):

          subinterfaces:
            - number: <int>
              short_esi: <str>
              vlan_id: <int; 1-4094>
              encapsulation_vlan:
                client_dot1q: <int; 1-4094>

I should also note that this schema still doesn't support all the encapsulation types (client, network, tag manipulation, etc) found in the TOI https://www.arista.com/en/support/toi/eos-4-24-2f/14551-flexible-interface-encapsulation-flexencap but that might be out of scope for this ticket.

github-actions[bot] commented 4 weeks ago

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed