IPfilter
[Top] [All Lists]

Re: Limit number of outgoing connections

To: Toomas Aas <toomas.aas@raad.tartu.ee>
Subject: Re: Limit number of outgoing connections
From: Darren Reed <darrenr@reed.wattle.id.au>
Date: Fri, 22 Dec 2006 23:29:28 +1100
Cc: ipfilter@coombs.anu.edu.au
Delivered-to: sp-com-lists@consult.net
Delivered-to: ipfilter-list@securepoint.com
In-reply-to: <458AC9DB.5020605@raad.tartu.ee>
References: <458AC9DB.5020605@raad.tartu.ee>
Reply-to: darrenr@reed.wattle.id.au
Sender: owner-ipfilter@coombs.anu.edu.au
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
Toomas Aas wrote:
> Hello!
>
> I have an internal network behind a gateway running ipfilter/ipnat. Is
> it possible to limit the number of simultaneous outgoing connections
> per internal client? For example, if some client runs something like
> eMule or bittorrent it creates a lot of outgoing connections which are
> passed by a 'keep state' filter rule, and I'm afraid it fills up the
> state table.

You can define a limit per-rule, like this:

pass in proto tcp from any to any port  6881:6889  flags S keep state
(limit 10)
pass out proto tcp from any to any port  6881:6889  flags S keep state
(limit 10)

To limit inbound and outbound bittorrent connections to 10 each.
You can also over commit with rules, so that if your state table had a
max size of
100 but you had a rule like this:

pass in proto tcp from any to any port  6881:6889  flags S keep state
pass in proto tcp from any to any port  = ssh  flags S keep state (limit 10)

Will *always allow* upto 10 ssh connections, even if there are 100
bittorrent
connections.

Darren


<Prev in Thread] Current Thread [Next in Thread>