Skip to content

Commit

Permalink
Update wg_server
Browse files Browse the repository at this point in the history
CHANGE: Allow use of  'MTU ='  in .conf to override 1420 default - SNB Forums member @bearnet
  • Loading branch information
MartineauUK committed Feb 12, 2022
1 parent f15fbd7 commit 8415641
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wg_server
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,13 @@ if [ "$2" != "disable" ];then
cmd ip -6 link set up dev $VPN_ID
fi

MTU=$(awk '/^MTU/ {print $3}' ${CONFIG_DIR}${VPN_ID}.conf) # v4.15.5
[ -z "$MTU" ] && cmd ifconfig $VPN_ID mtu 1420 || cmd ifconfig $VPN_ID mtu 1420 # v4.15.5 v1.02
MTU=$(awk '/^MTU/ {print $3}' ${CONFIG_DIR}${VPN_ID}.conf) # v4.15.5
if [ -z "$MTU" ];then
cmd ifconfig $VPN_ID mtu 1420 # v4.15.5
else
cmd ifconfig $VPN_ID mtu $MTU # v4.15.5 v1.02
sed -i 's/^MTU/#MTU/' ${CONFIG_DIR}${VPN_ID}.conf
fi

TIMESTAMP=$(date +%s)
sqlite3 $SQL_DATABASE "INSERT into session values('$WG_INTERFACE','Start','$TIMESTAMP');" # v1.13
Expand Down

0 comments on commit 8415641

Please sign in to comment.