alpine: don’t set IPv6 gateway
Will get it from RA. Also don’t disable SLAAC for IPv4‐only interfaces.
This commit is contained in:
parent
fb8e0189af
commit
39fec47f87
1 changed files with 11 additions and 5 deletions
|
@ -4,15 +4,21 @@ iface lo inet loopback
|
||||||
{% for iface in interfaces | selectattr('enabled') %}
|
{% for iface in interfaces | selectattr('enabled') %}
|
||||||
auto {{ iface.name }}
|
auto {{ iface.name }}
|
||||||
iface {{ iface.name }} inet static
|
iface {{ iface.name }} inet static
|
||||||
{% for ip in iface.ip_addresses %}
|
{% for address in iface.ip_addresses %}
|
||||||
address {{ ip.address }}
|
address {{ address.address }}
|
||||||
{% set subnet = ip.address | ipaddr('subnet') %}
|
{% if address.family.value == 4 %}
|
||||||
|
{% set subnet = address.address | ipaddr('subnet') %}
|
||||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
||||||
{% set gateway = prefix.custom_fields.gateway.address %}
|
{% set gateway = prefix.custom_fields.gateway.address %}
|
||||||
{% if gateway is defined and gateway != ip.address %}
|
{% if gateway is defined and gateway != address.address %}
|
||||||
gateway {{ gateway | ipaddr('address') }}
|
gateway {{ gateway | ipaddr('address') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endif %}
|
||||||
|
{% endfor -%}
|
||||||
|
|
||||||
|
{# disable SLAAC if we have a manually set IPv6 address #}
|
||||||
|
{% if iface.ip_addresses | selectattr("family.value", "==", 6) %}
|
||||||
pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
|
pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue