diff --git a/templates/global_settings.html b/templates/global_settings.html index 0288306..1c01438 100644 --- a/templates/global_settings.html +++ b/templates/global_settings.html @@ -91,9 +91,9 @@ Global Settings
2. DNS Servers
The DNS servers will be set to client config.
3. MTU
-
The MTU will be set to server config. By default it is 1420. You might want +
The MTU will be set to server and client config. By default it is 1420. You might want to adjust the MTU size if your connection (e.g PPPoE, 3G, satellite network, etc) has a low MTU.
-
Leave blank to omit this setting in the Server config.
+
Leave blank to omit this setting in the configs.
4. Persistent Keepalive
By default, WireGuard peers remain silent while they do not need to communicate, so peers located behind a NAT and/or firewall may be unreachable from other peers diff --git a/util/util.go b/util/util.go index ea97fcc..6e9e144 100644 --- a/util/util.go +++ b/util/util.go @@ -28,6 +28,10 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G if client.UseServerDNS { clientDNS = fmt.Sprintf("DNS = %s\n", strings.Join(setting.DNSServers, ",")) } + clientMTU := "" + if setting.MTU > 0 { + clientMTU = fmt.Sprintf("MTU = %d\n", setting.MTU) + } // Peer section peerPublicKey := fmt.Sprintf("PublicKey = %s\n", server.KeyPair.PublicKey) @@ -66,6 +70,7 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G clientAddress + clientPrivateKey + clientDNS + + clientMTU + forwardMark + "\n[Peer]\n" + peerPublicKey +