fix(wg+fw): Startup-nftables-Render + /32-Hinweis bei Peer-AllowedIPs

Zwei unabhängige Fixes für das WireGuard peer-to-peer Problem:

1. Startup-nftables-Render: edgeguard-api rendert beim Start die
   nftables-Konfiguration neu. Damit werden Template-Änderungen aus
   einem Update (z.B. 1.1.51 WG-forward-Rule) sofort aktiv, ohne
   dass der Operator manuell eine Firewall-Mutation triggern müsste.

2. UI-Hint: Peer-AllowedIPs-Feld erklärt explizit warum /32 nötig
   ist und was /24 kaputtmacht (Server routet ganzen Subnet-Block zu
   einem Peer → andere Peers nicht mehr erreichbar).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-21 12:34:12 +02:00
parent a0403b8d00
commit 1f0d05019e
4 changed files with 16 additions and 3 deletions

View File

@@ -1 +1 @@
1.1.51
1.1.52

View File

@@ -404,6 +404,19 @@ func main() {
// scheduler. StartPeriodicVerification is a no-op when the key
// is empty.
licClient.StartPeriodicVerification(licKeyStore.Get())
// Startup-Render nftables: stellt sicher dass Template-Änderungen
// aus einem Update (z.B. neue WireGuard forward-Chain-Auto-Regel)
// sofort nach dem API-Restart aktiv werden — ohne dass der
// Operator manuell eine Mutation triggern müsste. nft -f ist
// idempotent und atomar; kein Dienst wird neu gestartet.
go func() {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if err := firewallrender.New(pool).Render(ctx); err != nil {
slog.Warn("startup: nftables render failed", "error", err)
}
}()
}
mountUI(r)

View File

@@ -636,7 +636,7 @@
"publicKey": "Public-Key",
"publicKeyExtra": "Wird vom Peer-Gerät erzeugt; hier nur paste-bar wenn der Peer schon ein Key-Pair hat.",
"allowedIPs": "Allowed IPs",
"allowedIPsExtra": "Welche Tunnel-IPs darf dieser Peer benutzen. Typisch /32 = eine IP.",
"allowedIPsExtra": "Die IP die dieser Peer im Tunnel bekommt — muss /32 sein (z. B. 10.0.10.2/32), nicht das ganze Subnetz (/24). Mit /24 würde der Server allen Verkehr zu diesem einen Peer routen und andere Peers wären nicht erreichbar.",
"keepalive": "Keepalive (sec)",
"keepaliveExtra": "0 = aus. Empfohlen 25 hinter NAT.",
"lastHandshake": "Letzter Handshake",

View File

@@ -636,7 +636,7 @@
"publicKey": "Public key",
"publicKeyExtra": "Generated by the peer device; only paste here if the peer already has a keypair.",
"allowedIPs": "Allowed IPs",
"allowedIPsExtra": "Which tunnel IPs this peer is allowed to use. Typically /32 = one IP.",
"allowedIPsExtra": "The IP this peer gets in the tunnel — must be /32 (e.g. 10.0.10.2/32), not the whole subnet (/24). Using /24 would route all subnet traffic to this one peer, making other peers unreachable.",
"keepalive": "Keepalive (sec)",
"keepaliveExtra": "0 = off. Recommended 25 behind NAT.",
"lastHandshake": "Last handshake",