New variable: wanted_ip6_suffix

This commit is contained in:
nemunaire 2023-11-14 10:03:01 +01:00
parent 0995761cf6
commit df3cc89354
2 changed files with 13 additions and 2 deletions

View File

@ -66,7 +66,7 @@
template:
src: networking.j2
dest: /etc/network/interfaces
when: wanted_ip4 is defined or wanted_ip6 is defined
when: wanted_ip4 is defined or wanted_ip6 is defined or wanted_ip6_suffix is defined
tags:
- networking

View File

@ -8,16 +8,24 @@ iface lo inet loopback
# The main interface
auto {{ networking_main_iface }}
{% if bridged_network is defined and bridged_network %}
{% if bridged_network != "true" %}
{% for iface in bridged_network.split(" ") %}
auto {{ iface }}
{% endfor %}
{% endif %}
auto br0
iface br0
requires {{ networking_main_iface }}{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
bridge-ports {{ networking_main_iface }}{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
bridge-fd 0
bridge-stp off
{% if hw_address is defined %}
pre-up ip link set dev {{ networking_main_iface }} address {{ hw_address }}
{% endif %}
{% else %}
iface {{ networking_main_iface }}
{% endif %}
{% if hw_address is defined %}
{% if bridged_network is not defined and hw_address is defined %}
hwaddress ether {{ hw_address }}
{% endif %}
{% if wanted_ip4 is defined %}
@ -26,6 +34,9 @@ iface {{ networking_main_iface }}
{% else %}
use dhcp
{% endif %}
{% if wanted_ip6_suffix is defined %}
up ip token set {{ wanted_ip6_suffix }}/64 dev {% if bridged_network is defined and bridged_network %}br0{% else %}{{ networking_main_iface }}{% endif %}
{% endif %}
{% if wanted_ip6 is defined %}
{% if local_network.gateway6 is defined %}
address {{ wanted_ip6 }}/64