network/roles/exit/templates/isc-dhcp-relay.j2
Timotej Lazar 99aef43574 exit: add DHCP relay for new server
Really quite shoddy as it is right now. Should get better once the old
server is retired.
2024-07-14 14:51:23 +02:00

13 lines
607 B
Django/Jinja

{% set my_server = item.0 %}
{% set my_vlans = item.1 | map(attribute='vlan.vid') | sort %}
{% set my_prefix = prefixes | selectattr("prefix", "==", my_server | ipaddr("network/prefix")) | first -%}
SERVERS="{{ my_server | ipaddr('address') }}"
{% if my_prefix.vrf.name == 'outside' %}
INTF_CMD="{{ my_vlans | map('regex_replace', '^', '-id bridge.') | join(' ') }} -iu {{ iface_uplink }} -iu peerlink.4 -U {{ my_prefix.vrf.name }}"
OPTIONS=""
{% else %}
INTF_CMD="{{ my_vlans | map('regex_replace', '^', '-id bridge.') | join(' ') }} -U bridge.{{ my_prefix.vlan.vid }}"
OPTIONS="--giaddr-src"
{% endif %}