nixos-module/container/upstream: flush conntrack states after nat startup

This commit is contained in:
Astro 2023-06-07 23:00:50 +02:00
parent e48343ac8c
commit 6c4c86e4a5
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ hostName, config, lib, ... }:
{ hostName, config, lib, pkgs, ... }:
let
hostConf = config.site.hosts.${hostName};
@ -126,6 +126,10 @@ in
-j RETURN
'') upstreamInterfaces.${net}.upstream.noNat.subnets6
) (builtins.attrNames upstreamInterfaces)}
# There just have been moments without a complete ruleset. Flush
# out invalid conntrack states!
${pkgs.conntrack-tools}/bin/conntrack -F
'';
extraStopCommands = ''
iptables -F FORWARD 2>/dev/null || true