LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-08-2012, 07:23 PM   #1
Bulletproof
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Rep: Reputation: Disabled
Post Limiting number of connections at once


I'm wondering if it's possible to limit the number of connections total on at a single time.

I already know how to set connection limits per-IP but not the amount of connections all-together that can be connected to the server at a single time.

Not really sure if it's possible either. Would appreciate any help at all.

Using linux debian iptables.
 
Old 08-08-2012, 08:18 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
It looks like somaxconn is most likely what you want http://serverfault.com/questions/271...e-of-somaxconn, but there are other params https://computing.llnl.gov/linux/slu...hroughput.html

That's just for generic TCP cxns; many services have their own configurable limit.

Last edited by chrism01; 08-08-2012 at 08:19 PM.
 
Old 08-09-2012, 05:32 AM   #3
hawk1278
LQ Newbie
 
Registered: Aug 2012
Posts: 12

Rep: Reputation: Disabled
You can do this with iptables.
/sbin/iptables -A INPUT -p tcp --syn --dport $port -m connlimit --connlimit-above N -j DROP

you can throw in --connlimit-mask and provide specific subnets as well. check the iptables man pages.
 
Old 08-09-2012, 10:01 AM   #4
Bulletproof
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hawk1278 View Post
You can do this with iptables.
/sbin/iptables -A INPUT -p tcp --syn --dport $port -m connlimit --connlimit-above N -j DROP

you can throw in --connlimit-mask and provide specific subnets as well. check the iptables man pages.
Sorry but doesn't that just limit the connections Per-IP, not the total connections from all-IPs on at a single time on the server?
 
Old 08-09-2012, 10:20 AM   #5
Bulletproof
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
It looks like somaxconn is most likely what you want http://serverfault.com/questions/271...e-of-somaxconn, but there are other params https://computing.llnl.gov/linux/slu...hroughput.html

That's just for generic TCP cxns; many services have their own configurable limit.
I'm looking for UDP since it's a gameserver (doesn't use PHP either) - not a webserver. Sorry for not mentioning that earlier on.
 
  


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
Limiting connections from ip addresses alexjohnson Linux - Server 1 12-28-2011 01:26 AM
Limiting SSH connections bmmcwhirt Linux - Security 13 03-17-2011 11:21 AM
RHEL 4: limiting VNC connections ossnap Linux - Enterprise 1 02-20-2007 03:36 PM
[shorewall]: Limiting SSH connections coralsaw Linux - Security 1 07-16-2006 07:48 AM
Limiting no. of connections per IP ^Uri^ Linux - Networking 2 08-16-2003 12:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:40 PM.

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