first working version
This commit is contained in:
parent
43e8780420
commit
d5858fe595
4 changed files with 19 additions and 10 deletions
|
|
@ -1,14 +1,20 @@
|
|||
auto wg_{{ item.name }}
|
||||
iface w_{{ item.name }} inet static
|
||||
iface wg_{{ item.name }} inet static
|
||||
{% for i in item.ip %}
|
||||
address {{ i }}
|
||||
{% endif %}
|
||||
pre-up ip link add $IFACE type wireguard
|
||||
{% endfor %}
|
||||
pre-up ip link add $IFACE type wireguard || true
|
||||
pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
|
||||
{% for i in item.route %}
|
||||
up ip route add {{ i }} dev $IFACE
|
||||
{% endfor %}
|
||||
post-down ip link del $IFACE
|
||||
|
||||
iface w_{{ item.name }} inet6 static
|
||||
iface wg_{{ item.name }} inet6 static
|
||||
# static IP address
|
||||
{% for i in item.ip6 %}
|
||||
address {{ i }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for i in item.route6 %}
|
||||
up ip -6 route add {{ i }} dev $IFACE
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue