servers/roles/radvd/templates/radvd.conf.j2
2025-07-31 12:15:48 +02:00

20 lines
691 B
Django/Jinja

{% for iface in interfaces
| defaultattr('mgmt_only') | rejectattr('mgmt_only')
| selectattr('enabled') %}
{% for address in iface.ip_addresses | selectattr("family.value", "==", 6) %}
{# get the gateway for this subnet #}
{% set subnet = address.address | ipaddr('subnet') %}
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
{% set gateway = prefix.custom_fields.gateway.address %}
{# if we are gateway, send RAs on this interface #}
{% if gateway is defined and gateway == address.address %}
interface {{ iface.name }} {
AdvSendAdvert on;
prefix ::/64;
RDNSS {{ dns6 | join(' ') }} { };
DNSSL {{ domain }} { };
};
{% endif %}
{% endfor %}
{% endfor %}