nixos/iperf: add openFirewall setting
Opens the specified tcp port.
commit2ebeba49276b4a0e7764ad65f33a0572ff4f1963
authorMatthieu Coudron <mattator@gmail.com>
dateThu 4 Jul 2019, 14:32 (7 years ago)
parente6b6815
nixos/modules/services/networking/iperf3.nix+10
@@ -19,6 +19,11 @@ let
1919 default = null;
2020 description = "Bind to the specific interface associated with the given address.";
2121 };
22+ openFirewall = mkOption {
23+ type = types.bool;
24+ default = false;
25+ description = "Open ports in the firewall for iperf3.";
26+ };
2227 verbose = mkOption {
2328 type = types.bool;
2429 default = false;
@@ -52,6 +57,11 @@ let
5257 };
5358
5459 imp = {
60+
61+ networking.firewall = mkIf cfg.openFirewall {
62+ allowedTCPPorts = [ cfg.port ];
63+ };
64+
5565 systemd.services.iperf3 = {
5666 description = "iperf3 daemon";
5767 unitConfig.Documentation = "man:iperf3(1) https://iperf.fr/iperf-doc.php";