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

Refactor(eos_cli_config_gen): Rearrange the eos-cli config for vlan-interfaces to match with EOS #4488

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

MaheshGSLAB
Copy link
Contributor

Change Summary

Rearrange the eos-cli config for vlan-interfaces to match with EOS.

Related Issue(s)

Fixes #

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Rearrange the eos-cli config for vlan-interfaces to match with EOS.

How to test

Run molecule

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)

@MaheshGSLAB MaheshGSLAB self-assigned this Sep 18, 2024
Copy link

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-4488
# Activate the virtual environment
source test-avd-pr-4488/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/MaheshGSLAB/ansible-avd.git@vlan-config-order#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/MaheshGSLAB/ansible-avd.git#/ansible_collections/arista/avd/,vlan-config-order --force
# Optional: Install AVD examples
cd test-avd-pr-4488
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Sep 18, 2024
@ClausHolbechArista ClausHolbechArista added this to the v5.0.0 milestone Sep 18, 2024
@@ -90,17 +90,17 @@ interface Vlan75
multicast ipv6 boundary ff00::/16 out
multicast ipv6 boundary ff01::/16 out
multicast ipv4 static
ipv6 virtual-router address 1b11:3a00:22b0:1000::1
Copy link
Contributor

Choose a reason for hiding this comment

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

IP order

interface Vlan41
   description SVI Description
   no shutdown
   ip helper-address 10.10.64.150 source-interface Loopback0
   ip helper-address 10.10.96.150 source-interface Loopback0
   ip helper-address 10.10.96.151 source-interface Loopback0
   ip igmp host-proxy
   ip igmp host-proxy 239.0.0.1
   ip igmp host-proxy 239.0.0.2 exclude 10.0.2.1
   ip igmp host-proxy 239.0.0.3 include 10.0.3.1
interface Vlan41
   description SVI Description
   ip helper-address 10.10.64.150 source-interface Loopback0
   ip helper-address 10.10.96.150 source-interface Loopback0
   ip helper-address 10.10.96.151 source-interface Loopback0
   ip igmp host-proxy
   ip igmp host-proxy 239.0.0.2 exclude 10.0.2.1
   ip igmp host-proxy 239.0.0.3 include 10.0.3.1
   ip igmp host-proxy 239.0.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The EOS is not sorting as natural sort here. If you see 239.0.0.1 then it should come before to 239.0.0.2 but not happening actually

@@ -90,17 +90,17 @@ interface Vlan75
multicast ipv6 boundary ff00::/16 out
multicast ipv6 boundary ff01::/16 out
multicast ipv4 static
ipv6 virtual-router address 1b11:3a00:22b0:1000::1
Copy link
Contributor

Choose a reason for hiding this comment

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

Key-id order

interface Vlan43
   description SVI Description
   no shutdown
   ipv6 dhcp relay destination a0::2 vrf TEST local-interface Loopback44 link-address a0::4
   ipv6 address a0::1/64
   isis authentication key-id 2 algorithm sha-512 key 0 password
   isis authentication key-id 3 algorithm sha-512 rfc-5310 key 0 password1
   isis authentication key-id 1 algorithm sha-1 key 0 password level-1
interface Vlan43
   description SVI Description
   ipv6 dhcp relay destination a0::2 vrf TEST local-interface Loopback44 link-address a0::4
   ipv6 address a0::1/64
   isis authentication key-id 1 algorithm sha-1 key 7 qZQzXEhWASbvrmcvHhTCZw==
   isis authentication key-id 2 algorithm sha-512 key 7 qZQzXEhWASbvrmcvHhTCZw==
   isis authentication key-id 3 algorithm sha-512 rfc-5310 key 7 yN8FIWN8ZbkSvVqiF90Gfw==

Copy link
Contributor

Choose a reason for hiding this comment

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

interface Vlan44
   description SVI Description
   no shutdown
   ipv6 dhcp relay destination a0::5 vrf TEST source-address a0::6 link-address a0::7
   ipv6 dhcp relay destination a0::8
interface Vlan44
   description SVI Description
   ipv6 dhcp relay destination a0::8
   ipv6 dhcp relay destination a0::5 vrf TEST source-address a0::6 link-addr
ess a0::7

Copy link
Contributor

Choose a reason for hiding this comment

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

interface Vlan50
   description IP NAT Testing
   ip nat source static 3.0.0.1 4.0.0.1
   ip nat source dynamic access-list ACL2 pool POOL2
   ip nat destination static 1.0.0.1 2.0.0.1
   ip nat destination dynamic access-list ACL1 pool POOL1
interface Vlan50
   description IP NAT Testing
   ip nat destination static 1.0.0.1 2.0.0.1
   ip nat source static 3.0.0.1 4.0.0.1
   ip nat destination dynamic access-list ACL1 pool POOL1
   ip nat source dynamic access-list ACL2 pool POOL2
   isis authentication mode text rx-disabled level-2
   isis authentication key 7 bpM/wnochsWdunkFr0o/Bg== level-2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

About the isis authentication key-id order the logic is like it will first sort the isis both type level key-ids then lervel-1 and then level-2 so we will see the order difference here.
@ClausHolbechArista @gmuloc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interface Vlan44
   description SVI Description
   no shutdown
   ipv6 dhcp relay destination a0::5 vrf TEST source-address a0::6 link-address a0::7
   ipv6 dhcp relay destination a0::8
interface Vlan44
   description SVI Description
   ipv6 dhcp relay destination a0::8
   ipv6 dhcp relay destination a0::5 vrf TEST source-address a0::6 link-addr
ess a0::7

