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

我一直在使用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 argument\nTryiptables -h’ or ‘iptables –help’ for more information.\niptables v1.4.7: option -w' requires an argument\nTryiptables -h’ or ‘iptables –help’ for more information.\niptables v1.4.7: option -w' requires an argument\nTryiptables -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工作在那个时间运行.

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...