What's new

Session Limiting with IPTables

  • 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!

artizan

New Around Here
Just finished installing Merlin firmware on my router.

I want to limit a certain torrenter on my network, googling suggests I limit the TCP/UDP sessions in IPTables.
Since i'm rather new to all this custom firmware stuff, I found some code that might help me with this:
Code:
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p tcp --syn -m connlimit --connlimit-above 350 -j DROP
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p ! tcp -m connlimit --connlimit-above 250 -j DROP
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p udp -m limit --limit 20/sec --limit-burst 30 j ACCEPT

I'm not sure where I need to put this code?
 
Just finished installing Merlin firmware on my router.

I want to limit a certain torrenter on my network, googling suggests I limit the TCP/UDP sessions in IPTables.
Since i'm rather new to all this custom firmware stuff, I found some code that might help me with this:
Code:
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p tcp --syn -m connlimit --connlimit-above 350 -j DROP
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p ! tcp -m connlimit --connlimit-above 250 -j DROP
iptables -t filter -I FORWARD -s 192.168.1.0/24 -p udp -m limit --limit 20/sec --limit-burst 30 j ACCEPT

I'm not sure where I need to put this code?

Well once you have fixed the syntax and manually entered via SSH/TELNET to prove that the rules do what you expect, then /jffs/scripts/firewall-start might be a good place for them.
 
thanks for your reply.
I'm not having much luck with asuswrt-merlin QoS or iptables to stop torrenters, does the QoS in this firmware not work or something?

I've done the usual QoS rules researched from this forum, set the upload to 70%, download to 95%, used a connlimit of only 50, but everytime the torrent program will cause the all of the clients including myself to stop accessing the net.
I made a several rules, performed restarts, nothing seems to work, i really want to try avoid configuring the client itself and have the router handle the work.

I will try Tomato for QoS and see how I go.
 

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