{%- set interface_vrf_names = [] %}
{%- for interface in device.interfaces.all() %}
{%- for ip in interface.ip_addresses.all() %}
{%- if ip.vrf and ip.vrf.name not in interface_vrf_names %}
{%- set _ = interface_vrf_names.append(ip.vrf.name) %}
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- for vrf_name in interface_vrf_names %}
vrf instance {{ vrf_name }}
!
{%- endfor %}
{%- elif interface.name.startswith('Vlan') %}
interface {{ interface.name }}
{%- for ip in interface.ip_addresses.all() %}
ip address {{ ip.address }}
vrf {{ interface.ip_addresses.first().vrf.name }}
{%- endfor %}
{%- if interface.description %}
description {{ interface.description }}
{%- endif %}
{%- for interface in device.interfaces.all() %}
{%- if interface.name.startswith('Vlan') and interface.tags.filter(slug='vxlan').exists() %}
vrf {{ interface.ip_addresses.first().vrf.name }}
rd {{ device.interfaces.get(name="Loopback0").ip_addresses.first().address.ip }}:{{ interface.ip_addresses.first().vrf.id }}
{%- set all_targets = [] %}
{%- for target in interface.ip_addresses.first().vrf.import_targets.all() %}
{%- if target not in all_targets %}
{%- set _ = all_targets.append(target) %}
{%- endif %}
{%- endfor %}
{%- for target in interface.ip_addresses.first().vrf.export_targets.all() %}
{%- if target not in all_targets %}
{%- set _ = all_targets.append(target) %}
{%- endif %}
{%- endfor %}
{%- for target in all_targets %}
route-target import evpn {{ target }}
route-target export evpn {{ target }}
{%- endfor %}
redistribute connected
!
{%- endif %}
{%- endfor %}
no-osl-dc1-f1-r03k01-lf01#show vxlan vtep
Remote VTEPS for Vxlan1:
VTEP Tunnel Type(s)
--------------- --------------
10.16.4.2 flood
10.16.4.3 flood
10.16.4.4 flood, unicast
10.16.4.5 flood
10.16.4.6 flood
Total number of remote VTEPS: 5
no-osl-dc1-f1-r03k01-lf01#show bgp evpn route-type ip-prefix ipv4
BGP routing table information for VRF default
Router identifier 10.16.1.1, local AS number 4200131331
Route status codes: * - valid, > - active, S - Stale, E - ECMP head, e - ECMP
c - Contributing to ECMP, % - Pending BGP convergence
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop
Network Next Hop Metric LocPref Weight Path
* > RD: 10.16.1.1:1 ip-prefix 192.168.11.0/24
- - - 0 i
* >Ec RD: 10.16.1.4:1 ip-prefix 192.168.41.0/24
10.16.4.4 - 100 0 4200131329 4200131334 i
* ec RD: 10.16.1.4:1 ip-prefix 192.168.41.0/24
10.16.4.4 - 100 0 4200131329 4200131334 i
no-osl-dc1-f1-r03k02-lf02#sh vxlan vtep
Remote VTEPS for Vxlan1:
VTEP Tunnel Type(s)
--------------- --------------
10.16.4.1 unicast, flood
10.16.4.2 flood
10.16.4.3 flood
10.16.4.5 flood
10.16.4.6 flood
Total number of remote VTEPS: 5
no-osl-dc1-f1-r03k02-lf02#show bgp evpn route-type ip-prefix ipv4
BGP routing table information for VRF default
Router identifier 10.16.1.4, local AS number 4200131334
Route status codes: * - valid, > - active, S - Stale, E - ECMP head, e - ECMP
c - Contributing to ECMP, % - Pending BGP convergence
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop
Network Next Hop Metric LocPref Weight Path
* >Ec RD: 10.16.1.1:1 ip-prefix 192.168.11.0/24
10.16.4.1 - 100 0 4200131329 4200131331 i
* ec RD: 10.16.1.1:1 ip-prefix 192.168.11.0/24
10.16.4.1 - 100 0 4200131329 4200131331 i
* > RD: 10.16.1.4:1 ip-prefix 192.168.41.0/24
- - - 0 i