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 Monitor Session support #1435

Merged
merged 13 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# monitor-sessions
# Table of Contents

- [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)
- [Multicast](#multicast)
- [Filters](#filters)
- [ACL](#acl)
- [Quality Of Service](#quality-of-service)

# 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 |

# Multicast

# Filters

# ACL

# Quality Of Service
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
!RANCID-CONTENT-TYPE: arista
!
transceiver qsfp default-mode 4x10G
!
hostname monitor-sessions
!
no aaa root
no enable password
!
interface Management1
description oob_management
vrf MGMT
ip address 10.73.255.122/24
!
monitor session myMonitoringSession1 source Ethernet0 ipv6 access-group ipv6ACL priority 100
monitor session myMonitoringSession1 source Ethernet5 both ip access-group ipv4ACL priority 10
monitor session myMonitoringSession1 destination Ethernet48
monitor session myMonitoringSession1 encapsulation gre metadata tx
monitor session myMonitoringSession1 header remove size 32
monitor session myMonitoringSession1 truncate
monitor session myMonitoringSession2 source Ethernet12 rx
monitor session myMonitoringSession2 source Ethernet18 tx mac access-group macACL priority 100
monitor session myMonitoringSession2 destination Cpu
monitor session myMonitoringSession2 destination Ethernet50
monitor session myMonitoringSession2 encapsulation gre metadata tx
monitor session myMonitoringSession2 ip access-group ipv4ACL
monitor session myMonitoringSession2 sample 50
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
monitor_sessions:
- name: myMonitoringSession1
sources:
- name: Ethernet5
direction: both
access_group:
type: ip
name: ipv4ACL
priority: 10
ip_access_group_priority: 10
- name: Ethernet0
access_group:
type: ipv6
name: ipv6ACL
priority: 100
destinations:
- Ethernet48
encapsulation_gre_metadata_tx: true
header_remove_size: 32
truncate:
enabled: true
- name: myMonitoringSession2
sources:
- name: Ethernet12
direction: rx
- name: Ethernet18
ccsnw marked this conversation as resolved.
Show resolved Hide resolved
access_group:
ccsnw marked this conversation as resolved.
Show resolved Hide resolved
type: mac
name: macACL
priority: 100
direction: tx
destinations:
- Cpu
- Ethernet50
encapsulation_gre_metadata_tx: true
access_group:
type: ip
name: ipv4ACL
sample: 50
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ mac-security-eth-po-entropy
match-lists
mlag-configuration
monitor-connectivity
monitor-sessions
mpls
none_configuration
ntp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
- [Logging](#logging)
- [Sflow](#sflow)
- [SNMP Settings](#snmp-settings)
- [Monitor Sessions](#monitor-sessions)
- [System Control-Plane](#system-control-plane)
- [VM Tracer Sessions](#vm-tracer-sessions)
- [Patch Panel](#patch-panel)
Expand Down Expand Up @@ -2007,6 +2008,33 @@ snmp_server:
enable: < true | false >
```

#### Monitor Sessions

```yaml
monitor_sessions:
- name: < session_name_1 >
sources:
- name: < interface_name or range >
direction: < rx | tx | both >
access_group:
type: < ip | ipv6 | mac >
name: < acl_name >
priority: < priority >
destinations:
- < interface(s) | cpu >
ccsnw marked this conversation as resolved.
Show resolved Hide resolved
encapsulation_gre_metadata_tx: < true | false >
header_remove_size: < bytes >
access_group:
type: < ip | ipv6 | mac >
name: < acl_name >
rate_limit_per_ingress_chip: < "<int> bps" | "<int> kbps" | "<int> mbps" >
rate_limit_per_egress_chip: < "<int> bps" | "<int> kbps" | "<int> mbps" >
sample: < int >
truncate:
enabled: < true | false >
size: < bytes >
```

### System Control-Plane

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
{% include 'eos/ip-routing.j2' %}
{# IPv6 Routing #}
{% include 'eos/ipv6-routing.j2' %}
{# Monitor Sessions #}
{% include 'eos/monitor-sessions.j2' %}
{# qos #}
{% include 'eos/qos.j2' %}
{# IP Extended Community Lists #}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% if monitor_sessions is arista.avd.defined %}
!
{% for monitor_session in monitor_sessions | arista.avd.natural_sort('name') if monitor_session.name is arista.avd.defined %}
{% if monitor_session.sources is arista.avd.defined and monitor_session.destinations is arista.avd.defined %}
{% for source in monitor_session.sources | arista.avd.natural_sort('name') if source.name is arista.avd.defined %}
{% set source_cli = "monitor session " ~ monitor_session.name ~ " source " ~ source.name %}
{% if source.direction is arista.avd.defined %}
{% set source_cli = source_cli ~ " " ~ source.direction %}
{% endif %}
{% if source.access_group.type is arista.avd.defined and source.access_group.name is arista.avd.defined %}
{% set source_cli = source_cli ~ " " ~ source.access_group.type ~ " access-group " ~ source.access_group.name %}
{% if source.access_group.priority is arista.avd.defined %}
{% set source_cli = source_cli ~ " priority " ~ source.access_group.priority %}
{% endif %}
{% endif %}
{{ source_cli }}
{% endfor %}
{% for destination in monitor_session.destinations | arista.avd.natural_sort %}
monitor session {{ monitor_session.name }} destination {{ destination }}
{% endfor %}
{% if monitor_session.encapsulation_gre_metadata_tx is arista.avd.defined(true) %}
monitor session {{ monitor_session.name }} encapsulation gre metadata tx
{% endif %}
{% if monitor_session.header_remove_size is arista.avd.defined %}
monitor session {{ monitor_session.name }} header remove size {{ monitor_session.header_remove_size }}
{% endif %}
{% if monitor_session.access_group.type is arista.avd.defined and monitor_session.access_group.name is arista.avd.defined %}
monitor session {{ monitor_session.name }} {{ monitor_session.access_group.type }} access-group {{ monitor_session.access_group.name }}
{% endif %}
{% if monitor_session.rate_limit_per_ingress_chip is arista.avd.defined %}
monitor session {{ monitor_session.name }} rate-limit per-ingress-chip {{ monitor_session.rate_limit_per_ingress_chip }}
{% endif %}
{% if monitor_session.rate_limit_per_egress_chip is arista.avd.defined %}
monitor session {{ monitor_session.name }} rate-limit per-egress-chip {{ monitor_session.rate_limit_per_egress_chip }}
{% endif %}
{% if monitor_session.sample is arista.avd.defined %}
monitor session {{ monitor_session.name }} sample {{ monitor_session.sample }}
{% endif %}
{% if monitor_session.truncate.enabled is arista.avd.defined(true) %}
{% set truncate_cli = "monitor session " ~ monitor_session.name ~ " truncate" %}
{% if monitor_session.truncate.size is arista.avd.defined %}
{% set truncate_cli = truncate_cli ~ " size " ~ monitor_session.truncate.size %}
{% endif %}
{{ truncate_cli }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}