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_cli_config_gen): Add patch panel support #1225

Merged
merged 13 commits into from
Nov 1, 2021
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# patch-panel
# Table of Contents
<!-- toc -->

- [Management](#management)
- [Management Interfaces](#management-interfaces)
- [Authentication](#authentication)
- [Monitoring](#monitoring)
- [Internal VLAN Allocation Policy](#internal-vlan-allocation-policy)
- [Internal VLAN Allocation Policy Summary](#internal-vlan-allocation-policy-summary)
- [Interfaces](#interfaces)
- [Routing](#routing)
- [IP Routing](#ip-routing)
- [IPv6 Routing](#ipv6-routing)
- [Patch Panel](#patch-panel)
- [Multicast](#multicast)
- [Filters](#filters)
- [ACL](#acl)
- [Quality Of Service](#quality-of-service)

<!-- toc -->
# 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
```

# Authentication

# Monitoring

# Internal VLAN Allocation Policy

## Internal VLAN Allocation Policy Summary

**Default Allocation Policy**

| Policy Allocation | Range Beginning | Range Ending |
| ------------------| --------------- | ------------ |
| ascending | 1006 | 4094 |

# Interfaces

# Routing

## IP Routing

### IP Routing Summary

| VRF | Routing Enabled |
| --- | --------------- |
| default | false|
### IP Routing Device Configuration

```eos
```
## IPv6 Routing

### IPv6 Routing Summary

| VRF | Routing Enabled |
| --- | --------------- |
| default | false |

## Patch Panel

### Patch Panel Summary

| Patch Name | Connector 1 | Connector 2 | Enabled |
| ---------- | ----------- | ----------- | ------- |
| TEN_A_site2_site5_eline | Interface: Ethernet5 vlan 1234 | Pseudowire: bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline | True |

# Multicast

# Filters

# ACL

# Quality Of Service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
!RANCID-CONTENT-TYPE: arista
!
transceiver qsfp default-mode 4x10G
!
hostname patch-panel
!
no aaa root
no enable password
!
interface Management1
description oob_management
vrf MGMT
ip address 10.73.255.122/24
!
patch panel
patch TEN_A_site2_site5_eline
connector 1 interface Ethernet5 dot1q vlan 1234
connector 2 pseudowire bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
patch_panel:
patches:
- name: TEN_A_site2_site5_eline
connectors:
- id: 1
interface: Ethernet5
dot1q_vlan: 1234
- id: 2
pseudowire: bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline
emilarista marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ mlag-configuration
mpls
none_configuration
ntp
patch-panel
platform
policy-maps
port-channel-interfaces
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% if patch_panel is arista.avd.defined %}

## Patch Panel
emilarista marked this conversation as resolved.
Show resolved Hide resolved

### Patch Panel Summary

| Patch Name | Connector 1 | Connector 2 | Enabled |
emilarista marked this conversation as resolved.
Show resolved Hide resolved
| ---------- | ----------- | ----------- | ------- |
{% for patch in patch_panel.patches %}
emilarista marked this conversation as resolved.
Show resolved Hide resolved
{% set patch_panel_patch = namespace() %}
{% set patch_panel_patch.enabled = patch.enabled | arista.avd.default(true) %}
{% for connector in patch.connectors %}
{% if connector.interface is arista.avd.defined %}
{% set attachment_point = "Interface: " ~ connector.interface %}
{% if connector.dot1q_vlan is arista.avd.defined %}
{% set attachment_point = attachment_point ~ " vlan " ~ connector.dot1q_vlan %}
{% endif %}
{% elif "pseudowire" in connector %}
{% set attachment_point = "Pseudowire: " ~ connector.pseudowire %}
{% endif %}
{% if connector.id == 1 %}
{% set patch_panel_patch.connector_1 = attachment_point %}
{% elif connector.id == 2 %}
{% set patch_panel_patch.connector_2 = attachment_point %}
{% endif %}
{% endfor %}
| {{ patch.name }} | {{ patch_panel_patch.connector_1 }} | {{ patch_panel_patch.connector_2 }} | {{ patch_panel_patch.enabled }} |
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
{% include 'documentation/bfd.j2' %}
{# MPLS #}
{% include 'documentation/mpls.j2' %}
{# Patch Panel #}
{% include 'documentation/patch-panel.j2' %}

# Multicast
{## IP IGMP Snooping #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
{% include 'eos/router-isis.j2' %}
{# MPLS #}
{% include 'eos/mpls.j2' %}
{# Patch Panel #}
{% include 'eos/patch-panel.j2' %}
{# queue monitor streaming #}
{% include 'eos/queue-monitor-streaming.j2' %}
{# ip tacacs+ source interfaces #}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if patch_panel is arista.avd.defined %}
!
patch panel
{% for patch in patch_panel.patches | arista.avd.natural_sort %}
patch {{ patch.name }}
emilarista marked this conversation as resolved.
Show resolved Hide resolved
{% if patch.enabled is arista.avd.defined(false) %}
shutdown
{% endif %}
{% for connector in patch.connectors %}
emilarista marked this conversation as resolved.
Show resolved Hide resolved
{% if connector.interface is arista.avd.defined %}
emilarista marked this conversation as resolved.
Show resolved Hide resolved
{% if connector.dot1q_vlan is arista.avd.defined %}
connector {{ connector.id }} interface {{ connector.interface }} dot1q vlan {{ connector.dot1q_vlan }}
{% else %}
connector {{ connector.id }} interface {{ connector.interface }}
{% endif %}
{% elif connector.pseudowire is arista.avd.defined %}
connector {{ connector.id }} pseudowire {{ connector.pseudowire }}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}