fail2ban iptables 回傳 200,iptables 0 引用

fail2ban iptables 回傳 200,iptables 0 引用

我安裝了fail2ban,但在啟動時我收到多個錯誤訊息:

iptables -n -L 為每個監獄提供了 0 個引用。 (應該是1?)

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain fail2ban-apache-auth (0 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0

Chain fail2ban-apache-badbots (0 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0

Chain fail2ban-apache-nokiddies (0 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0

Chain fail2ban-php-url-fopen (0 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0

我還收到以下錯誤訊息:

fail2ban.actions.action: ERROR  iptables -N fail2ban-ssh
iptables -A fail2ban-ssh -j RETURN
iptables -I <known/chain> -p tcp -m multiport --dports ssh -j fail2ban-ssh returned 200
2022-04-30 14:25:10,428 fail2ban.jail   : INFO   Jail 'skinlou_x' started
2022-04-30 14:25:10,429 fail2ban.jail   : INFO   Jail 'apache-auth' started
2022-04-30 14:25:10,430 fail2ban.actions.action: ERROR  iptables -N fail2ban-php-url-fopen
iptables -A fail2ban-php-url-fopen -j RETURN

我嘗試重新安裝fail2ban,但它總是一樣。謝謝你的幫忙。

答案1

iptables -I <known/chain> -p tcp -m multiport --dports ssh -j fail2ban-ssh returned 200

通常<known/chain>會被替換為INPUT或類似的東西。

那裡配置了哪些禁止操作?是一些自訂操作(還是有一些/etc/fail2ban/action.d/*.local文件覆蓋了某些設定)?

否則看起來版本對我來說是衝突的。您是否嘗試在舊的fail2ban版本中使用一些新的設定檔?無論如何,要完全重新安裝,請保存您的配置/etc/fail2ban,卸載fail2ban,刪除/etc/fail2ban,安裝fail2ban並嘗試/etc/fail2ban/jail.local從備份中恢復您的本地監獄配置。

另請注意https://github.com/fail2ban/fail2ban/wiki/How-to-install-or-upgrade-fail2ban-manually

順便說一句,我想知道為什麼你的 iptables 鏈被稱為fail2ban-*fail2ban,從某個 v.0.9 版本開始,是否已經使用了f2b-*鏈的名稱。
這是哪個fail2ban版本?

相關內容