Fail2Ban Not Write Firewall Rule

Hi,

I do fresh Virtualmin install on Ubuntu 24.04LTS, Fail2ban jail get many ip ban in sshd but i not see block rules in firewalld. and i see in log Already Banned. it seem fail2ban not write firewall block rule.

Please help.

Thanks

There has been discussion about this topic before, search the forum you might find something.

I have try this

banaction = firewallcmd-ipset[actiontype="<multiport>"]
banaction_allports = firewallcmd-ipset[actiontype="<allports>"]

Restart Server.

But still can’t see at firewalld & iptables block rules, is i miss something?

Thanks.

@vikar,

Which distro are you using?

The op mentions ubuntu 24.04 in the first post

Hopefully you not running iptables and just Firewalld as its configured for Firewalld

image

image

(post deleted by author)

on Ubuntu 24.04 iptables is switched on (to satisfy ufw) and makes no difference to firewalld, the problem here is most likely a misconfiguration of fail2ban. @vikar have a look at the fail2ban logs to see what’s going on but I had to set most jails like this in order for it to work.


Along with other performance issues is the reason I no longer use the firewalld/fail2ban setup

Thanks it works.