Make wireguard mtu configurable

This commit is contained in:
Wojciech Kozlowski 2023-07-20 20:50:42 +02:00
parent 80e101768f
commit 444308d6a5
3 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,3 @@
---
vpn_wireguard_iface: "wg0"
vpn_wireguard_mtu: 1420

View File

@ -9,6 +9,9 @@ argument_specs:
vpn_wireguard_iface: vpn_wireguard_iface:
type: "str" type: "str"
required: true required: true
vpn_wireguard_mtu:
type: "int"
required: true
vpn_wireguard_role: vpn_wireguard_role:
type: "str" type: "str"
required: true required: true

View File

@ -2,7 +2,7 @@ auto {{ vpn_wireguard_iface }}
iface {{ vpn_wireguard_iface }} inet static iface {{ vpn_wireguard_iface }} inet static
pre-up /usr/local/sbin/ip-link-add.sh $IFACE type wireguard pre-up /usr/local/sbin/ip-link-add.sh $IFACE type wireguard
pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
pre-up ip link set mtu 1420 dev $IFACE pre-up ip link set mtu {{ vpn_wireguard_mtu }} dev $IFACE
post-up /usr/local/sbin/post-up-$IFACE-inet.nft post-up /usr/local/sbin/post-up-$IFACE-inet.nft
post-up /usr/local/sbin/post-up-$IFACE-ipv4.nft post-up /usr/local/sbin/post-up-$IFACE-ipv4.nft