防火牆和 iptables |失敗2禁止

防火牆和 iptables |失敗2禁止

我在 Almalinux 伺服器上執行fail2ban 1.0.2。似乎按預期工作,但我對某些事情感到困惑。

  1. 在jail.d有sshd.local和00-firewalld.local(從epel安裝了fail2ban和fail2ban-firewalld)。

  2. 00-firewalld.local 內含:

    [DEFAULT]
    banaction = firewallcmd-rich-rules
    banaction_allports = firewallcmd-rich-rules
    

但是,當我執行fail2ban-client時取得sshd操作

 The jail sshd has the following actions:
 iptables-multiport

我的印像是它應該返回:

 firewallcmd-rich-rules

但是,什麼都沒有。這可能可以解釋為什麼

 firewall-cmd --list-rich-rules

什麼都不返回,而

 iptables -S

傳回所有 IP 位址的列表

 fail2ban-client get sshd banip 

列表。換句話說,fail2ban 正在將內容彈出到 iptables 中,但 firewalld 似乎不在循環中。

那麼,希望有人能解釋一下發生了什麼事嗎?我顯然錯過了一些東西。

相關內容