diff --git a/src/config.js b/src/config.js index 72314ae1..ab66251f 100644 --- a/src/config.js +++ b/src/config.js @@ -13,6 +13,7 @@ module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; module.exports.WG_DEVICE = process.env.WG_DEVICE || 'eth0'; module.exports.WG_HOST = process.env.WG_HOST; module.exports.WG_PORT = process.env.WG_PORT || '51820'; +module.exports.WG_SERVER_MTU = process.env.WG_SERVER_MTU; module.exports.WG_CONFIG_PORT = process.env.WG_CONFIG_PORT || process.env.WG_PORT || '51820'; module.exports.WG_MTU = process.env.WG_MTU || null; module.exports.WG_PERSISTENT_KEEPALIVE = process.env.WG_PERSISTENT_KEEPALIVE || '0'; diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 77a8fdb1..f6ed92ba 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -108,7 +108,7 @@ module.exports = class WireGuard { PrivateKey = ${config.server.privateKey} Address = ${config.server.address}/24 ListenPort = ${WG_PORT} -MTU = ${WG_SERVER_MTU} +${WG_SERVER_MTU ? `MTU = ${WG_SERVER_MTU}` : ''} PreUp = ${WG_PRE_UP} PostUp = ${WG_POST_UP} PreDown = ${WG_PRE_DOWN}