From 14530a926c9297b66da780dca91fac76dbc81bdd Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 11 Sep 2022 10:39:35 +0200 Subject: [PATCH] configure port forwarding --- nixos/configs/robi/transmission2.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/configs/robi/transmission2.nix b/nixos/configs/robi/transmission2.nix index e0dd00c..e6ced92 100644 --- a/nixos/configs/robi/transmission2.nix +++ b/nixos/configs/robi/transmission2.nix @@ -138,6 +138,15 @@ in # notify me when download finished script-torrent-done-enabled = true; script-torrent-done-filename = completionScript; + + # Encryption preference. + # 0 = Prefer unencrypted connections, + # 1 = Prefer encrypted connections, + # 2 = Require encrypted connections; + # default = 1 + # Encryption may help get around some ISP filtering, but at the cost of slightly + # higher CPU use + encryption = 2; }; }; @@ -168,6 +177,13 @@ in networking.nat.enable = true; networking.nat.internalInterfaces = [ "ve-torrent" ]; networking.nat.externalInterface = hostInterface; + networking.nat.forwardPorts = [ + { destination = "${containerAddress}:51413"; proto = "tcp"; sourcePort = 51413; } + ]; + networking.firewall = { + allowedTCPPorts = [ 51413 ]; + allowedUDPPorts = [ 51413 ]; + }; # host nginx setup # ----------------