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

What exactly do --limit 1/s and --limit-burst mean in iptables rules?

· 52CE 我爱测

I'm using CentOS 5.x trying to wrap my mind around the following iptables rule on one of my servers: -A RH-Firewall-1-INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT On another server I have: -A RH-Firewall-…

问题原文

原帖链接 · Mike B · CC BY-SA 3.0

I'm using CentOS 5.x trying to wrap my mind around the following iptables rule on one of my servers:

-A RH-Firewall-1-INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT

On another server I have:

-A RH-Firewall-1-INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s --limit-burst 3 -j ACCEPT

I understand that both of these rules are designed to allow (and throttle) incoming ping requests but what is the limit-burst option about? And are these allowances on a per host basis? Or do they apply to any/all incoming ICMP connections at all?

已采纳解答

原帖链接 · Evan Anderson · CC BY-SA 3.0

The math is fully explained in the netfilter docs, but it's reasonable to say that the limit-burst argument specifies the number of matches that are allow through before the limit of 1 per second "kicks in". These two rules both apply only to ICMP echo request packets (incoming PING requests). These are not per-host limits and apply to anything the rule matches (which, in this case, would be all ICMP echo requests).

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

资料来源与适用范围

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

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

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