From 747edd2d725dccd518a29e59607baa4a75501314 Mon Sep 17 00:00:00 2001 From: Rajan Patel <388881+rajannpatel@users.noreply.github.com> Date: Mon, 24 Aug 2020 22:46:13 -0400 Subject: [PATCH] resolve issue #122 by defining MTU in Client conf --- wireguard-install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wireguard-install.sh b/wireguard-install.sh index d450d99..ea16b5f 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -276,11 +276,17 @@ function newClient() { HOME_DIR="/root" fi + # Read MTU value + if [ -f "/sys/class/net/${SERVER_WG_NIC}/mtu" ]; then + CLIENT_MTU="MTU = $(cat /sys/class/net/${SERVER_WG_NIC}/mtu)" + fi + # Create client file and add the server as a peer echo "[Interface] PrivateKey = ${CLIENT_PRIV_KEY} Address = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128 DNS = ${CLIENT_DNS_1},${CLIENT_DNS_2} +${CLIENT_MTU} [Peer] PublicKey = ${SERVER_PUB_KEY}