alpine: drop hints from interface configuration

Turns out ifupdown-ng ignores "inet static" and "inet loopback" hints
on iface lines. The interface named "lo" is always used as loopback.
This commit is contained in:
Timotej Lazar 2025-07-16 13:07:15 +02:00
parent cabf831962
commit d1cf462f64

View file

@ -1,7 +1,7 @@
{# Loopback interface must be present so define it here if none exists. #} {# Loopback interface must be present so define it here if none exists. #}
{% if interfaces | rejectattr("name", "==", "lo") %} {% if interfaces | rejectattr("name", "==", "lo") %}
auto lo auto lo
iface lo inet loopback iface lo
{% endif -%} {% endif -%}
@ -12,7 +12,7 @@ iface lo inet loopback
| rejectattr('mgmt_only') | rejectattr('mgmt_only')
| selectattr('enabled') %} | selectattr('enabled') %}
auto {{ iface.name }} auto {{ iface.name }}
iface {{ iface.name }} inet {% if iface.name == "lo" %}loopback{% else %}static{% endif +%} iface {{ iface.name }}
{% if iface.mtu %} {% if iface.mtu %}
mtu {{ iface.mtu }} mtu {{ iface.mtu }}
{% endif %} {% endif %}