1

How to block access to the list of the sites and show a notification page?

This example blocking without a page, work correctly:

iptables -I FORWARD -m set --match-set site src,dst -j DROP

I try to use the next rule for hosts redirect to another server with a page:

iptables -I FORWARD -m set --match-set redirectsites src,dst -j DNAT --to-destination ipaddr

Could you explain, what is wrong on the rule above? Thank you for your answers.

Kvartu
  • 11

1 Answers1

1

you are trying to use DNAT which is a target for the nat table in the filter table.

If you want to use the DNAT target, you will have to use iptables -t nat -I PREROUTING instead of iptables -I FORWARD.