New variable networking_main_iface

This commit is contained in:
nemunaire 2023-11-14 10:02:44 +01:00
parent 8c0cc3b42d
commit 0995761cf6
2 changed files with 7 additions and 5 deletions

View File

@ -4,3 +4,5 @@ ssh_authorized_keys_extra: []
watchdog_reboot_timer: 16 watchdog_reboot_timer: 16
watchdog_reset_timer: 10 watchdog_reset_timer: 10
networking_main_iface: "eth0"

View File

@ -6,16 +6,16 @@ iface lo inet loopback
{% endif %} {% endif %}
# The main interface # The main interface
auto eth0 auto {{ networking_main_iface }}
{% if bridged_network is defined and bridged_network %} {% if bridged_network is defined and bridged_network %}
auto br0 auto br0
iface br0 iface br0
requires eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%} requires {{ networking_main_iface }}{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
bridge-ports eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%} bridge-ports {{ networking_main_iface }}{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
bridge-fd 0 bridge-fd 0
bridge-stp off bridge-stp off
{% else %} {% else %}
iface eth0 iface {{ networking_main_iface }}
{% endif %} {% endif %}
{% if hw_address is defined %} {% if hw_address is defined %}
hwaddress ether {{ hw_address }} hwaddress ether {{ hw_address }}
@ -33,7 +33,7 @@ iface eth0
{% if bridged_network is defined and bridged_network %} {% if bridged_network is defined and bridged_network %}
up echo 0 > /proc/sys/net/ipv6/conf/br0/accept_ra up echo 0 > /proc/sys/net/ipv6/conf/br0/accept_ra
{% else %} {% else %}
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra pre-up echo 0 > /proc/sys/net/ipv6/conf/{{ networking_main_iface }}/accept_ra
{% endif %} {% endif %}
{% else %} {% else %}
address {{ wanted_ip6 }}/128 address {{ wanted_ip6 }}/128