setup open firewall ports

This commit is contained in:
Danilo Reyes 2023-06-03 21:12:50 -06:00
parent 3189e8ba6f
commit 24226fb23d
2 changed files with 26 additions and 4 deletions

View File

@ -1,5 +1,14 @@
{ config, pkgs, ... }:
let
open_firewall_ports = [
80 # http
443 # https
25152 # ssh
49494 # gerbera
];
open_firewall_port_ranges = [
{ from = 1714; to = 1764; } # kdeconnect
];
VERSION = "23.05";
# "https://github.com/nix-community/home-manager/archive/master.tar.gz";
unstable_tarball = builtins.fetchTarball
@ -694,8 +703,10 @@ systemd.user.services = {
};
};
networking.firewall.allowedTCPPorts = [ 25152 80 443 ];
networking.firewall.allowedUDPPorts = [ 25152 80 443 ];
networking.firewall.allowedTCPPorts = open_firewall_ports;
networking.firewall.allowedUDPPorts = open_firewall_ports;
networking.firewall.allowedTCPPortRanges = open_firewall_port_ranges;
networking.firewall.allowedUDPPortRanges = open_firewall_port_ranges;
# networking.firewall.enable = false;
system = {

View File

@ -39,6 +39,15 @@ other functions.
#+begin_src nix
{ config, pkgs, ... }:
let
open_firewall_ports = [
80 # http
443 # https
25152 # ssh
49494 # gerbera
];
open_firewall_port_ranges = [
{ from = 1714; to = 1764; } # kdeconnect
];
VERSION = "23.05";
# "https://github.com/nix-community/home-manager/archive/master.tar.gz";
unstable_tarball = builtins.fetchTarball
@ -995,8 +1004,10 @@ Open ports in the firewall.
=TIP= list what app a port belongs to in a table.
#+begin_src nix
networking.firewall.allowedTCPPorts = [ 25152 80 443 ];
networking.firewall.allowedUDPPorts = [ 25152 80 443 ];
networking.firewall.allowedTCPPorts = open_firewall_ports;
networking.firewall.allowedUDPPorts = open_firewall_ports;
networking.firewall.allowedTCPPortRanges = open_firewall_port_ranges;
networking.firewall.allowedUDPPortRanges = open_firewall_port_ranges;
# networking.firewall.enable = false;
#+end_src