Skip to content

Commit

Permalink
Fix(eos_designs): Fix IPv6 static routes tenants (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
onurgashi authored May 12, 2022
1 parent ac0c0a0 commit fee35bf
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- [IP Routing](#ip-routing)
- [IPv6 Routing](#ipv6-routing)
- [Static Routes](#static-routes)
- [IPv6 Static Routes](#ipv6-static-routes)
- [Router BGP](#router-bgp)
- [BFD](#bfd)
- [Router BFD](#router-bfd)
Expand Down Expand Up @@ -997,7 +998,6 @@ ip routing vrf Tenant_D_WAN_Zone
| --- | ------------------ | ----------------------- | ------------------- | ----------------------------- | ----------------- | ----------------------------- | -------------- |
| MGMT | 0.0.0.0/0 | 192.168.200.5 | - | 1 | - | - | - |
| Tenant_D_OP_Zone | 0.0.0.0/0 | 10.3.11.4 | - | 1 | - | - | - |
| Tenant_D_OP_Zone | ::/0 | 2001:db8:311::4 | - | 1 | - | IPv6-test-2 | - |
| Tenant_D_OP_Zone | 10.3.11.0/24 | - | Vlan411 | 1 | - | VARP | - |

### Static Routes Device Configuration
Expand All @@ -1006,10 +1006,26 @@ ip routing vrf Tenant_D_WAN_Zone
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
ip route vrf Tenant_D_OP_Zone 0.0.0.0/0 10.3.11.4
ip route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
```

## IPv6 Static Routes

### IPv6 Static Routes Summary

| VRF | Destination Prefix | Next Hop IP | Exit interface | Administrative Distance | Tag | Route Name | Metric |
| --- | ------------------ | ----------------------- | ------------------- | ----------------------------- | ----------------- | ----------------------------- | -------------- |
| Tenant_D_OP_Zone | ::/0 | 2001:db8:311::4 | - | 1 | - | IPv6-test-2 | - |
| Tenant_D_OP_Zone | 2001:db8:311::/64 | - | Vlan411 | 1 | - | VARPv6 | - |

### Static Routes Device Configuration

```eos
!
ipv6 route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
```

## Router BGP

### Router BGP Summary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- [IP Routing](#ip-routing)
- [IPv6 Routing](#ipv6-routing)
- [Static Routes](#static-routes)
- [IPv6 Static Routes](#ipv6-static-routes)
- [Router BGP](#router-bgp)
- [BFD](#bfd)
- [Router BFD](#router-bfd)
Expand Down Expand Up @@ -997,7 +998,6 @@ ip routing vrf Tenant_D_WAN_Zone
| --- | ------------------ | ----------------------- | ------------------- | ----------------------------- | ----------------- | ----------------------------- | -------------- |
| MGMT | 0.0.0.0/0 | 192.168.200.5 | - | 1 | - | - | - |
| Tenant_D_OP_Zone | 0.0.0.0/0 | 10.3.11.4 | - | 1 | - | - | - |
| Tenant_D_OP_Zone | ::/0 | 2001:db8:311::4 | - | 1 | - | IPv6-test-2 | - |
| Tenant_D_OP_Zone | 10.3.11.0/24 | - | Vlan411 | 1 | - | VARP | - |

### Static Routes Device Configuration
Expand All @@ -1006,10 +1006,26 @@ ip routing vrf Tenant_D_WAN_Zone
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
ip route vrf Tenant_D_OP_Zone 0.0.0.0/0 10.3.11.4
ip route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
```

## IPv6 Static Routes

### IPv6 Static Routes Summary

| VRF | Destination Prefix | Next Hop IP | Exit interface | Administrative Distance | Tag | Route Name | Metric |
| --- | ------------------ | ----------------------- | ------------------- | ----------------------------- | ----------------- | ----------------------------- | -------------- |
| Tenant_D_OP_Zone | ::/0 | 2001:db8:311::4 | - | 1 | - | IPv6-test-2 | - |
| Tenant_D_OP_Zone | 2001:db8:311::/64 | - | Vlan411 | 1 | - | VARPv6 | - |

### Static Routes Device Configuration

```eos
!
ipv6 route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
```

## Router BGP

### Router BGP Summary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [IP Routing](#ip-routing)
- [IPv6 Routing](#ipv6-routing)
- [Static Routes](#static-routes)
- [IPv6 Static Routes](#ipv6-static-routes)
- [Router BGP](#router-bgp)
- [BFD](#bfd)
- [Router BFD](#router-bfd)
Expand Down Expand Up @@ -807,6 +808,21 @@ ip route vrf Tenant_A_APP_Zone 10.3.32.0/24 Vlan132 name VARP
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
```

## IPv6 Static Routes

### IPv6 Static Routes Summary

| VRF | Destination Prefix | Next Hop IP | Exit interface | Administrative Distance | Tag | Route Name | Metric |
| --- | ------------------ | ----------------------- | ------------------- | ----------------------------- | ----------------- | ----------------------------- | -------------- |
| Tenant_D_OP_Zone | 2001:db8:311::/64 | - | Vlan411 | 1 | - | VARPv6 | - |

### Static Routes Device Configuration

```eos
!
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
```

## Router BGP

### Router BGP Summary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,11 @@ ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
ip route vrf Tenant_D_OP_Zone 0.0.0.0/0 10.3.11.4
ip route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
!
ipv6 route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
!
route-map RM-CONN-2-BGP permit 10
match ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,11 @@ ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
ip route vrf Tenant_D_OP_Zone 0.0.0.0/0 10.3.11.4
ip route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
!
ipv6 route vrf Tenant_D_OP_Zone ::/0 2001:db8:311::4 name IPv6-test-2
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
!
route-map RM-CONN-2-BGP permit 10
match ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ ip route vrf Tenant_A_APP_Zone 10.2.32.0/24 Vlan132 name VARP
ip route vrf Tenant_A_APP_Zone 10.3.32.0/24 Vlan132 name VARP
ip route vrf Tenant_D_OP_Zone 10.3.11.0/24 Vlan411 name VARP
!
ipv6 route vrf Tenant_D_OP_Zone 2001:db8:311::/64 Vlan411 name VARPv6
!
route-map RM-CONN-2-BGP permit 10
match ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ static_routes:
- destination_address_prefix: 0.0.0.0/0
vrf: Tenant_D_OP_Zone
gateway: 10.3.11.4
- destination_address_prefix: ::/0
vrf: Tenant_D_OP_Zone
gateway: 2001:db8:311::4
name: IPv6-test-2
- destination_address_prefix: 10.3.11.0/24
vrf: Tenant_D_OP_Zone
name: VARP
Expand Down Expand Up @@ -888,6 +884,15 @@ vlan_interfaces:
ip_address_virtual: 10.4.12.254/24
ipv6_address_virtual: 2001:db8:412::1/64
mtu: 1560
ipv6_static_routes:
- destination_address_prefix: ::/0
vrf: Tenant_D_OP_Zone
gateway: 2001:db8:311::4
name: IPv6-test-2
- destination_address_prefix: 2001:db8:311::/64
vrf: Tenant_D_OP_Zone
name: VARPv6
interface: Vlan411
vxlan_interface:
Vxlan1:
description: DC1-LEAF2A_VTEP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ static_routes:
- destination_address_prefix: 0.0.0.0/0
vrf: Tenant_D_OP_Zone
gateway: 10.3.11.4
- destination_address_prefix: ::/0
vrf: Tenant_D_OP_Zone
gateway: 2001:db8:311::4
name: IPv6-test-2
- destination_address_prefix: 10.3.11.0/24
vrf: Tenant_D_OP_Zone
name: VARP
Expand Down Expand Up @@ -888,6 +884,15 @@ vlan_interfaces:
ip_address_virtual: 10.4.12.254/24
ipv6_address_virtual: 2001:db8:412::1/64
mtu: 1560
ipv6_static_routes:
- destination_address_prefix: ::/0
vrf: Tenant_D_OP_Zone
gateway: 2001:db8:311::4
name: IPv6-test-2
- destination_address_prefix: 2001:db8:311::/64
vrf: Tenant_D_OP_Zone
name: VARPv6
interface: Vlan411
vxlan_interface:
Vxlan1:
description: DC1-LEAF2B_VTEP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,11 @@ vlan_interfaces:
ip_address_virtual: 10.4.12.254/24
ipv6_address_virtual: 2001:db8:412::1/64
mtu: 1560
ipv6_static_routes:
- destination_address_prefix: 2001:db8:311::/64
vrf: Tenant_D_OP_Zone
name: VARPv6
interface: Vlan411
vxlan_interface:
Vxlan1:
description: evpn_services_l2_only_false_VTEP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ tenants:
enabled: True
ip_address_virtual: 10.3.50.1/24
Tenant_D:
ipv6_routing: true
mac_vrf_vni_base: 40000
vrfs:
Tenant_D_OP_Zone:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
ipv6_static_routes:
{% for tenant in network_services_data.tenants %}
{% for vrf in tenant.vrfs %}
{% if vrf.ipv6_static_routes is arista.avd.defined %}
{% for ipv6_static_route in vrf.ipv6_static_routes %}
{% if inventory_hostname in ipv6_static_route.nodes | arista.avd.default([inventory_hostname]) %}
- destination_address_prefix: {{ ipv6_static_route.destination_address_prefix }}
vrf: {{ vrf.name }}
{% if ipv6_static_route.gateway is arista.avd.defined %}
gateway: {{ ipv6_static_route.gateway }}
{% endif %}
{% if ipv6_static_route.distance is arista.avd.defined %}
distance: {{ ipv6_static_route.distance }}
{% endif %}
{% if ipv6_static_route.tag is arista.avd.defined %}
tag: {{ ipv6_static_route.tag }}
{% endif %}
{% if ipv6_static_route.name is arista.avd.defined %}
name: {{ ipv6_static_route.name }}
{% endif %}
{% if ipv6_static_route.metric is arista.avd.defined %}
metric: {{ ipv6_static_route.metric }}
{% endif %}
{% if ipv6_static_route.interface is arista.avd.defined %}
interface: {{ ipv6_static_route.interface }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% for svi in vrf.svis %}
{# Detect if a svi_profile exists #}
{# If exists, create a shortpath to access profile data #}
{% if svi.profile is arista.avd.defined %}
{% set svi_profile = svi_profiles[svi.profile] | arista.avd.default() %}
{% endif %}
{% set svi_varpv6 = svi.ipv6_virtual_router_addresses | arista.avd.default(
svi_profile.ipv6_virtual_router_addresses) %}
{% if svi_varpv6 is arista.avd.defined %}
{# Detect if VARP addresses with prefixes exist and loop through the ip_address/prefix #}
{# If the VARP address with prefix doesn't exist then it will loop through empty_list [], so config is not generated in this scenario #}
{% for dest_addr_prefix in svi_varpv6 | ansible.netcommon.ipaddr(0) | ansible.netcommon.ipaddr('net') %}
- destination_address_prefix: {{ dest_addr_prefix }}
vrf: {{ vrf.name }}
name: "VARPv6"
interface: Vlan{{ svi.id | int }}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
static_routes:
{% for tenant in network_services_data.tenants %}
{% for vrf in tenant.vrfs %}
Expand Down Expand Up @@ -27,32 +77,6 @@ static_routes:
{% endif %}
{% endfor %}
{% endif %}
{% if vrf.ipv6_static_routes is arista.avd.defined %}
{% for ipv6_static_route in vrf.ipv6_static_routes %}
{% if inventory_hostname in ipv6_static_route.nodes | arista.avd.default([inventory_hostname]) %}
- destination_address_prefix: {{ ipv6_static_route.destination_address_prefix }}
vrf: {{ vrf.name }}
{% if ipv6_static_route.gateway is arista.avd.defined %}
gateway: {{ ipv6_static_route.gateway }}
{% endif %}
{% if ipv6_static_route.distance is arista.avd.defined %}
distance: {{ ipv6_static_route.distance }}
{% endif %}
{% if ipv6_static_route.tag is arista.avd.defined %}
tag: {{ ipv6_static_route.tag }}
{% endif %}
{% if ipv6_static_route.name is arista.avd.defined %}
name: {{ ipv6_static_route.name }}
{% endif %}
{% if ipv6_static_route.metric is arista.avd.defined %}
metric: {{ ipv6_static_route.metric }}
{% endif %}
{% if ipv6_static_route.interface is arista.avd.defined %}
interface: {{ ipv6_static_route.interface }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% for svi in vrf.svis %}
{# Detect if a svi_profile exists #}
{# If exists, create a shortpath to access profile data #}
Expand Down

0 comments on commit fee35bf

Please sign in to comment.