From 82dfc79b644b463dc817e38c65d1e471154d8af3 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 22 Jul 2024 19:35:34 +0000 Subject: [PATCH] Open necessary firewall ports for serving web requests --- quinn/etc/nixos/configuration.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quinn/etc/nixos/configuration.nix b/quinn/etc/nixos/configuration.nix index b0ea132..48bde86 100644 --- a/quinn/etc/nixos/configuration.nix +++ b/quinn/etc/nixos/configuration.nix @@ -181,10 +181,14 @@ #services.unifi.unifiPackage = pkgs.unifi8; # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; + networking.firewall = { + enable = true; + allowedTCPPorts = [ 80 443 ]; + allowedUDPPortRanges = [ + #{ from = 4000; to = 4007; } + #{ from = 8000; to = 8010; } + ]; + }; # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you