nat: always flush nixos nat rules on firewall start/reload

Fixes #27510
This commit is contained in:
Markus Mueller 2017-08-03 17:41:07 +00:00 committed by Robin Gloster
parent d604336b5b
commit 53d2f0980d
No known key found for this signature in database
GPG Key ID: 5E4C836C632C2882

View File

@ -151,7 +151,9 @@ in
###### implementation ###### implementation
config = mkIf config.networking.nat.enable { config = mkMerge [
{ networking.firewall.extraCommands = mkBefore flushNat; }
(mkIf config.networking.nat.enable {
environment.systemPackages = [ pkgs.iptables ]; environment.systemPackages = [ pkgs.iptables ];
@ -164,7 +166,7 @@ in
}; };
networking.firewall = mkIf config.networking.firewall.enable { networking.firewall = mkIf config.networking.firewall.enable {
extraCommands = mkMerge [ (mkBefore flushNat) setupNat ]; extraCommands = setupNat;
extraStopCommands = flushNat; extraStopCommands = flushNat;
}; };
@ -184,5 +186,6 @@ in
postStop = flushNat; postStop = flushNat;
}; }; }; };
}; })
];
} }