nixos-module/container/upstream: add proper networking.nat.extraStopCommands

This commit is contained in:
Astro 2021-05-14 18:37:45 +02:00
parent 5d97e85bf6
commit b23b687dfb
1 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,6 @@ in
extraCommands =
builtins.concatStringsSep "\n" (
map (net: ''
ip6tables -t nat -X ${net}_nat || true
ip6tables -t nat -N ${net}_nat
${builtins.concatStringsSep "\n" (
map (subnet: ''
@ -69,6 +68,13 @@ in
-j ${net}_nat
'') (builtins.attrNames upstreamInterfaces)
);
extraStopCommands =
builtins.concatStringsSep "\n" (
map (net: ''
ip6tables -t nat -F POSTROUTING
ip6tables -t nat -X ${net}_nat
'') (builtins.attrNames upstreamInterfaces)
);
inherit (hostConf) forwardPorts;
};
}