Browse Source

Merge pull request #900 from gravitl/bugfix_v0.12.0_ext_client_mtu

ext client MTU
Alex Feiszli 3 years ago
parent
commit
b73272bdee
1 changed files with 7 additions and 0 deletions
  1. 7 0
      controllers/ext_client.go

+ 7 - 0
controllers/ext_client.go

@@ -151,9 +151,15 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
 	if network.DefaultExtClientDNS != "" {
 	if network.DefaultExtClientDNS != "" {
 		defaultDNS = "DNS = " + network.DefaultExtClientDNS
 		defaultDNS = "DNS = " + network.DefaultExtClientDNS
 	}
 	}
+
+	defaultMTU := 1420
+	if gwnode.MTU != 0 {
+		defaultMTU = int(gwnode.MTU)
+	}
 	config := fmt.Sprintf(`[Interface]
 	config := fmt.Sprintf(`[Interface]
 Address = %s
 Address = %s
 PrivateKey = %s
 PrivateKey = %s
+MTU = %d
 %s
 %s
 
 
 [Peer]
 [Peer]
@@ -164,6 +170,7 @@ Endpoint = %s
 
 
 `, client.Address+"/32",
 `, client.Address+"/32",
 		client.PrivateKey,
 		client.PrivateKey,
+		defaultMTU,
 		defaultDNS,
 		defaultDNS,
 		gwnode.PublicKey,
 		gwnode.PublicKey,
 		newAllowedIPs,
 		newAllowedIPs,