fix forwading

This commit is contained in:
soraefir
2026-05-01 18:51:45 +02:00
parent 735a9e2e0e
commit 5cbf1e8555

View File

@@ -1,15 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let
cfg = config.syscfg.net.wg;
in
{ {
config = lib.mkIf (config.syscfg.net.wg.server.enable) { config = lib.mkIf (config.syscfg.net.wg.server.enable) {
boot.kernel.sysctl = { boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1; "net.ipv4.ip_forward" = 1;
@@ -32,7 +24,7 @@ in
iifname "${from}" tcp dport ${toString src} counter dnat to ${to}:${toString dst} iifname "${from}" tcp dport ${toString src} counter dnat to ${to}:${toString dst}
iifname "${from}" udp dport ${toString src} counter dnat to ${to}:${toString dst} iifname "${from}" udp dport ${toString src} counter dnat to ${to}:${toString dst}
'' ''
) cfg.forwarding.ports} ) config.syscfg.net.wg.server.forward}
} }
chain postrouting { chain postrouting {