55 lines
1.6 KiB
Django/Jinja
55 lines
1.6 KiB
Django/Jinja
# The loopback network interface
|
|
auto lo
|
|
iface lo inet loopback
|
|
{% if local_network.dns is defined %}
|
|
dns-nameservers {{ local_network.dns }}
|
|
{% endif %}
|
|
|
|
# The main interface
|
|
auto eth0
|
|
{% if bridged_network is defined and bridged_network %}
|
|
auto br0
|
|
iface br0
|
|
requires eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
|
|
bridge-ports eth0{% if bridged_network != "true" %} {{ bridged_network }}{% endif +%}
|
|
bridge-fd 0
|
|
bridge-stp off
|
|
{% else %}
|
|
iface eth0
|
|
{% endif %}
|
|
{% if hw_address is defined %}
|
|
hwaddress ether {{ hw_address }}
|
|
{% endif %}
|
|
{% if wanted_ip4 is defined %}
|
|
address {{ wanted_ip4 }}/24
|
|
gateway {{ local_network.gateway }}
|
|
{% else %}
|
|
use dhcp
|
|
{% endif %}
|
|
{% if wanted_ip6 is defined %}
|
|
{% if local_network.gateway6 is defined %}
|
|
address {{ wanted_ip6 }}/64
|
|
gateway {{ local_network.gateway6 }}
|
|
{% if bridged_network is defined and bridged_network %}
|
|
up echo 0 > /proc/sys/net/ipv6/conf/br0/accept_ra
|
|
{% else %}
|
|
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
|
|
{% endif %}
|
|
{% else %}
|
|
address {{ wanted_ip6 }}/128
|
|
post-up ip addrlabel add prefix {{ wanted_ip6 }}/64 label 99
|
|
post-up ip addrlabel add prefix {{ wanted_ip6 }}/128 label 1
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if wanted_serekh is defined %}
|
|
auto wg-serekh
|
|
iface wg-serekh inet6 static
|
|
address {{ wanted_serekh }}/64
|
|
pre-up ip link add dev wg-serekh type wireguard
|
|
pre-up wg setconf wg-serekh /etc/wireguard/wg-serekh.conf
|
|
post-down ip link delete dev wg-serekh
|
|
{% endif %}
|
|
|
|
source-directory /etc/network/interfaces.d
|