加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – fail2ban.action错误iptables -w -N f2b-

发布时间:2020-12-14 02:41:02 所属栏目:Linux 来源:网络整理
导读:我一直在使用fail2ban一段时间没有任何问题. 前几天,我决定停止fail2ban从我的默认iptables中删除一条规则.当我启动fail2ban时,它开始正常(根据命令:service fail2ban start). 但是,当我检查iptables时,我没有看到添加了fail2ban链.我检查了fail2ban日志,我
我一直在使用fail2ban一段时间没有任何问题.

前几天,我决定停止fail2ban从我的默认iptables中删除一条规则.当我启动fail2ban时,它开始正常(根据命令:service fail2ban start).

但是,当我检查iptables时,我没有看到添加了fail2ban链.我检查了fail2ban日志,我发现了几个这样的错误:

fail2ban.action [32091]: ERROR iptables -w -N f2b-
iptables -w -I INPUT -p tcp -m multiport –dports 0:65535 -j f2b- — stderr: “iptables v1.4.7: option -w' requires an argumentnTryiptables -h’ or ‘iptables –help’ for more information.niptables v1.4.7: option -w' requires an argumentnTryiptables -h’ or ‘iptables –help’ for more information.niptables v1.4.7: option -w' requires an argumentnTryiptables -h’ or ‘iptables –help’ for more information.n”

从这个日志中,似乎fail2ban试图使用-w选项运行iptables,该选项不存在.我检查了所有的fail2ban配置文件,特别是在action.d目录下,并且没有一行带有-w选项.这有多奇怪?

我不知道这里发生了什么,因此我无法使用fail2ban.

我感谢您的帮助.

解决方法

-w选项不在你的1.4.4版iptables中,它的用法在/etc/fail2ban/action.d/iptables-common.conf文件中有解释
# Option:  lockingopt
# Notes.:  Option was introduced to iptables to prevent multiple instances from
#          running concurrently and causing irratic behavior.  -w was introduced
#          in iptables 1.4.20,so might be absent on older systems
#          See https://github.com/fail2ban/fail2ban/issues/1122
# Values:  STRING
lockingopt = -w

我很想从上面的声明中删除-w,甚至将其评论出去,看看发生了什么.

检查您的yum.log以查看最近是否更新了fail2ban.如果是这样,看看它何时发生,并检查你是否有一个yumcron工作在那个时间运行.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读