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 switchport 'tap' and 'tool' mode config to the ethernet and port-channel interfaces #4174

Open
wants to merge 40 commits into
base: devel
Choose a base branch
from

Conversation

Shivani-gslab
Copy link
Contributor

@Shivani-gslab Shivani-gslab commented Jul 2, 2024

Change Summary

Add switchport 'tap' and 'tool' mode config to the interfaces

Related Issue(s)

Fixes #

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Add schema, template and tests for switchport.tap and switchport.tool in interfaces.

How to test

Molecule test added. Test in EOS CLI.

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

Copy link

github-actions bot commented Jul 2, 2024

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4174
# Activate the virtual environment
source test-avd-pr-4174/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Shivani-gslab/avd.git@switchport_tap_tool#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/Shivani-gslab/avd.git#/ansible_collections/arista/avd/,switchport_tap_tool --force
# Optional: Install AVD examples
cd test-avd-pr-4174
ansible-playbook arista.avd.install_examples

@Shivani-gslab Shivani-gslab marked this pull request as ready for review July 15, 2024 12:05
@Shivani-gslab Shivani-gslab requested review from a team as code owners July 15, 2024 12:05
@Shivani-gslab Shivani-gslab marked this pull request as draft July 21, 2024 17:24
@Shivani-gslab Shivani-gslab marked this pull request as ready for review July 22, 2024 12:38
@Shivani-gslab Shivani-gslab marked this pull request as draft July 22, 2024 13:24
@Shivani-gslab Shivani-gslab dismissed stale reviews from laxmikantchintakindi and MaheshGSLAB November 26, 2024 09:14

A lot of changes since then

@Shivani-gslab Shivani-gslab marked this pull request as ready for review November 26, 2024 10:07
Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review as I need to find a correct device to carry on

switchport tap identity 3 inner 5
switchport tap mac-address dest 01:00:00:00:00:00 src 01:23:45:67:89:ab
switchport tap mpls pop all
switchport tap encapsulation gre protocol 0x0001 strip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is rendered as

switchport tap encapsulation gre protocol 0x1 strip not 0x0001 (need to check the tempaltes to conclude myself)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I kept it same as the command

switchport tap encapsulation gre protocol 0x0002 feature header length 3 strip
switchport tap encapsulation gre protocol 0x0003 feature header length 2 strip re-encapsulation ethernet
switchport tap encapsulation gre protocol 0x0004 strip re-encapsulation ethernet
switchport tap encapsulation gre strip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line disappears in my config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its there for me -

interface Ethernet10
   description Switchport_tap_tool
   switchport tap native vlan 10
   switchport tap identity 3 inner 5
   switchport tap mac-address dest 01:00:00:00:00:00 src 01:23:45:67:89:ab
   switchport tap encapsulation gre protocol 0x1 strip
   switchport tap encapsulation gre protocol 0x2 feature header length 3 strip
   switchport tap encapsulation gre protocol 0x3 feature header length 2 strip re-encapsulation ethernet
   switchport tap encapsulation gre protocol 0x4 strip re-encapsulation ethernet
   switchport tap encapsulation gre strip
   switchport tap encapsulation gre destination 1.1.1.1 source 1.1.1.2 protocol 0x0 strip
   switchport tap encapsulation gre destination 2.1.1.2 protocol 0x10 strip
   switchport tap encapsulation gre destination 2.1.1.2 protocol 0x11 feature header length 2 strip re-encapsulation ethernet
   switchport tap encapsulation gre destination 2.1.1.2 protocol 0x12 strip re-encapsulation ethernet
   switchport tap mpls pop all
   switchport tool mpls pop all
   switchport tool encapsulation vn-tag strip
   switchport tool encapsulation dot1br strip
   switchport tap allowed vlan 25
   switchport tool allowed vlan 23
   switchport tool identity qinq
   switchport tool identity dot1q source dzgre port
   switchport tap truncation 150
   switchport tool truncation 1
   switchport tap default group g1 group g2 group g3
   switchport tap default nexthop-group nexthop_g1 nexthop_g2 nexthop_g3
   switchport tap default interface Ethernet4
   switchport tap default interface Po10
   switchport tool group set group1 group2
   switchport tool dot1q remove outer 1

Copy link
Contributor Author

@Shivani-gslab Shivani-gslab Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested multiple ways, found out that - it replaces that command when we apply switchport tap encapsulation gre destination 2.1.1.2 strip i.e. without specifying protocol and vice-versa.

@@ -4403,6 +4448,13 @@ interface Port-Channel100.101
logging event link-status
encapsulation dot1q vlan 101
ip address 10.1.1.3/31
switchport tap identity 3 inner 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which device have you used for this?

site3-leaf1(config-s-gmu)#interface Port-Channel100.101
site3-leaf1(config-s-gmu-if-Po100.101)##interface Port-Channel100.101
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   description IFL for TENANT01
site3-leaf1(config-s-gmu-if-Po100.101)#   mtu 1500
site3-leaf1(config-s-gmu-if-Po100.101)#   logging event link-status
site3-leaf1(config-s-gmu-if-Po100.101)#   encapsulation dot1q vlan 101
site3-leaf1(config-s-gmu-if-Po100.101)#   ip address 10.1.1.3/31
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tap identity 3 inner 10
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tap mac-address dest 01:00:00:00:00:00
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tap encapsulation vxlan strip
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tool identity dot1q
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tool identity dot1q source dzgre policy
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tap truncation 120
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#   switchport tool truncation
% Invalid input
site3-leaf1(config-s-gmu-if-Po100.101)#switch?
switch  switchport

site3-leaf1(config-s-gmu-if-Po100.101)#switchport ?
  default        Configure switchport default behavior
  ethernet       Details on Ethernet 802.2 LLC header operation
  port-security  Configure MAC-address-based port security
  vlan           Details on VLAN operation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, it has the same issue (not applicable to sub interfaces)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it

@Shivani-gslab Shivani-gslab marked this pull request as draft November 28, 2024 06:27
@Shivani-gslab Shivani-gslab marked this pull request as ready for review November 28, 2024 10:08
type: str
description: |-
Protocol type in GRE header.
Protocol range: 0x0000-0xFFFF.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Protocol range: 0x0000-0xFFFF.
Protocol range: 0x0-0xFFFF.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants