限线程脚本:
:for aaa from 2 to 254 do={/ ip firewall filter add chain=forward src-address=("192.168.1." . $aaa) protocol=tcp connection-limit=120,32 action=drop comment="Connection limit"}
限速脚本:
:for aaa from 2 to 254 do={/ queue simple add name=("queue" . $aaa) target-address=("192.168.1." . $aaa) limit-at=0/0 max-limit=400000/3000000 burst-limit=600000/10000000 burst-threshold=400000/3000000 burst-time=30/30 comment="Speed limit"}
说明:
aaa是变量
2 to 254是2~254
“192.168.1." . $aaa是IP
上两句加起来是192.168.1.2~192.168.1.254(排除路由的IP 192.168.1.1)
connection-limit=120是每个IP限制线程数
max-limit=400000/3000000 是上行/下行(注意,如果使用dst-address限制内网IP,上下行就要反过来,网上很多脚本这个地方搞错了)
转载于:https://www.cnblogs.com/seawwh/archive/2012/01/14/2322176.html