大网数据广告活动
服务器运维问答

Fail2ban ipset - which conf to use?

· 52CE 我爱测

I have read that iptables can be slow in case of large number of ip addresses and ipset is more preferred in that scenario. I would like to use ipset banaction but there are at least 3 of them, iptables-ipset-proto4.conf, iptable…

问题原文

原帖链接 · mezano · CC BY-SA 4.0

I have read that iptables can be slow in case of large number of ip addresses and ipset is more preferred in that scenario. I would like to use ipset banaction but there are at least 3 of them, iptables-ipset-proto4.conf, iptable-ipset-proto6.conf, iptables-ipset-proto6-allports.conf, so which one to use?

OS: Ubuntu server 20.04
Webserver: Nginx
Fail2ban: 0.11.1
Ipset: 7.5

已采纳解答

原帖链接 · sebres · CC BY-SA 4.0

Those actions are:

  • iptables-ipset-proto6 - multi-port action (can ban IP for single or multiple ports)
  • iptables-ipset-proto6-allports - allports action (bannig IP for all ports)
  • iptables-ipset-proto4 - old action for ipset before v6.14

To use it compatible to iptable actions behaviour, you can set it in your jail.local in default section (overwritting defaults of jail.conf) like here:

[DEFAULT]
banaction = iptables-ipset-proto6
banaction_allports = iptables-ipset-proto6-allports

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-11-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。