From 476bd0f13e25564adb3b434540f22687d7942096 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Fri, 28 Jul 2023 22:51:24 +0200 Subject: [PATCH] Use the interface file method to set mtu --- vpn/wireguard/templates/client/IFACE | 3 ++- vpn/wireguard/templates/server/IFACE | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vpn/wireguard/templates/client/IFACE b/vpn/wireguard/templates/client/IFACE index 4445f58..4a67497 100644 --- a/vpn/wireguard/templates/client/IFACE +++ b/vpn/wireguard/templates/client/IFACE @@ -2,7 +2,6 @@ auto {{ vpn_wireguard_iface }} iface {{ vpn_wireguard_iface }} inet6 static pre-up /usr/local/sbin/ip-link-add.sh $IFACE type wireguard pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf - pre-up ip link set mtu {{ vpn_wireguard_mtu }} dev $IFACE post-up /usr/local/sbin/post-up-$IFACE-inet.nft post-up ip -6 route add default dev $IFACE table {{ vpn_wireguard_routing_table }} @@ -10,6 +9,8 @@ iface {{ vpn_wireguard_iface }} inet6 static pre-down ip -6 route del default dev $IFACE table {{ vpn_wireguard_routing_table }} pre-down /usr/local/sbin/pre-down-$IFACE-inet.nft + mtu {{ vpn_wireguard_mtu }} + address {{ vpn_wireguard_inet6_address }}/{{ vpn_wireguard_inet6_prefixlen }} iface {{ vpn_wireguard_iface }} inet static diff --git a/vpn/wireguard/templates/server/IFACE b/vpn/wireguard/templates/server/IFACE index 44c5ce1..e66f2c3 100644 --- a/vpn/wireguard/templates/server/IFACE +++ b/vpn/wireguard/templates/server/IFACE @@ -2,7 +2,6 @@ auto {{ vpn_wireguard_iface }} iface {{ vpn_wireguard_iface }} inet6 static pre-up /usr/local/sbin/ip-link-add.sh $IFACE type wireguard pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf - pre-up ip link set mtu {{ vpn_wireguard_mtu }} dev $IFACE post-up /usr/local/sbin/post-up-$IFACE-inet.nft {% if vpn_wireguard_routing_table is defined %} @@ -24,6 +23,8 @@ iface {{ vpn_wireguard_iface }} inet6 static {% endif %} pre-down /usr/local/sbin/pre-down-$IFACE-inet.nft + mtu {{ vpn_wireguard_mtu }} + address {{ vpn_wireguard_inet6_address }}/{{ vpn_wireguard_inet6_prefixlen }} iface {{ vpn_wireguard_iface }} inet static