Custom iptables entry point?

wdatkinson

Verified User
Joined
Nov 18, 2004
Messages
56
Location
Indianapolis, IN
I just deployed Jeff's outstanding spam blocker:

http://www.directadmin.com/forum/showthread.php?s=&threadid=10036&highlight=spamblocker

As soon as I restarted exim after installing the new .conf file, I immediately started watching /var/log/exim/rejectlog

I noticed that 99% of the spam I was getting was coming from one IP address. And the amount of spam received from this address was huge.

I decided to block that IP address with iptables via this:

iptables -I INPUT -s xx.xx.xx.xx -j DROP

Obviously where xx.xx.xx.xx was the IP address of the spam source.

Since I've blocked the IP address the amount of spam I'm receiving has dropped 95%. Sure Jeff's SpamBlocker was catching ALL of it, but why should I waste the resources of my server for this one IP?

At any rate I'm wondering where the best place to insert this iptables rule would be? I looked at /etc/init.d/iptables however there doesn't appear to be a clear place to insert custom rules.
 
I'm not sure where to put it but you must have found a good place :) .

iptables is quite a bit more efficient than spamblocker because it works at the kernel level.

Good Idea!

Jeff
 
If you're not using a firewall script that you can put custom rules into, I would put these at the bottom of /etc/rc.local.
 
I misunderstood the poster.

I thought he was putting them into the firewall setup RH creates.

Jeff
 
Well, to test out the idea, I just entered it at the shell prompt.

I want to make it more permanent, so I was looking for a good place to put it. The RHE iptables script is a bit different that what I've worked with in earlier versions/distros.

Looks like /etc/rc.d/rc.local will be the winner.
 
Back
Top