summary refs log tree commit diff
path: root/nixos/modules/services/networking/nat.nix
diff options
context:
space:
mode:
authorRyan Trinkle <ryan.trinkle@gmail.com>2017-11-30 13:36:48 -0500
committerRyan Trinkle <ryan.trinkle@gmail.com>2017-12-02 13:28:01 -0500
commita8f1ebf52c9a30b0beef2d4c895aa28e5e644921 (patch)
treea5d4ce85beca70c4e9e9d2bd6ec672b4b4e25105 /nixos/modules/services/networking/nat.nix
parent83048c4fe02d69a4f0d7e832fbca30d21813ece3 (diff)
downloadnixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar.gz
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar.bz2
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar.lz
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar.xz
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.tar.zst
nixpkgs-a8f1ebf52c9a30b0beef2d4c895aa28e5e644921.zip
nat: support port ranges in networking.nat.forwardPorts
Diffstat (limited to 'nixos/modules/services/networking/nat.nix')
-rw-r--r--nixos/modules/services/networking/nat.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix
index 366bb2ed7a8..e48ad7ca2bc 100644
--- a/nixos/modules/services/networking/nat.nix
+++ b/nixos/modules/services/networking/nat.nix
@@ -125,15 +125,15 @@ in
       type = with types; listOf (submodule {
         options = {
           sourcePort = mkOption {
-            type = types.int;
+            type = types.either types.int (types.strMatching "[[:digit:]]+:[[:digit:]]+");
             example = 8080;
-            description = "Source port of the external interface";
+            description = "Source port of the external interface; to specify a port range, use a string with a colon (e.g. \"60000:61000\")";
           };
 
           destination = mkOption {
             type = types.str;
             example = "10.0.0.1:80";
-            description = "Forward connection to destination ip:port";
+            description = "Forward connection to destination ip:port; to specify a port range, use ip:start-end";
           };
 
           proto = mkOption {