Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 and --dport 80, being the ip of the spammer, you can try using example #1 of chapter 6.2 – user130370 Aug 17 '12 at 22:19

Your Answer


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.