Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
it:net:iptables [2006-05-12 21:57] – created rosenke | it:net:iptables [2007-02-04 14:17] (current) – Recent-Modul rosenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Notizen zu iptables===== | =====Notizen zu iptables===== | ||
+ | |||
+ | ====Das Recent-Modul==== | ||
+ | |||
+ | Das Recent-Modul von iptables/ | ||
+ | |||
+ | Dieses Ziel erreicht man beispielsweise mit dem folgenden Codeschnippsel((die Variablen sind natürlich vorher entsprechend zu setzen, ebenso sollte eine Chain //ssh// vorhanden und eingebaut sein)): | ||
+ | |||
+ | < | ||
+ | #setup ssh chain | ||
+ | ${iptables} -A ssh --protocol tcp --destination ${own_ip} \ | ||
+ | --destination-port 22 --match state --state ! NEW,INVALID \ | ||
+ | --jump RETURN | ||
+ | ${iptables} -A ssh --protocol tcp --destination ${own_ip} \ | ||
+ | --destination-port 22 --match state --state NEW,INVALID \ | ||
+ | --match recent --name ssh --update --seconds 90 --hitcount 4 \ | ||
+ | --match limit --limit 2/minute \ | ||
+ | --jump LOG --log-prefix " | ||
+ | ${iptables} -A ssh --protocol tcp --destination ${own_ip} \ | ||
+ | --destination-port 22 --match state --state NEW,INVALID \ | ||
+ | --match recent --name ssh --update --seconds 90 --hitcount 4 \ | ||
+ | --jump REJECT --reject-with tcp-reset | ||
+ | ${iptables} -A ssh --protocol tcp --destination ${own_ip} \ | ||
+ | --destination-port 22 --match state --state NEW,INVALID \ | ||
+ | --match recent --name ssh --set --jump RETURN | ||
+ | </ | ||
+ | |||
+ | Einige weitere Beispiele finden sich auf der [[http:// | ||
====Miscellen==== | ====Miscellen==== | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||