We are already sorting base on address but EOS sorting base on vrf and none vrf destinations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interface Vlan50
   description IP NAT Testing
   ip nat source static 3.0.0.1 4.0.0.1
   ip nat source dynamic access-list ACL2 pool POOL2
   ip nat destination static 1.0.0.1 2.0.0.1
   ip nat destination dynamic access-list ACL1 pool POOL1
interface Vlan50
   description IP NAT Testing
   ip nat destination static 1.0.0.1 2.0.0.1
   ip nat source static 3.0.0.1 4.0.0.1
   ip nat destination dynamic access-list ACL1 pool POOL1
   ip nat source dynamic access-list ACL2 pool POOL2
   isis authentication mode text rx-disabled level-2
   isis authentication key 7 bpM/wnochsWdunkFr0o/Bg== level-2

this ip nat is comes from interface-ip-nat.j2 so we can check there only

ip address virtual 10.10.75.1/24
ipv6 virtual-router address 1b11:3a00:22b0:1000::1
Copy link
Contributor

Choose a reason for hiding this comment

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

interface Vlan75
   description SVI Description
   no shutdown
   ipv6 address 1b11:3a00:22b0:1000::15/64
   ipv6 nd managed-config-flag
   ipv6 nd prefix 1b11:3a00:22b0:1000::/64 infinite infinite no-autoconfig
   multicast ipv4 boundary 224.0.1.0/24 out
   multicast ipv4 boundary 224.0.2.0/24
   multicast ipv6 boundary ff00::/16 out
   multicast ipv6 boundary ff01::/16 out
 multicast ipv6 boundary ff01::/16 out
 multicast ipv6 boundary ff00::/16 out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

already user natural sort on boundary address and as per sort ff00 comes first then ff01 but EOS do just opposite

@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review September 25, 2024 11:39
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners September 25, 2024 11:39
Copy link

sonarcloud bot commented Sep 25, 2024

{% endif %}
{% if vlan_interface.ip_directed_broadcast is arista.avd.defined(true) %}
ip directed-broadcast
{% if vlan_interface.arp_monitor_mac_address is arista.avd.defined(true) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

 ipv6 nd cache expire 100
 ipv6 nd cache dynamic capacity 100
 arp monitor mac-address
 ipv6 nd cache refresh always

Copy link
Contributor

Choose a reason for hiding this comment

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

Arp monitor mac-address is above ipv6 nd cache refresh always

@laxmikantchintakindi
Copy link
Contributor

laxmikantchintakindi commented Sep 27, 2024

'ip helper-address...' commands is after 'ipv6 dhcp relay destinations' commands.

@ClausHolbechArista ClausHolbechArista marked this pull request as draft September 30, 2024 10:31
@MaheshGSLAB
Copy link
Contributor Author

MaheshGSLAB commented Sep 30, 2024

ip helper-address

@laxmikantchintakindi Can you share the config details as i dont see in my lab

leaf1-dc1(config-if-Vl101)#show active 
interface Vlan101
   ipv6 nd cache expire 100
   ipv6 nd cache dynamic capacity 100
   arp monitor mac-address
   ip helper-address 10.1.1.1
   ipv6 dhcp relay destination 11:11:11:11:11:11:11:11

@laxmikantchintakindi
Copy link
Contributor

ip helper-address

@laxmikantchintakindi Can you share the config details as i dont see in my lab

leaf1-dc1(config-if-Vl101)#show active 
interface Vlan101
   ipv6 nd cache expire 100
   ipv6 nd cache dynamic capacity 100
   arp monitor mac-address
   ip helper-address 10.1.1.1
   ipv6 dhcp relay destination 11:11:11:11:11:11:11:11

interface Vlan333
description Multiple VRIDs and tracking
arp aging timeout 180
arp monitor mac-address
bfd interval 100 min-rx 100 multiplier 10
bfd echo
ip dhcp relay all-subnets
ipv6 dhcp relay destination 10:3::3
ip helper-address abc source-interface Ethernet2
ip attached-host route export 10
ipv6 attached-host route export 10
ip igmp
ip igmp version 2
ip igmp host-proxy 239.2.2.2 exclude 2.2.2.2
ip igmp host-proxy access-list abc
ip igmp host-proxy report-interva

@laxmikantchintakindi
Copy link
Contributor

ip helper-address

@laxmikantchintakindi Can you share the config details as i dont see in my lab

leaf1-dc1(config-if-Vl101)#show active 
interface Vlan101
   ipv6 nd cache expire 100
   ipv6 nd cache dynamic capacity 100
   arp monitor mac-address
   ip helper-address 10.1.1.1
   ipv6 dhcp relay destination 11:11:11:11:11:11:11:11

interface Vlan333 description Multiple VRIDs and tracking arp aging timeout 180 arp monitor mac-address bfd interval 100 min-rx 100 multiplier 10 bfd echo ip dhcp relay all-subnets ipv6 dhcp relay destination 10:3::3 ip helper-address abc source-interface Ethernet2 ip attached-host route export 10 ipv6 attached-host route export 10 ip igmp ip igmp version 2 ip igmp host-proxy 239.2.2.2 exclude 2.2.2.2 ip igmp host-proxy access-list abc ip igmp host-proxy report-interva

It is sorting differently.

interface Vlan333
description Multiple VRIDs and tracking
arp aging timeout 180
arp monitor mac-address
bfd interval 100 min-rx 100 multiplier 10
bfd echo
ip dhcp relay all-subnets
ip helper-address 1.1.1.1 source-interface Ethernet1
ipv6 dhcp relay destination 10:3::3
ip helper-address 20.1.1.1.1 source-interface Ethernet1

it is sorting on the basis of ip address.

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

Successfully merging this pull request may close these issues.

4 participants