summaryrefslogtreecommitdiff
path: root/roles/network/wireguard/gateway/templates/systemd.network.j2
blob: 6847aa6a1cb0617528cbffdbed874f295b48591c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Match]
Name={{ item.key }}

[Network]
{% for addr in item.value.addresses %}
Address={{ addr }}
{% endfor %}
{% if 'ip_masq' in item.value and item.value.ip_masq %}
IPMasquerade=yes
{% endif %}
{% if 'default_gateway' in item.value %}

[Route]
Destination=0.0.0.0/1
Gateway={{ item.value.default_gateway.inner }}

[Route]
Destination=128.0.0.0/1
Gateway={{ item.value.default_gateway.inner }}
{% endif %}