<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 5/11/2011 2:08 PM, Robert Spangler wrote:
    <blockquote cite="mid:201105111508.10168.mlists@zoominternet.net"
      type="cite">
      <pre wrap="">On Wednesday 11 May 2011 12:58, the following was written:

</pre>
      <blockquote type="cite">
        <pre wrap=""> I'm running fail2ban on my centos machine. It's handling sshd and
 postfix, and is working quite well. From the reports I'm seeing all
 the atempts are from a certain registrar's region, I won't name it,
 and was wondering instead of blocking individual ip's if there was a
 way I could block with iptables the complete region of ip's. I realize
 this will cut off a good majority of the world, but this is something
 i'm still curious about?
</pre>
      </blockquote>
      <pre wrap="">
iptables -I INPUT -i eth0 -s x.x.x.x/24 -j DROP

Replace the x's with the start of the ip address range you want to block and 
also make sure you are using the correct bit mask for that range.  If the 
interface is something other then eth0 then you will need to replace that too 
with the correct interface.  The '-I' will place this rule as the very first 
rule in the chain.  If you are using a passthrough box then replace INPUT 
with FORWARD.

</pre>
      <blockquote type="cite">
        <pre wrap=""> With regards blocking ip's and fail2ban, which method is better in
 terms of system resources, blocking via iptables as in the case of
 sshd or blocking via hosts.deny as in the case of postfix?
</pre>
      </blockquote>
      <pre wrap="">
I don't know the answer to this.  I prefer IPTABLES.


</pre>
    </blockquote>
    More efficient using iptables to stop it before its processed in the
    case of mail.<br>
    Also, look at "Spamdyke" as an alternative to stop senders,RDNS or
    ip blacklisting.<br>
    Dave<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <img src="file:///C:/Users/Dave/Desktop/logobottom.png"><br>
      David Milholen<br>
      Project Engineer<br>
      P:501-318-1300<br>
    </div>
  </body>
</html>