Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently using iptables to block access to known ip ranges used by spam servers (specifically Ubiquity servers). My concern is that over time I know that ip ranges can change hands and I don't want the possibility of ever blocking legitimate users.

Rather than just drop the connection via -j DROP is it possible to direct that IP range to a single webpage that would say something like "We think you're a spammer. If you're not please email us"? Can this be done via iptables? Or do I need to use htaccess for this?

share|improve this question

1 Answer 1

This can be done with iptable. For example, you can DNAT them to another public IP on a server hosting the single webpage.

share|improve this answer
    
could you possibly give me an example rule that would do that? –  greatwitenorth Aug 17 '12 at 22:05
    
I have not anymore since I stopped using iptable but if you add -s 1.2.3.4 and --dport 80, 1.2.3.4 being the ip of the spammer, you can try using example #1 of chapter 6.2 netfilter.org/documentation/HOWTO/NAT-HOWTO-6.html –  coincoin Aug 17 '12 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.