Skip to content

Commit 7952a49

Browse files
authored
Merge pull request #1674 from chgchi/my_dev
fix a bug for wireguard server ipv6
2 parents 05e7544 + a0c82f9 commit 7952a49

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

plugins/interface/amneziawg_intf_plugin.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ class AmneziawgInterfacePlugin extends WireguardInterfacePlugin {
5858
}
5959

6060
getDefaultMTU() {
61-
// in case wireguard is 1412:
62-
// Obfuscation mode (H1–H4/S1–S2, etc. enabled) +4~8 bytes
63-
// High obfuscation (with JC/JMIN/JMAX enabled + random padding) +8~16 bytes
64-
// Leave an 8-byte safety margin to prevent PMTU ICMP anomalies.
65-
// 1412 - 8 - 16 - 8 = 1380
66-
return 1380;
61+
// since official amneziawg client (both mac and windows) is using 1376 as MTU, we use the same value here
62+
return 1376;
6763
}
6864

6965

plugins/interface/wireguard_intf_plugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class WireguardInterfacePlugin extends InterfaceBasePlugin {
176176
const v4Subnets = this.networkConfig.ipv4s ? this.networkConfig.ipv4s.map(addr => new Address4(addr)) : [new Address4(this.networkConfig.ipv4)];
177177
let v6Subnets = [];
178178
if (this.networkConfig.ipv6) {
179+
const ipv6 = this.networkConfig.ipv6;
179180
v6Subnets.push(...(_.isArray(ipv6) ? ipv6.map(addr => new Address6(addr)) : [new Address6(ipv6)]));
180181
}
181182
if (_.isArray(this.networkConfig.peers)) {

0 commit comments

Comments
 (0)