LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2007, 07:54 PM   #1
rodm13
LQ Newbie
 
Registered: Mar 2005
Location: The Lone Star State
Distribution: Slackware 10.2
Posts: 10

Rep: Reputation: 0
Connection rate limiting


Hi guys,

I have an interesting problem that I've been dealing with for a while. My ISP employs an IDP that disconnects a client for 5 mins or so whenever a set connections / time rate has been breached on grounds that it's 'a behavior common to viruses'. I was wondering if there was any way I could force either my computer (WinXP/Ubuntu) or the pfSense box (BSD firewall / routing platform) and me to limit the connection rate so I don't get killed whenever I would otherwise act too much like a virus.


Thanks for your help.
 
Old 11-16-2007, 05:31 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by rodm13 View Post
limit the connection rate so I don't get killed whenever I would otherwise act too much like a virus.
Do you mean limit the number of TCP/UDP connections you try to establish per unit time?

With Linux, you could use iptables' limit and state modules to DROP or REJECT packets that try to establish NEW connections faster than a certain rate:

Code:
#  Set RATE to connections/seconds allowed, BURST to the number of packets allowed w/o respect to rate,  and INET_IF to 
#  the interface for Internet access.

RATE=???
INET_IF=???
BURST=???
iptables -A OUTPUT -o $INET_IF -m state --state NEW -m limit --limit-burst $BURST --limit ${RATE}/second -j ACCEPT
iptables -A OUTPUT -o $INET_IF -m state --state NEW -j REJECT
(If you have other rules in the OUTPUT chain, you might need to break this logic into a separate user chain to prevent a conflict with the existing logic. In which case, the first rule would RETURN instead of ACCEPT.)

But I would think the application(s) that tried to initiate these connections would probably react badly to this. And it would only work for Linux. BSD might have a similar capability, but I am not familiar with it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
traffic rate limiting on specific ports. zidane_tribal Linux - Networking 8 08-03-2007 06:26 AM
Traffic rate limiting per IP on CentOS 5.0? Trionnis Linux - Networking 2 05-17-2007 07:54 AM
Iptables connection limiting ivanatora Linux - Networking 5 01-09-2005 09:56 AM
Rate limiting with Iptables on port 21 rino2003 Linux - Networking 1 12-26-2004 06:34 PM
Kernel Rate Limiting mikeyt_3333 Linux - Networking 1 10-25-2001 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration