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 support for IPv6 address virtual in vlan_interfaces #1312

Merged
merged 5 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -75,6 +75,7 @@ interface Management1
| Vlan41 | SVI Description | default | - | false |
| Vlan42 | SVI Description | default | - | false |
| Vlan75 | SVI Description | default | - | false |
| Vlan81 | IPv6 Virtual Address | Tenant_C | - | - |
| Vlan83 | SVI Description | default | - | false |
| Vlan84 | SVI Description | default | - | - |
| Vlan85 | SVI Description | default | - | - |
Expand Down Expand Up @@ -106,6 +107,7 @@ interface Management1
| Vlan41 | default | - | 10.10.41.1/24 | - | - | - | - |
| Vlan42 | default | - | 10.10.42.1/24 | - | - | - | - |
| Vlan75 | default | - | 10.10.75.1/24 | - | - | - | - |
| Vlan81 | Tenant_C | - | 10.10.81.1/24 | - | - | - | - |
| Vlan83 | default | - | 10.10.83.1/24 | - | - | - | - |
| Vlan84 | default | 10.10.84.1/24 | - | 10.10.84.254, 10.11.84.254/24 | - | - | - |
| Vlan85 | default | 10.10.84.1/24 | - | - | - | - | - |
Expand All @@ -125,14 +127,15 @@ interface Management1

#### IPv6

| Interface | VRF | IPv6 Address | Virtual Router Address | VRRP | ND RA Disabled | Managed Config Flag | IPv6 ACL In | IPv6 ACL Out |
| --------- | --- | ------------ | ----------------------- | --- | -------------- | ----------- | --------- | ----------- | ------------ |
| Vlan24 | default | 1b11:3a00:22b0:6::15/64 | 1b11:3a00:22b0:6::1 | - | - | true | - | - |
| Vlan75 | default | 1b11:3a00:22b0:1000::15/64 | 1b11:3a00:22b0:1000::1 | - | - | true | - | - |
| Vlan89 | default | 1b11:3a00:22b0:5200::15/64 | 1b11:3a00:22b0:5200::3 | - | - | true | - | - |
| Vlan501 | default | 1b11:3a00:22b0:0088::207/127 | - | - | true | - | - | - |
| Vlan1001 | Tenant_A | a1::1/64 | - | - | - | true | - | - |
| Vlan1002 | Tenant_A | a2::1/64 | - | - | true | true | - | - |
| Interface | VRF | IPv6 Address | IPv6 Virtual Address | Virtual Router Address | VRRP | ND RA Disabled | Managed Config Flag | IPv6 ACL In | IPv6 ACL Out |
| --------- | --- | ------------ | -------------------- | ---------------------- | ---- | -------------- | ------------------- | ----------- | ------------ |
| Vlan24 | default | 1b11:3a00:22b0:6::15/64 | - | 1b11:3a00:22b0:6::1 | - | - | true | - | - |
| Vlan75 | default | 1b11:3a00:22b0:1000::15/64 | - | 1b11:3a00:22b0:1000::1 | - | - | true | - | - |
| Vlan81 | Tenant_C | - | fc00:10:10:81::1/64 | - | - | - | - | - | - |
| Vlan89 | default | 1b11:3a00:22b0:5200::15/64 | - | 1b11:3a00:22b0:5200::3 | - | - | true | - | - |
| Vlan501 | default | 1b11:3a00:22b0:0088::207/127 | - | - | - | true | - | - | - |
| Vlan1001 | Tenant_A | a1::1/64 | - | - | - | - | true | - | - |
| Vlan1002 | Tenant_A | a2::1/64 | - | - | - | true | true | - | - |


### VLAN Interfaces Device Configuration
Expand Down Expand Up @@ -170,6 +173,13 @@ interface Vlan75
ipv6 nd prefix 1b11:3a00:22b0:1000::/64 infinite infinite no-autoconfig
ipv6 virtual-router address 1b11:3a00:22b0:1000::1
!
interface Vlan81
description IPv6 Virtual Address
vrf Tenant_C
ip address virtual 10.10.81.1/24
ipv6 enable
ipv6 address virtual fc00:10:10:81::1/64
!
interface Vlan83
description SVI Description
no shutdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ interface Vlan75
ipv6 nd prefix 1b11:3a00:22b0:1000::/64 infinite infinite no-autoconfig
ipv6 virtual-router address 1b11:3a00:22b0:1000::1
!
interface Vlan81
description IPv6 Virtual Address
vrf Tenant_C
ip address virtual 10.10.81.1/24
ipv6 enable
ipv6 address virtual fc00:10:10:81::1/64
!
interface Vlan83
description SVI Description
no shutdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ vlan_interfaces:
vrf: Tenant_B
ip_address_virtual: 10.2.2.1/24

Vlan81:
description: IPv6 Virtual Address
vrf: Tenant_C
ip_address_virtual: 10.10.81.1/24
ipv6_enable: true
ipv6_address_virtual: fc00:10:10:81::1/64

Vlan83:
description: SVI Description
shutdown: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ vlan_interfaces:
source_interface: < source_interface_name >
ipv6_enable: < true | false >
ipv6_address: < IPv6_address/Mask >
ipv6_address_virtual: < IPv6_address/Mask >
ipv6_address_link_local: < link_local_IPv6_address/Mask >
ipv6_nd_ra_disabled: < true | false >
ipv6_nd_managed_config_flag: < true | false >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,21 @@
| {{ vlan_interface }} | {{ row_vrf }} | {{ row_ip_addr }} | {{ row_ip_vaddr }} | {{ row_varp }} | {{ row_vrrp }} | {{ row_acl_in }} | {{ row_acl_out }} |
{% endfor %}
{# IPv6 #}
{% set vlan_interface_ipv6 = namespace() %}
{% set vlan_interface_ipv6.configured = false %}
{% for vlan_interface in vlan_interfaces | arista.avd.natural_sort %}
{% if vlan_interfaces[vlan_interface].ipv6_address is defined %}
{% set vlan_interfaces_ipv6 = [] %}
{% for vlan_interface in vlan_interfaces | arista.avd.default([]) %}
{% if vlan_interfaces[vlan_interface].ipv6_address is arista.avd.defined or vlan_interfaces[vlan_interface].ipv6_address_virtual is arista.avd.defined %}
{# add also a test against ipv6_address_virtual when supported #}
{% set vlan_interface_ipv6.configured = true %}
{% endif %}
{% do vlan_interfaces_ipv6.append(vlan_interface) %}
{% endif %}
{% endfor %}
{% if vlan_interface_ipv6.configured == true %}
{% if vlan_interfaces_ipv6 | length > 0 %}

#### IPv6

| Interface | VRF | IPv6 Address | Virtual Router Address | VRRP | ND RA Disabled | Managed Config Flag | IPv6 ACL In | IPv6 ACL Out |
| --------- | --- | ------------ | ----------------------- | --- | -------------- | ----------- | --------- | ----------- | ------------ |
{% for vlan_interface in vlan_interfaces | arista.avd.natural_sort %}
{% if vlan_interfaces[vlan_interface].ipv6_address is defined and vlan_interfaces[vlan_interface].ipv6_address is not none %}
| {{ vlan_interface }} | {% if vlan_interfaces[vlan_interface].vrf is defined and vlan_interfaces[vlan_interface].vrf is not none %} {{ vlan_interfaces[vlan_interface].vrf }} {% else %} default {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_address is defined and vlan_interfaces[vlan_interface].ipv6_address is not none %} {{ vlan_interfaces[vlan_interface].ipv6_address }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_virtual_router_address is defined and vlan_interfaces[vlan_interface].ipv6_virtual_router_address is not none %} {{ vlan_interfaces[vlan_interface].ipv6_virtual_router_address }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].vrrp.ipv6 is defined and vlan_interfaces[vlan_interface].vrrp.ipv6 is not none %} {{ vlan_interfaces[vlan_interface].vrrp.ipv6 }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_nd_ra_disabled is defined and vlan_interfaces[vlan_interface].ipv6_nd_ra_disabled is not none %} {{ vlan_interfaces[vlan_interface].ipv6_nd_ra_disabled | lower }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_nd_managed_config_flag is defined and vlan_interfaces[vlan_interface].ipv6_nd_managed_config_flag is not none %} {{ vlan_interfaces[vlan_interface].ipv6_nd_managed_config_flag | lower }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_access_group_in is defined and vlan_interfaces[vlan_interface].ipv6_access_group_in is not none %} {{ vlan_interfaces[vlan_interface].ipv6_access_group_in }} {% else %} - {% endif %} | {% if vlan_interfaces[vlan_interface].ipv6_access_group_out is defined and vlan_interfaces[vlan_interface].ipv6_access_group_out is not none %} {{ vlan_interfaces[vlan_interface].ipv6_access_group_out }} {% else %} - {% endif %} |
{% endif %}
| Interface | VRF | IPv6 Address | IPv6 Virtual Address | Virtual Router Address | VRRP | ND RA Disabled | Managed Config Flag | IPv6 ACL In | IPv6 ACL Out |
| --------- | --- | ------------ | -------------------- | ---------------------- | ---- | -------------- | ------------------- | ----------- | ------------ |
{% for vlan_interface in vlan_interfaces_ipv6 | arista.avd.natural_sort %}
| {{ vlan_interface }} | {{ vlan_interfaces[vlan_interface].vrf | arista.avd.default('default') }} | {{ vlan_interfaces[vlan_interface].ipv6_address | arista.avd.default('-') }} | {{ vlan_interfaces[vlan_interface].ipv6_address_virtual | arista.avd.default('-') }} | {{ vlan_interfaces[vlan_interface].ipv6_virtual_router_address | arista.avd.default('-') }} | {{ vlan_interfaces[vlan_interface].vrrp.ipv6 | arista.avd.default('-') }} | {{ vlan_interfaces[vlan_interface].ipv6_nd_ra_disabled | arista.avd.default('-') | lower }} | {{ vlan_interfaces[vlan_interface].ipv6_nd_managed_config_flag | arista.avd.default('-') | lower }} | {{ vlan_interfaces[vlan_interface].ipv6_access_group_in | arista.avd.default('-') }} | {{ vlan_interfaces[vlan_interface].ipv6_access_group_out | arista.avd.default('-') }} |
{% endfor %}
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ interface {{ vlan_interface }}
{% if vlan_interfaces[vlan_interface].ipv6_address_link_local is arista.avd.defined %}
ipv6 address {{ vlan_interfaces[vlan_interface].ipv6_address_link_local }} link-local
{% endif %}
{% if vlan_interfaces[vlan_interface].ipv6_address_virtual is arista.avd.defined %}
ipv6 address virtual {{ vlan_interfaces[vlan_interface].ipv6_address_virtual }}
{% endif %}
{% if vlan_interfaces[vlan_interface].ipv6_nd_ra_disabled is arista.avd.defined(true) %}
ipv6 nd ra disabled
{% endif %}
Expand Down