git.iko.soy/typeable/nixpkgs
on master help sign in
nat: support port ranges in networking.nat.forwardPorts
commita8f1ebf52c9a30b0beef2d4c895aa28e5e644921 authorRyan Trinkle <ryan.trinkle@gmail.com> dateThu 30 Nov 2017, 13:36 (9 years ago) parent83048c4
1 file changed+3−3
nixos/modules/services/networking/nat.nix+3−3
nixos/modules/services/networking/nat.nix+3−3
@@ -125,15 +125,15 @@ in
125125 type = with types; listOf (submodule {
126126 options = {
127127 sourcePort = mkOption {
128− type = types.int;
128+ type = types.either types.int (types.strMatching "[[:digit:]]+:[[:digit:]]+");
129129 example = 8080;
130− description = "Source port of the external interface";
130+ description = "Source port of the external interface; to specify a port range, use a string with a colon (e.g. \"60000:61000\")";
131131 };
132132
133133 destination = mkOption {
134134 type = types.str;
135135 example = "10.0.0.1:80";
136− description = "Forward connection to destination ip:port";
136+ description = "Forward connection to destination ip:port; to specify a port range, use ip:start-end";
137137 };
138138
139139 proto = mkOption {