Role wireguard: set mtu and link-local address
This commit is contained in:
parent
13b470b5c9
commit
dc1f469265
1 changed files with 2 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
{% for network in my_wireguard_networks %}
|
{% for network in my_wireguard_networks %}
|
||||||
auto wg-{{ network.remote[:11] }}
|
auto wg-{{ network.remote[:11] }}
|
||||||
iface wg-{{ network.remote[:11] }}
|
iface wg-{{ network.remote[:11] }}
|
||||||
|
mtu 1420
|
||||||
ipv6-addrgen off
|
ipv6-addrgen off
|
||||||
{% if magic < network.remote_magic %}
|
{% if magic < network.remote_magic %}
|
||||||
address {{ network.ipv4 | ipaddr('ip/prefix') }}
|
address {{ network.ipv4 | ipaddr('ip/prefix') }}
|
||||||
|
@ -12,6 +13,7 @@ iface wg-{{ network.remote[:11] }}
|
||||||
address {{ network.ipv4 | ipaddr('1') | ipaddr('ip/prefix') }}
|
address {{ network.ipv4 | ipaddr('1') | ipaddr('ip/prefix') }}
|
||||||
address {{ network.ipv6 | ipaddr('1') | ipaddr('ip/prefix') }}
|
address {{ network.ipv6 | ipaddr('1') | ipaddr('ip/prefix') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
address {{ 'fe80::/64' | ipaddr(magic) | ipaddr('ip/prefix') }}
|
||||||
pre-up ip link add dev $IFACE type wireguard
|
pre-up ip link add dev $IFACE type wireguard
|
||||||
pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
|
pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
|
||||||
post-up ip link set up dev $IFACE
|
post-up ip link set up dev $IFACE
|
||||||
|
|
Loading…
Reference in a new issue