jdeath
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/lib/WireGuard.js
|
|
@ -54,8 +54,8 @@ module.exports = class WireGuard { |
|
|
|
} |
|
|
|
|
|
|
|
await this.__saveConfig(config); |
|
|
|
await Util.exec(`wg-quick down ${WG_PATH}/wg0`).catch(() => { }); |
|
|
|
await Util.exec(`wg-quick up ${WG_PATH}/wg0`); |
|
|
|
await Util.exec(`wg-quick down ${WG_PATH}/wg0.conf`).catch(() => { }); |
|
|
|
await Util.exec(`wg-quick up ${WG_PATH}/wg0.conf`); |
|
|
|
await Util.exec(`iptables -t nat -A POSTROUTING -s ${WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o eth0 -j MASQUERADE`); |
|
|
|
await Util.exec('iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT'); |
|
|
|
await Util.exec('iptables -A FORWARD -i wg0 -j ACCEPT'); |
|
|
|