Browse Source

Fix: Client Address Cidr (#2217)

fix client cidr
pull/2221/head
Bernd Storath 8 months ago
committed by GitHub
parent
commit
76d5944726
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      src/server/utils/wgHelper.ts

7
src/server/utils/wgHelper.ts

@ -85,12 +85,9 @@ PostDown = ${iptablesTemplate(hooks.postDown, wgInterface)}`;
) => {
const { enableIpv6 = true } = options;
const cidr4Block = parseCidr(wgInterface.ipv4Cidr).prefix;
const cidr6Block = parseCidr(wgInterface.ipv6Cidr).prefix;
const address =
`${client.ipv4Address}/${cidr4Block}` +
(enableIpv6 ? `, ${client.ipv6Address}/${cidr6Block}` : '');
`${client.ipv4Address}/32` +
(enableIpv6 ? `, ${client.ipv6Address}/128` : '');
const hookLines = [
client.preUp ? `PreUp = ${client.preUp}` : null,

Loading…
Cancel
Save