Recent Changes - Search:

Softwares

.

Restrict-parallel-connections-using-iptables

Main.Restrict-parallel-connections-using-iptables History

Hide minor edits - Show changes to output

November 02, 2011, at 01:54 PM by 117.192.145.37 -
Changed lines 8-21 from:
Allows you to restrict the number of parallel connections to a server per client IP address (or client address

block).

'''[!] --connlimit-above n'''

Match if the number of existing connections is (not) above n.

'''--connlimit-mask prefix_length'''

Group hosts using the prefix length. For IPv4, this must be a number between (including) 0 and 32. For IPv6,

between 0 and 128.
to:
Allows you to restrict the number of parallel connections to a server per client IP address (or client address block).

'''[!] --connlimit-above n''' Match if the number of existing connections is (not) above n.

'''--connlimit-mask prefix_length''' Group hosts using the prefix length. For IPv4, this must be a number between (including) 0 and 32. For IPv6, between 0 and 128.
November 02, 2011, at 01:53 PM by 117.192.145.37 -
Added lines 1-52:
(:Google1:)
(:Googlemm:)
----
!!Restrict parallel connections Using Iptables
----
''connlimit''

Allows you to restrict the number of parallel connections to a server per client IP address (or client address

block).

'''[!] --connlimit-above n'''

Match if the number of existing connections is (not) above n.

'''--connlimit-mask prefix_length'''

Group hosts using the prefix length. For IPv4, this must be a number between (including) 0 and 32. For IPv6,

between 0 and 128.


!!Examples:

Allow 2 telnet connections per client host
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :)
(:cellnr:)
iptables -A INPUT -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j REJECT
(:tableend:)

You can also match the other way around:
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :)
(:cellnr:)
iptables -A INPUT -p tcp --syn --dport 23 -m connlimit ! --connlimit-above 2 -j ACCEPT
(:tableend:)

Limit the number of parallel HTTP requests to 16 per class C sized network (24 bit netmask)
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :)
(:cellnr:)
iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 16 --connlimit-mask 24 -j REJECT
(:tableend:)

Limit the number of parallel HTTP requests to 16 for the link local network
(ipv6)
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :)
(:cellnr:)
ip6tables -p tcp --syn --dport 80 -s fe80::/64 -m connlimit --connlimit-above 16 --connlimit-mask 64 -j
REJECT
(:tableend:)
----
(:Google1:)
(:Googlemm:)
Edit - History - Print - Recent Changes - Search
Page last modified on November 02, 2011, at 01:54 PM