Difference between revisions of "Iptables"
From DarkWiki
(Created page with "==Block SSH brute force attacks== With logging: <source lang="bash"> iptables -N LOGDROP iptables -A LOGDROP -j LOG iptables -A LOGDROP -j DROP iptables -I INPUT -p tcp --dp...") |
(No difference)
|
Revision as of 06:54, 12 April 2016
Block SSH brute force attacks
With logging:
iptables -N LOGDROP
iptables -A LOGDROP -j LOG
iptables -A LOGDROP -j DROP
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 5 -j LOGDROP
Without logging:
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 5 -j DROP
Block entire subnets
iptables -A INPUT -s 58.218.0.0/16 -j DROP