mirror of
https://github.com/pivpn/pivpn.git
synced 2025-04-23 15:50:11 +00:00
add Wireguard MTU support via setupVARS.conf
This commit is contained in:
parent
d7771c2514
commit
94744c77a9
3 changed files with 16 additions and 3 deletions
|
@ -1083,6 +1083,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"
|
||||
|
@ -1096,6 +1102,7 @@ installPiVPN(){
|
|||
confNetwork
|
||||
|
||||
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||
echo "pivpnMTU=${pivpnMTU}" >> ${tempsetupVarsFile}
|
||||
|
||||
fi
|
||||
|
||||
|
@ -2047,6 +2054,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