What's new

Help to check firewall-start script

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

zyu4router

Occasional Visitor
I wrote the following script to limit possible bad designed apps (P2P) for using too many sessions causing network issues.

But it seemed not working after I tested. Please kindly help to see if there is anything wrong.

Thanks in advance!

===============================================
#!/bin/sh

RATE=10
MAXCONN=100

iptables -I FORWARD -i br0 -p tcp --syn -s 192.168.1.0/24 -m limit --limit $RATE/s -j DROP
iptables -I FORWARD -i br0 -p tcp --syn --dport 1024:49151 -s 192.168.1.0/24 -m connlimit --connlimit-above $MAXCONN -j DROP

exit 0
===============================================
 
Keep in mind that Torrents mostly uses UDP these days, not TCP. That might also be the case with whichever application you are trying to throttle.

You will also need to disable NAT acceleration to be able to make use of the FORWARD chain.
 
Keep in mind that Torrents mostly uses UDP these days, not TCP. That might also be the case with whichever application you are trying to throttle.

You will also need to disable NAT acceleration to be able to make use of the FORWARD chain.

Thanks RMerlin for your prompt reply.

I am not worrying about the UDP session as the connection time out is quite short.

I will try to disable the NAT acceleration. thanks!!!
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top