diff options
author | Michele Guerini Rocco <rnhmjoj@users.noreply.github.com> | 2020-03-04 19:12:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 19:12:25 +0100 |
commit | 481a4e938ed102d92a92a5e56f1fc186f9379d17 (patch) | |
tree | 1a6247dddc6392de20d4086472189f3a80056ba4 /nixos/modules/services | |
parent | 61d14d7a52b95fb4a17408878bb6183853a9ec31 (diff) | |
parent | 97a61c8903ada73d1aac70f477582a75f03989ba (diff) | |
download | nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar.gz nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar.bz2 nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar.lz nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar.xz nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.tar.zst nixlib-481a4e938ed102d92a92a5e56f1fc186f9379d17.zip |
Merge pull request #81597 from thatsmydoing/multiport-nat
nixos/nat: fix multiple destination ports with loopback
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/networking/nat.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix index 9c658af30f75..21ae9eb8b6d4 100644 --- a/nixos/modules/services/networking/nat.nix +++ b/nixos/modules/services/networking/nat.nix @@ -65,7 +65,7 @@ let let m = builtins.match "([0-9.]+):([0-9-]+)" fwd.destination; destinationIP = if (m == null) then throw "bad ip:ports `${fwd.destination}'" else elemAt m 0; - destinationPorts = if (m == null) then throw "bad ip:ports `${fwd.destination}'" else elemAt m 1; + destinationPorts = if (m == null) then throw "bad ip:ports `${fwd.destination}'" else builtins.replaceStrings ["-"] [":"] (elemAt m 1); in '' # Allow connections to ${loopbackip}:${toString fwd.sourcePort} from the host itself iptables -w -t nat -A nixos-nat-out \ |