Dmitry Tantsur f65b52ed8d Remove questionable defaults from the network configuration
We definitely should not default to using Google DNS or assuming a
specific MTU. The default gateway won't work for many deployments.

Remove them, refactor network_metadata and add some unit tests.

Change-Id: Icb5d077a5f68b5affc1ed545e04c96dcc01d9f3e
2022-02-18 12:43:03 +01:00

19 lines
556 B
Django/Jinja

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto {{ node_default_network_interface }}
{% if addressing_mode is defined and "dhcp" in addressing_mode %}
iface {{ node_default_network_interface }} inet dhcp
{% else %}
iface {{ node_default_network_interface }} inet static
address {{ ipv4_address }}
netmask {{ ipv4_subnet_mask }}
{% if ipv4_gateway | default('') != '' %}
gateway {{ ipv4_gateway }}
{% endif %}
{% if ipv4_nameserver | default('') != '' %}
dns-nameservers {{ ipv4_nameserver }}
{% endif %}
{% endif %}