add: client MTU settings available from command line

This commit is contained in:
Paul Fournet 2022-04-04 12:54:20 +00:00
parent ad4ca4d9bb
commit 026bca5078
3 changed files with 11 additions and 1 deletions

View file

@ -27,6 +27,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 ClientMTU > 0 {
clientMTU = fmt.Sprintf("MTU = %d\n", ClientMTU)
}
// Peer section
peerPublicKey := fmt.Sprintf("PublicKey = %s\n", server.KeyPair.PublicKey)
@ -60,6 +64,7 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
clientAddress +
clientPrivateKey +
clientDNS +
clientMTU +
"\n[Peer]\n" +
peerPublicKey +
peerPresharedKey +