Skip to contentSkip to conversation

is it possible to limit the connection number?

DISCUSSION SB CH 2 participants 2 messages Feb 28, 2003 – Mar 5, 2003

lore
Share & tools
lore

SB CH

author
#0 lore raw

Hello all.

I would like to limit the connection number per ip using iptables extension function. for example, one can connect the firewall behinded server just 10 per a hour.

Is it possible to set using iptables?

thanks in advance.

_________________________________________________________________
고.. 감.. 도.. 사.. 랑.. 만.. 들.. 기.. MSN 러브 http://www.msn.co.kr/love/

#1 lore raw
Quoted 8 lines · SB CH

Hello all.

I would like to limit the connection number per ip
using iptables extension function.
for example, one can connect the firewall behinded server just 10 per a hour.

Is it possible to set using iptables?

You can use the limit-match for this:

iptables -A FORWARD -s $LIMITED_HOST -d $DESTINATION \
-m state --state NEW -m limit --limit 10/hour -j ACCEPT

But you need some dropping/rejection rule later as well. And be sure that you have some rule which allows ESTABLISHED connections, like

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT

But i think that's more a work for some application-proxy like Squid...

Quoted 1 line

thanks in advance.

Hope that helps,
Alex

Signature · 2 lines
"Mr Data, when I said 'Fire at Will', I didn't mean for you to be so literal."
Instructions for use of this post: Insert tounge in cheek. Read as normal.