Browse Source

fix server config

missing cidr block in server config
pull/1363/head
Bernd Storath 8 months ago
parent
commit
900347e099
  1. 5
      src/server/utils/WireGuard.ts

5
src/server/utils/WireGuard.ts

@ -19,6 +19,9 @@ class WireGuard {
async #saveWireguardConfig() { async #saveWireguardConfig() {
const system = await Database.getSystem(); const system = await Database.getSystem();
const clients = await Database.getClients(); const clients = await Database.getClients();
const cidrBlock = ip.cidrSubnet(
system.userConfig.addressRange
).subnetMaskLength;
let result = ` let result = `
# Note: Do not edit this file directly. # Note: Do not edit this file directly.
# Your changes will be overwritten! # Your changes will be overwritten!
@ -26,7 +29,7 @@ class WireGuard {
# Server # Server
[Interface] [Interface]
PrivateKey = ${system.interface.privateKey} PrivateKey = ${system.interface.privateKey}
Address = ${system.interface.address} Address = ${system.interface.address}/${cidrBlock}
ListenPort = ${system.wgPort} ListenPort = ${system.wgPort}
PreUp = ${system.iptables.PreUp} PreUp = ${system.iptables.PreUp}
PostUp = ${system.iptables.PostUp} PostUp = ${system.iptables.PostUp}

Loading…
Cancel
Save