[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables e numero connessioni



Il giorno 20-06-2003 9:57, alessandro, masacar@virgilio.it ha scritto:

> ma se io volessi permettere al massimo 3 connessioni simultanee su
> quella dport, e poi rifiutare le altre, cioè che la regola sopra venisse
> applicata soltanto dopo che la macchina 192.168.1.5 ha effettuato 3
> connessioni sulla porta 8888, e che non possa effettuarne di più.

dai un'occhiata alle patch nel sito netfilter.org

patch-o-matic comprende la iplimit.patch

The base/iplimit patch:
Author: Gerd Knorr <kraxel@bytesex.org>
Status: ItWorksForMe[tm]
      
This adds CONFIG_IP_NF_MATCH_IPLIMIT match allows you to restrict the
number of parallel TCP connections to a server per client IP address
(or address block).
           
Examples:
# allow 2 telnet connections per client host
iptables -p tcp --syn --dport 23 -m iplimit --iplimit-above 2 -j REJECT
            
# you can also match the other way around:
iptables -p tcp --syn --dport 23 -m iplimit ! --iplimit-above 2 -j ACCEPT
                  
# limit the nr of parallel http requests to 16 per class C sized
# network (24 bit netmask)
iptables -p tcp --syn --dport 80 -m iplimit --iplimit-above 16
--iplimit-mask 24 -j REJECT

ciao
Mario



Reply to: