network/roles/exit/templates/networks.intf.j2
Timotej Lazar 9a56e48141 exit: allow multiple VLANs per VRF
Turns out that while Cumulus supports “up to” 255 VRFs, no switch it
runs on supports more than 64. So we have to turn down paranoia and
put internal networks for each tenant in the same VRF.

This commit just ensures VRF definitions are not duplicated on exits.
2024-08-04 14:12:26 +02:00

12 lines
464 B
Django/Jinja

{# VRF outside is special, all others are inside but also firewalled from each other. #}
{% set inside_vrfs = interfaces | selectattr('parent') | selectattr('parent.name', '==', 'bridge')
| selectattr('vrf') | map(attribute='vrf') | rejectattr('name', '==', 'outside') | unique -%}
# A separate VRF for each inside network so we can firewall between them.
{% for vrf in inside_vrfs %}
auto {{ vrf.name }}
iface {{ vrf.name }}
vrf-table auto
{% endfor %}