1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-06-01 03:00:47 +00:00

resolve issue #122 by defining MTU in Client conf

This commit is contained in:
Rajan Patel 2020-08-24 22:46:13 -04:00 committed by GitHub
parent 315646ae12
commit 747edd2d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}