diff --git a/nixos/modules/services/security/fail2ban.nix b/nixos/modules/services/security/fail2ban.nix index 22e3bb0066cc..716ae7a2d2f4 100644 --- a/nixos/modules/services/security/fail2ban.nix +++ b/nixos/modules/services/security/fail2ban.nix @@ -143,7 +143,7 @@ in services.fail2ban.jails.ssh-iptables = '' filter = sshd - action = iptables[name=SSH, port=ssh, protocol=tcp] + action = iptables-multiport[name=SSH, port="${concatMapStringsSep "," (p: toString p) config.services.openssh.ports}", protocol=tcp] maxretry = 5 '';