Linux Netfilter discussions
 help / color / mirror / Atom feed
* Bastion Firewall Host Redirect Question
@ 2010-12-14 14:54 iic1tls
  2010-12-14 14:59 ` Jonathan Tripathy
  2010-12-14 20:01 ` Billy Crook
  0 siblings, 2 replies; 7+ messages in thread
From: iic1tls @ 2010-12-14 14:54 UTC (permalink / raw)
  To: netfilter

Dear All,
 
Thank you for your time, and please reply to this message if you have any
suggestions.
 
Before posing my question, some background:
 
A firewall has been constructed using RH Fedora 13, Kernel 2.6.34.7-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: 149.10.10.0/24
Web Server: 149.10.10.25
Clients: located at various addresses on the subnet.
Firewall eth1 Address: 149.10.10.1
DNS Address: 149.10.10.2
 
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 149.10.10.25
- 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 149.10.10.25
 
However, this appears to have no effect.
 
Can you please recommend the rule I should be using to perform this feat?
 
THANK YOU


^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Bastion Firewall Host Redirect Question
@ 2010-12-14 15:10 iic1tls
  0 siblings, 0 replies; 7+ messages in thread
From: iic1tls @ 2010-12-14 15:10 UTC (permalink / raw)
  To: netfilter

From: iic1tls [mailto:iic1tls@yahoo.com] 
Sent: Tuesday, December 14, 2010 9:10 AM
To: 'Jonathan Tripathy'; 'netfilter@vger.kernel.org'
Subject: RE: Bastion Firewall Host Redirect Question

Thanks Jonathan, but I can not modify the DNS.  I need an IPTables solution.

THANK YOU

-----Original Message-----
From: Jonathan Tripathy [mailto:jonnyt@abpni.co.uk] 
Sent: Tuesday, December 14, 2010 8:59 AM
To: iic1tls@yahoo.com; netfilter@vger.kernel.org
Subject: Re: Bastion Firewall Host Redirect Question


>
> 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 149.10.10.25
> - If the client web browser is going to surf any other website, then
> iptables permits the client to forward to the internet.
>
>
Use a local DNS server and set the hostname of the site that you want to 
re-direct to your local webserver. You can secure this setup a bit more 
by using a proxy server (Squid + SquidGuard) to prevent clients entering 
the IPs directly. The only thing that IPTables would do is make sure 
that only your proxy server can access the internet directly


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-17 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14 14:54 Bastion Firewall Host Redirect Question iic1tls
2010-12-14 14:59 ` Jonathan Tripathy
2010-12-14 15:10   ` iic1tls
2010-12-14 17:32     ` /dev/rob0
2010-12-14 20:01 ` Billy Crook
2010-12-17 21:35   ` Pascal Hambourg
  -- strict thread matches above, loose matches on Subject: below --
2010-12-14 15:10 iic1tls

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox