A firewall has been constructed using RH Fedora 13, Kernel 184.108.40.206-63, and IPTables 1.4.7. The firewall is a simple, twin adapter configuration, with the external interface (eth0) facing the internet, and the other interface (eth1) facing a small private network (single IP subnet). The firewall is a bastion host, meaning that the firewall host contains nothing but the operating system, IPTables, and only those items needed to support operation of the host itself. The firewall does not run any other applications.
Contained within the private network is a web server.
Network: Base Address: 220.127.116.11/24 Web Server: 18.104.22.168 Clients: located at various addresses on the subnet. Firewall eth1 Address: 22.214.171.124 DNS Address: 126.96.36.199
QUESTION Given that clients on the internal network can freely surf the internet: if the clients select a specific web site (ie www.website.com), my goal is to configure IPTables to instead redirect the client to the internal web server.
- If the client web browser is going to surf www.website.com, then iptables redirects the client to 188.8.131.52
- If the client web browser is going to surf any other website, then iptables permits the client to forward to the internet.
I have attempted several iptables rules, including:
iptables -v -t nat -A PREROUTING --in-interface eth1 --dport 80 -d www.website.com -j DNAT --to 184.108.40.206
However, this appears to have no effect.
Can you please recommend the rule I should be using to perform this feat?