2023-12-18 10:22:14 +00:00
|
|
|
{% for iface in interfaces | iface_real | rejectattr('mgmt_only') | selectattr('enabled') %}
|
|
|
|
auto {{ iface.name }}
|
|
|
|
iface {{ iface.name }}
|
|
|
|
{% if iface.vrf %}
|
|
|
|
vrf {{ iface.vrf.name }}
|
2023-12-11 20:08:52 +00:00
|
|
|
{% endif -%}
|
|
|
|
|
|
|
|
{# Set allowed VLANs if we are part of the bridge. #}
|
|
|
|
{% if iface.bridge and iface.mode %}
|
|
|
|
{% if iface.mode.value == 'access' and iface.untagged_vlan %}
|
|
|
|
bridge-access {{ iface.untagged_vlan.vid }}
|
|
|
|
{% elif iface.mode.value == 'tagged' and iface.tagged_vlans %}
|
|
|
|
bridge-vids {{ iface.tagged_vlans | map(attribute='vid') | join(' ') }}
|
|
|
|
{% endif %}
|
2023-12-18 10:22:14 +00:00
|
|
|
{% endif %}
|
|
|
|
mtu {{ iface.mtu if iface.mtu else 9216 }}
|
|
|
|
{% for addr in iface.ip_addresses %}
|
|
|
|
address {{ addr.address }}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% endfor %}
|