mirror of
https://github.com/pivpn/pivpn.git
synced 2025-05-12 02:44:10 +02:00
Merge pull request #1278 from DerDanilo/add_mtu_support
add Wireguard MTU support via setupVARS.conf
This commit is contained in:
commit
dcd852e02e
3 changed files with 16 additions and 3 deletions
|
@ -1094,6 +1094,12 @@ installPiVPN(){
|
|||
pivpnDEV="wg0"
|
||||
pivpnNET="10.6.0.0"
|
||||
vpnGw="${pivpnNET/.0.0/.0.1}"
|
||||
# The default MTU should be fine for most users but we allow to set a
|
||||
# custom MTU via unattend setupVARs file. Use default if not provided.
|
||||
if [ -z "$pivpnMTU" ]; then
|
||||
# Using default Wireguard MTU
|
||||
pivpnMTU="1420"
|
||||
fi
|
||||
# Forward all traffic through PiVPN (i.e. full-tunnel), may be modified by
|
||||
# the user after the installation.
|
||||
ALLOWED_IPS="0.0.0.0/0, ::0/0"
|
||||
|
@ -1107,6 +1113,7 @@ installPiVPN(){
|
|||
confNetwork
|
||||
|
||||
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||
echo "pivpnMTU=${pivpnMTU}" >> ${tempsetupVarsFile}
|
||||
|
||||
fi
|
||||
|
||||
|
@ -2076,6 +2083,7 @@ confWireGuard(){
|
|||
echo "[Interface]
|
||||
PrivateKey = $($SUDO cat /etc/wireguard/keys/server_priv)
|
||||
Address = ${vpnGw}/${subnetClass}
|
||||
MTU = ${pivpnMTU}
|
||||
ListenPort = ${pivpnPORT}" | $SUDO tee /etc/wireguard/wg0.conf &> /dev/null
|
||||
echo "::: Server config generated."
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue