iptables对指定ip限速
对上行(上传)限速:
iptables -t filter -I FORWARD -s 192.168.10.188 -j DROP
iptables -t filter -I FORWARD -m limit -s 192.168.10.188 --limit 100/s --limit-burst 100 -j ACCEPT
对下行(下载)限速:
iptables -t filter -I FORWARD -d 192.168.10.188 -j DROP
iptables -t filter -I FORWARD -m limit -d 192.168.10.188 --limit 100/s --limit-burst 100 -j ACCEPT
其中--limit 100/s是限制每秒数据包数量,一般情况下每个数据包可以按照1500个字节计算;
--limit: Specifies the rate at what tokens get refilled into the bucket. 4/hour means 4 tokens per hour (1 token every 15 minutes).
--limit: 指定将令牌重新填充到存储桶中的速率。4/hour表示每小时4个令牌(每15分钟1个令牌)。
--limit-burst: Specifies the maximum amount of tokens that can be filled in the bucket. (This is also the amount of tokens the bucket starts out with).
--limit-burst: 指定存储桶中可以填充的令牌的最大数量。(这也是存储桶开始使用的令牌数量)。
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
