# Fail2Ban Reports Banned IPs but FirewallD Is Stopped — Bans Not Enforced After Service Restarts

**URL:** <https://forum.virtualmin.com/t/fail2ban-reports-banned-ips-but-firewalld-is-stopped-bans-not-enforced-after-service-restarts/138271>\
**Category:** Virtualmin\
**Created:** [November 3, 2026, 5:06pm UTC](https://forum.virtualmin.com/t/fail2ban-reports-banned-ips-but-firewalld-is-stopped-bans-not-enforced-after-service-restarts/138271 "2026-11-03T17:06:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlesworks](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/charlesworks/32/5685_2.png) [@charlesworks](https://forum.virtualmin.com/u/charlesworks)\
**Post date:** [November 3, 2026, 5:06pm UTC](https://forum.virtualmin.com/t/fail2ban-reports-banned-ips-but-firewalld-is-stopped-bans-not-enforced-after-service-restarts/138271/1 "2026-11-03T17:06:20Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Debian 12 |
| Webmin version | 2.670 |
| Virtualmin version | 8.3.0 GPL |
| Webserver version | Apache 2.4.68 |
| Related packages | FirewallD Fail2Ban |

I encountered what may be a potentially serious issue today involving Fail2Ban and FirewallD on one of my Debian 12 Virtualmin servers. It may affect other Virtualmin installations.

I believe my situation relates to an earlier discussion where @Ilia addressed the importance of FirewallD and Fail2Ban startup order:

> [@Virtualmin fail2ban + firewalld Ubuntu 20.04 not working "already banned", until restart](https://forum.virtualmin.com/t/virtualmin-fail2ban-firewalld-ubuntu-20-04-not-working-already-banned-until-restart/116565):
>
> SYSTEM INFORMATION OS type and version Ubuntu 20.04 Webmin version 1.999 Virtualmin version 7.1-1 Related packages Automatically updated including apps & security I think there is something wrong with fail2ban + firewalld running on Ubuntu servers. I leave a screenshot of the problem I am referring to. Even though fail2ban is detecting that a user should be blocked, apparently the communication with FirewallD is not working properly. You can see it in the log because the log is…

## The Initial Problem

Today I noticed unusually high CPU utilization across Virtualmin servers around 9:40–9:45 AM Eastern Time. One of them was nearly saturated for over an hour. At 10:40 AM, its statistics showed:

- CPU: 100% utilization

- Load averages: 14.53, 12.64, 10.75

- CPU cores: 2

- RAM: 4 GB

- Swap usage: approximately 1.37 GB

Investigation revealed numerous PHP-FPM processes consuming CPU across multiple WordPress websites.

Apache access logs showed extensive automated XML-RPC requests and malicious PHP file scanning across several domains.

## Fail2Ban Appeared to Be Working

Fail2Ban was running normally and reporting:

- XML-RPC failures detected: 328,656

- Total bans: 975

- Currently banned IPs: 137

- Ban duration: 86,400 seconds

- Maximum retries: 3

- Find time: 600 seconds

- Ban action: firewallcmd-ipset

My XML-RPC filter was correctly detecting requests such as:

`POST //xmlrpc.php HTTP/1.1`

However, several addresses reported as already banned continued appearing in Apache’s access logs. That prompted me to examine actual firewall enforcement.

## The Actual Problem

Although Fail2Ban reported 137 banned IP addresses, examining the Linux IP sets revealed:

```auto
Name: f2b-xmlrpc
References: 0
Number of entries: 0

Name: f2b-apache-404
References: 0
Number of entries: 0

```

All six Fail2Ban IP sets were empty, with zero firewall references.

Additionally:

- No Fail2Ban rules appeared in iptables.

- No matching Fail2Ban rules appeared in nftables.

- FirewallD was inactive.

- D-Bus was inactive.

Attempting to use `firewall-cmd` produced:

```auto
Error: DBUS_ERROR: Failed to connect to socket
/run/dbus/system_bus_socket: No such file or directory

```

The Fail2Ban log also showed:

```auto
ERROR Failed to execute ban jail 'apache-404'
action 'firewallcmd-ipset'
Error starting action: 'Script error'

```

**In other words, Fail2Ban was detecting attacks and maintaining its banned-IP list, but the actual firewall was not enforcing those bans.**

## Service History

The system journal showed that FirewallD stopped on October 21, 2026, at 8:14 AM.

There was no subsequent successful startup recorded until I manually started it today.

Fail2Ban had started on October 27, six days after FirewallD stopped.

The systemd dependencies showed:

```auto
firewalld.service:
Requires=dbus.socket sysinit.target system.slice

fail2ban.service:
After=... firewalld.service ...

```

Fail2Ban has an `After=firewalld.service` ordering dependency, but no `Requires=firewalld.service` dependency.

Consequently, Fail2Ban can start while FirewallD is unavailable.

## How I Restored Protection

I performed the following steps:

```auto
systemctl start dbus.socket
systemctl start dbus.service
systemctl start firewalld

```

After confirming FirewallD was running and its public zone had loaded correctly, I restarted Fail2Ban:

```auto
systemctl restart fail2ban

```

The results were immediate.

Fail2Ban restored its bans and recreated the firewall rules:

```auto
Name: f2b-xmlrpc
References: 1
Number of entries: 120

Name: f2b-apache-404
References: 1
Number of entries: 4

Name: f2b-xmlrpc6
References: 1
Number of entries: 4

```

The corresponding IPv4 and IPv6 firewall rules were also restored.

The XML-RPC jail then reported 124 currently banned addresses, matching the 120 IPv4 and 4 IPv6 entries.

The server’s load had already returned to normal before these service restarts, so I cannot attribute the CPU recovery directly to restoring FirewallD.

## Possible Connection to System Updates

Recently, I’ve discovered that several services on my Debian servers were not being restarted following package updates.

I generally avoid rebooting these servers unless a kernel update requires it. I’ve consequently started using `needrestart` to identify services requiring attention.

I don’t know whether this contributed to FirewallD being stopped, but the timing makes me wonder.

I have not established what originally stopped FirewallD on October 21.

## Questions for @Ilia and/or @Jamie

1. Should Virtualmin ensure FirewallD is running before Fail2Ban starts, particularly when using `firewallcmd-ipset` actions?

2. Should Fail2Ban be restarted automatically if FirewallD is restarted and its firewall rules or IP sets have been lost?

3. Is there an existing Virtualmin mechanism to detect when Fail2Ban reports banned IP addresses that are not actually enforced by the firewall?

4. Could package updates or service restarts leave FirewallD stopped while Fail2Ban continues operating normally?

5. Would you recommend addressing this through Virtualmin, the Debian service configuration, or Fail2Ban’s systemd dependencies?

I have deliberately avoided making custom systemd changes because I would prefer a solution compatible with Virtualmin’s standard configuration and future updates.

I operate Debian 12 and Debian 13 Virtualmin servers, and we recently standardized the Fail2Ban configurations across them. My concern is that other systems running Virtualmin might exhibit the same behavior without administrators realizing their reported bans aren’t being enforced.

I hope this is helpful and always welcome your thoughts on whether this represents an issue Virtualmin could help detect or prevent.

Thanks, as always, for your continued work on Virtualmin and Webmin!

---

<div class="post-metadata">

**Author:** ![Randomz](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@Randomz](https://forum.virtualmin.com/u/Randomz)\
**Post date:** [November 4, 2026, 12:39am UTC](https://forum.virtualmin.com/t/fail2ban-reports-banned-ips-but-firewalld-is-stopped-bans-not-enforced-after-service-restarts/138271/2 "2026-11-04T00:39:34Z")

</div>

Not sure that it is Virtualmin’s job to apply bandaids because of OS and app failures?

It’s just a control panel after all. Though a very good one.

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [November 21, 2026, 2:55pm UTC](https://forum.virtualmin.com/t/fail2ban-reports-banned-ips-but-firewalld-is-stopped-bans-not-enforced-after-service-restarts/138271/3 "2026-11-21T14:55:10Z")

</div>

This looks like a service issue on that server.

Firewalld seems to have stopped on October 21, and Fail2ban started six days later. Fail2ban kept counting bans, but its `firewallcmd-ipset` action couldn’t apply them while firewalld was down.

Webmin already restarts a running Fail2ban when you start or restart `firewalld` through Webmin’s FirewallD module.

I don’t see a Webmin or Virtualmin bug here. I’d check the system journal and package history around 8:14 AM on October 21 to find out why `firewalld` stopped.
