nixos: fix ip46tables invocation in nat

This commit is contained in:
Bernardo Meurer
2019-12-14 20:13:12 -08:00
parent 367676ce82
commit 5ee439eb08
3 changed files with 18 additions and 13 deletions
+3 -12
View File
@@ -42,16 +42,7 @@ let
kernelHasRPFilter = ((kernel.config.isEnabled or (x: false)) "IP_NF_MATCH_RPFILTER") || (kernel.features.netfilterRPFilter or false);
helpers =
''
# Helper command to manipulate both the IPv4 and IPv6 tables.
ip46tables() {
iptables -w "$@"
${optionalString config.networking.enableIPv6 ''
ip6tables -w "$@"
''}
}
'';
helpers = import ./helpers.nix { inherit config lib; };
writeShScript = name: text: let dir = pkgs.writeScriptBin name ''
#! ${pkgs.runtimeShell} -e
@@ -271,7 +262,7 @@ let
apply = canonicalizePortList;
example = [ 22 80 ];
description =
''
''
List of TCP ports on which incoming connections are
accepted.
'';
@@ -282,7 +273,7 @@ let
default = [ ];
example = [ { from = 8999; to = 9003; } ];
description =
''
''
A range of TCP ports on which incoming connections are
accepted.
'';