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

Currently, I am using IPTABLES to ban people from accessing my site. Using this format in IPTABLES:

  iptables -I INPUT -s 96.266.184.52 -j DROP -m comment --comment "whatever I have to say"

I would like to instead have it setup where iptables will redirect that specific person (IP 96.266.184.52 in this case) to a webpage where it says they are banned, and the steps involved to get unbanned. Rather I do this using apache, another IP, redirecting them to a specific port, whatever the case may be I would like to not access anything of mine except that one webpage telling them how to be unbanned.

share|improve this question

1 Answer 1

To do this with iptables you could setup a virtual server in apache listening on an alternate port with the docroot set to the instructions for how to be un-banned.

iptables -t nat -I PREROUTING -p tcp --dport 80 -s 96.266.184.52 -j DNAT --to-destination $server_ip_address:$alternate_apache_port
share|improve this answer
    
This is what I was looking for. Thanks. Now if I can only perfect the damn Vhosts. –  Brian Dec 31 '09 at 3:35

Your Answer

 
discard

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