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
===============================================
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
===============================================