ansible-alpine-host/templates/etc/network/interfaces.j2
f c5d95d0e5e Static routing.
OVH network assigns IP addresses on a /32 subnet, so we can't add a
default gateway because it's outside the subnet.
2022-09-26 16:04:20 -03:00

17 lines
344 B
Django/Jinja

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address {{ ansible_host }}/{{ netmask }}
routes-static {{ gateway }},default via {{ gateway }}
{% if ip6 is defined %}
iface eth0 inet6 static
address {{ ip6 }}/{{ netmask6 }}
gateway {{ gateway6 }}
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
{% endif %}