Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_designs,eos_cli_config_gen): Recirculation Channel Interface #4554

Draft
wants to merge 10 commits into
base: devel
Choose a base branch
from
Draft
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# recirculation-interfaces

## Table of Contents

- [Management](#management)
- [Management Interfaces](#management-interfaces)
- [Interfaces](#interfaces)
- [Recirculation Interfaces](#recirculation-interfaces-1)
- [Ethernet Interfaces](#ethernet-interfaces)

## Management

### Management Interfaces

#### Management Interfaces Summary

##### IPv4

| Management Interface | Description | Type | VRF | IP Address | Gateway |
| -------------------- | ----------- | ---- | --- | ---------- | ------- |
| Management1 | OOB_MANAGEMENT | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 |

##### IPv6

| Management Interface | Description | Type | VRF | IPv6 Address | IPv6 Gateway |
| -------------------- | ----------- | ---- | --- | ------------ | ------------ |
| Management1 | OOB_MANAGEMENT | oob | MGMT | - | - |

#### Management Interfaces Device Configuration

```eos
!
interface Management1
description OOB_MANAGEMENT
vrf MGMT
ip address 10.73.255.122/24
```

## Interfaces

### Recirculation Interfaces

#### Recirculation Interfaces Summary

| Interface | Description | Shutdown | Recirculation Features |
| --------- | ----------- | -------- | --------------- |
| Recirc-Channel1 | Test recirculation interface | - | cpu-mirror |
| Recirc-Channel2 | Test recirculation interface with shutdown | True | vxlan |

#### Recirculation Interfaces Device Configuration

```eos
!
interface Recirc-Channel1
description Test recirculation interface
switchport recirculation features cpu-mirror
comment
Comment created from eos_cli under recirculation_interfaces.Recirc-Channel1
EOF

!
interface Recirc-Channel2
description Test recirculation interface with shutdown
shutdown
switchport recirculation features vxlan
```

### Ethernet Interfaces

#### Ethernet Interfaces Summary

##### L2

| Interface | Description | Mode | VLANs | Native VLAN | Trunk Group | Channel-Group |
| --------- | ----------- | ---- | ----- | ----------- | ----------- | ------------- |
| Ethernet1 | Recirculation channel 1 | - | - | - | - | Recirc-Channel1 |
| Ethernet2 | Recirculation channel 2 | - | - | - | - | Recirc-Channel2 |

*Inherited from Port-Channel Interface

#### Ethernet Interfaces Device Configuration

```eos
!
interface Ethernet1
description Recirculation channel 1
channel-group recirculation 1
!
interface Ethernet2
description Recirculation channel 2
channel-group recirculation 2
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
interface Recirc-Channel1
description Test recirculation interface
switchport recirculation features cpu-mirror
comment
Comment created from eos_cli under recirculation_interfaces.Recirc-Channel1
EOF

!
interface Recirc-Channel2
description Test recirculation interface with shutdown
shutdown
switchport recirculation features vxlan
!
interface Ethernet1
description Recirculation channel 1
channel-group recirculation 1
!
interface Ethernet2
description Recirculation channel 2
channel-group recirculation 2
!
interface Management1
description OOB_MANAGEMENT
vrf MGMT
ip address 10.73.255.122/24
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ ethernet_interfaces:
channel_group:
id: 112
mode: active
recirculation: false
switchport:
enabled: true
mode: trunk
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
### Recirculation Interfaces ###
recirculation_interfaces:
- name: Recirc-Channel1
description: Test recirculation interface
recirculation_features: cpu-mirror
eos_cli: |
comment
Comment created from eos_cli under recirculation_interfaces.Recirc-Channel1
EOF

- name: Recirc-Channel2
description: Test recirculation interface with shutdown
shutdown: true
recirculation_features: vxlan

# Ethernet interface used for recirculation
ethernet_interfaces:
- name: Ethernet1
description: Recirculation channel 1
channel_group:
id: 1
recirculation: true

- name: Ethernet2
description: Recirculation channel 2
channel_group:
id: 2
recirculation: true
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ queue-monitor-length-notifying
queue-monitor-streaming
radius-server
radius-server-2
recirculation-interfaces
redundancy
roles
route-maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ roles/eos_cli_config_gen/docs/tables/traffic-policies.md

## Interfaces

### Recirculation interfaces

--8<--
roles/eos_cli_config_gen/docs/tables/recirculation-interfaces.md
--8<--

### DPS interfaces

--8<--
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,86 @@
| --------- | ----------- | ---- | ----- | ----------- | ----------- | ------------- |
{% for ethernet_interface in ethernet_interfaces | arista.avd.natural_sort('name') %}
{% if ethernet_interface.channel_group.id is arista.avd.defined %}
{% set port_channel_interface_name = 'Port-Channel' ~ ethernet_interface.channel_group.id %}
{% set port_channel_interface = port_channel_interfaces | arista.avd.default([]) |
selectattr('name', 'arista.avd.defined', port_channel_interface_name) |
first %}
{# Below if condition is added to keep the existing support for rendering switchport attributes on the basis of port_channel_interface.type == switched #}
{# TODO: AVD6.0 this if condition should be removed once the port_channel_interface.type key is removed in AVD6.0 #}
{% if (port_channel_interface.switchport.mode is arista.avd.defined or
port_channel_interface.switchport.access_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.native_vlan_tag is arista.avd.defined(true) or
port_channel_interface.switchport.trunk.native_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.groups is arista.avd.defined or
port_channel_interface.switchport.enabled is arista.avd.defined(true)) and
(port_channel_interface.type is not arista.avd.defined or (port_channel_interface.type is arista.avd.defined and port_channel_interface.type not in ["switched", "routed"])) %}
{% if ethernet_interface.channel_group.recirculation is arista.avd.defined(true) %}
{% set channel_group = 'Recirc-Channel' ~ ethernet_interface.channel_group.id %}
{% set description = ethernet_interface.description | arista.avd.default("-") %}
{% set mode = port_channel_interface.switchport.mode | arista.avd.default('-') %}
{% if port_channel_interface.switchport.access_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% set mode = ethernet_interface.switchport.mode | arista.avd.default('-') %}
{% if ethernet_interface.switchport.access_vlan is arista.avd.defined or
ethernet_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% set switchport_vlans = [] %}
{% if port_channel_interface.switchport.access_vlan is arista.avd.defined %}
{% do switchport_vlans.append(port_channel_interface.switchport.access_vlan) %}
{% if ethernet_interface.switchport.access_vlan is arista.avd.defined %}
{% do switchport_vlans.append(ethernet_interface.switchport.access_vlan) %}
{% endif %}
{% if port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% do switchport_vlans.extend(port_channel_interface.switchport.trunk.allowed_vlan | arista.avd.range_expand | map('int')) %}
{% if ethernet_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% do switchport_vlans.extend(ethernet_interface.switchport.trunk.allowed_vlan | arista.avd.range_expand | map('int')) %}
{% endif %}
{% if switchport_vlans %}
{% set switchport_vlans = switchport_vlans | arista.avd.list_compress %}
{% else %}
{% set switchport_vlans = port_channel_interface.switchport.trunk.allowed_vlan %}
{% elif ethernet_interface.switchport.trunk.allowed_vlan is arista.avd.defined("none") %}
{% set switchport_vlans = ethernet_interface.switchport.trunk.allowed_vlan %}
{% endif %}
{% endif %}
{% if port_channel_interface.switchport.trunk.native_vlan_tag is arista.avd.defined(true) %}
{% if ethernet_interface.switchport.trunk.native_vlan_tag is arista.avd.defined(true) %}
{% set native_vlan = "tag" %}
{% else %}
{% set native_vlan = port_channel_interface.switchport.trunk.native_vlan | arista.avd.default('-') %}
{% set native_vlan = ethernet_interface.switchport.trunk.native_vlan | arista.avd.default('-') %}
{% endif %}
{% set channel_group = ethernet_interface.channel_group.id %}
{% set trunk_groups = port_channel_interface.switchport.trunk.groups | arista.avd.default(['-']) | join(', ') %}
{% set trunk_groups = ethernet_interface.switchport.trunk.groups | arista.avd.default(['-']) | join(', ') %}
| {{ ethernet_interface.name }} | {{ description }} | {{ mode }} | {{ switchport_vlans | arista.avd.default('-') }} | {{ native_vlan }} | {{ trunk_groups }} | {{ channel_group }} |
{% else %}
{% set port_channel_interface_name = 'Port-Channel' ~ ethernet_interface.channel_group.id %}
{% set port_channel_interface = port_channel_interfaces | arista.avd.default([]) |
selectattr('name', 'arista.avd.defined', port_channel_interface_name) |
first %}
{# Below if condition is added to keep the existing support for rendering switchport attributes on the basis of port_channel_interface.type == switched #}
{# TODO: AVD6.0 this if condition should be removed once the port_channel_interface.type key is removed in AVD6.0 #}
{% if (port_channel_interface.switchport.mode is arista.avd.defined or
port_channel_interface.switchport.access_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.native_vlan_tag is arista.avd.defined(true) or
port_channel_interface.switchport.trunk.native_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.groups is arista.avd.defined or
port_channel_interface.switchport.enabled is arista.avd.defined(true)) and
(port_channel_interface.type is not arista.avd.defined or (port_channel_interface.type is arista.avd.defined and port_channel_interface.type not in ["switched", "routed"])) %}
{% set description = ethernet_interface.description | arista.avd.default("-") %}
{% set mode = port_channel_interface.switchport.mode | arista.avd.default('-') %}
{% if port_channel_interface.switchport.access_vlan is arista.avd.defined or
port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% set switchport_vlans = [] %}
{% if port_channel_interface.switchport.access_vlan is arista.avd.defined %}
{% do switchport_vlans.append(port_channel_interface.switchport.access_vlan) %}
{% endif %}
{% if port_channel_interface.switchport.trunk.allowed_vlan is arista.avd.defined %}
{% do switchport_vlans.extend(port_channel_interface.switchport.trunk.allowed_vlan | arista.avd.range_expand | map('int')) %}
{% endif %}
{% if switchport_vlans %}
{% set switchport_vlans = switchport_vlans | arista.avd.list_compress %}
{% else %}
{% set switchport_vlans = port_channel_interface.switchport.trunk.allowed_vlan %}
{% endif %}
{% endif %}
{% if port_channel_interface.switchport.trunk.native_vlan_tag is arista.avd.defined(true) %}
{% set native_vlan = "tag" %}
{% else %}
{% set native_vlan = port_channel_interface.switchport.trunk.native_vlan | arista.avd.default('-') %}
{% endif %}
{% set channel_group = ethernet_interface.channel_group.id %}
{% set trunk_groups = port_channel_interface.switchport.trunk.groups | arista.avd.default(['-']) | join(', ') %}
| {{ ethernet_interface.name }} | {{ description }} | *{{ mode }} | *{{ switchport_vlans | arista.avd.default('-') }} | *{{ native_vlan }} | *{{ trunk_groups }} | {{ channel_group }} |
{# TODO: AVD6.0 Below elif block should be removed once the deprecated keys are removed in AVD6.0 #}
{% elif port_channel_interface.type is arista.avd.defined('switched') %}
{% set description = ethernet_interface.description | arista.avd.default("-") %}
{% set mode = port_channel_interface.mode | arista.avd.default('-') %}
{% set switchport_vlans = port_channel_interface.vlans | arista.avd.default('-') %}
{% if port_channel_interface.native_vlan_tag is arista.avd.defined(true) %}
{% set native_vlan = "tag" %}
{% else %}
{% set native_vlan = port_channel_interface.native_vlan | arista.avd.default('-') %}
{% endif %}
{% set channel_group = ethernet_interface.channel_group.id %}
{% set trunk_groups = port_channel_interface.trunk_groups | arista.avd.default(['-']) | join(', ') %}
{% elif port_channel_interface.type is arista.avd.defined('switched') %}
{% set description = ethernet_interface.description | arista.avd.default("-") %}
{% set mode = port_channel_interface.mode | arista.avd.default('-') %}
{% set switchport_vlans = port_channel_interface.vlans | arista.avd.default('-') %}
{% if port_channel_interface.native_vlan_tag is arista.avd.defined(true) %}
{% set native_vlan = "tag" %}
{% else %}
{% set native_vlan = port_channel_interface.native_vlan | arista.avd.default('-') %}
{% endif %}
{% set channel_group = ethernet_interface.channel_group.id %}
{% set trunk_groups = port_channel_interface.trunk_groups | arista.avd.default(['-']) | join(', ') %}
| {{ ethernet_interface.name }} | {{ description }} | *{{ mode }} | *{{ switchport_vlans }} | *{{ native_vlan }} | *{{ trunk_groups }} | {{ channel_group }} |
{% endif %}
{% endif %}
{% else %}
{# Below if condition is added to keep the existing support for rendering switchport attributes on the basis of port_channel_interface.type == switched #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
or interface_defaults is arista.avd.defined
or interface_profiles is arista.avd.defined
or dps_interfaces is arista.avd.defined
or recirculation_interfaces is arista.avd.defined
or ethernet_interfaces is arista.avd.defined
or port_channel_interfaces is arista.avd.defined
or loopback_interfaces is arista.avd.defined
Expand All @@ -21,6 +22,8 @@
{% include 'documentation/interface-defaults.j2' %}
{## Interface Profiles #}
{% include 'documentation/interface-profiles.j2' %}
{## Recirculation Interfaces #}
{% include 'documentation/recirculation-interfaces.j2' %}
{## DPS Interfaces #}
{% include 'documentation/dps-interfaces.j2' %}
{## Ethernet Interfaces #}
Expand Down
Loading
Loading