diff --git a/sys/platforms/vps/srv/net.nix b/sys/platforms/vps/srv/net.nix index 927e347..fc97444 100644 --- a/sys/platforms/vps/srv/net.nix +++ b/sys/platforms/vps/srv/net.nix @@ -3,7 +3,9 @@ pkgs, ... }: -with lib; { +with lib; let + inherit (config.local.sys) nets; +in { networking = { nftables.enable = false; # learn how to use this later firewall = { @@ -52,7 +54,11 @@ with lib; { fail2ban = { enable = true; bantime = "10m"; - ignoreIP = ["37.205.12.34"]; # Never ban the server's own IP + ignoreIP = [ + nets.default.hosts.vps.v6.cidr + nets.default.hosts.vps.v4.address + nets.vpn.v6.cidr + ]; bantime-increment = { enable = true; formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";