Using iptables to rate-limit incoming connections

Using iptables to rate-limit incoming connections

Postby stephen » Tue Mar 24, 2009 6:35 am

Using iptables to rate-limit incoming connections

See this article for a discussion on iptables and rate limiting incoming connections.

http://www.debian-administration.org/articles/187

An example is probably the simplest way to illustrate how it works. The following two rules will limit incoming connections to port 22 to no more than 3 attemps in a minute - an more than that will be dropped:


Code: Select all
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent \
  --set

iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent \
  --update --seconds 60 --hitcount 4 -j DROP
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to Linux Server Configuration Notes

Who is online

Users browsing this forum: No registered users and 2 guests

cron